[Lldb-commits] [lldb] r193191 - Simplified the code that materializes a variable,

Sean Callanan scallanan at apple.com
Tue Oct 22 13:01:17 PDT 2013


Author: spyffe
Date: Tue Oct 22 15:01:17 2013
New Revision: 193191

URL: http://llvm.org/viewvc/llvm-project?rev=193191&view=rev
Log:
Simplified the code that materializes a variable,
obviating the need to create a new ValueObject.

Modified:
    lldb/trunk/source/Expression/Materializer.cpp

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=193191&r1=193190&r2=193191&view=diff
==============================================================================
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Tue Oct 22 15:01:17 2013
@@ -461,17 +461,11 @@ public:
         }
         else
         {
-            Error get_address_error;
-            lldb::ValueObjectSP addr_of_valobj_sp = valobj_sp->AddressOf(get_address_error);
-            if (get_address_error.Success())
+            lldb::addr_t addr_of_valobj = valobj_sp->GetAddressOf();
+            if (addr_of_valobj != LLDB_INVALID_ADDRESS)
             {
-                DataExtractor valobj_extractor;
-                addr_of_valobj_sp->GetData(valobj_extractor);
-                lldb::offset_t offset = 0;
-                lldb::addr_t addr_of_valobj_addr = valobj_extractor.GetAddress(&offset);
-                
                 Error write_error;
-                map.WritePointerToMemory(load_addr, addr_of_valobj_addr, write_error);
+                map.WritePointerToMemory(load_addr, addr_of_valobj, write_error);
                 
                 if (!write_error.Success())
                 {





More information about the lldb-commits mailing list