Get the address and the size of the variable for passing to the Target::CreateWatchpointLocation() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139614 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectFrame.cpp b/source/Commands/CommandObjectFrame.cpp
index d214439..8bf9b14 100644
--- a/source/Commands/CommandObjectFrame.cpp
+++ b/source/Commands/CommandObjectFrame.cpp
@@ -522,8 +522,14 @@
                             // Process watchpoint if necessary.
                             if (m_option_watchpoint.watch_variable)
                             {
-                                lldb::addr_t addr = LLDB_INVALID_ADDRESS;
+                                AddressType addr_type;
+                                lldb::addr_t addr = valobj_sp->GetAddressOf(false, &addr_type);
                                 size_t size = 0;
+                                if (addr_type == eAddressTypeLoad) {
+                                    // We're in business.
+                                    // Find out the size of this variable.
+                                    size = valobj_sp->GetByteSize();
+                                }
                                 uint32_t watch_type = m_option_watchpoint.watch_type;
                                 WatchpointLocation *wp_loc =
                                     exe_ctx.target->CreateWatchpointLocation(addr, size, watch_type).get();