dean created this revision.
dean added reviewers: jingham, spyffe.
dean added a subscriber: lldb-commits.

This change avoids to check whether the handle returned for an allocation of 
memory in IRForTarget::CompleteDataAllocation is zero, which is apparently a 
valid handle. The method IRForTarget::StaticDataAllocator::Allocate() returns 
LLDB_INVALID_ADDRESS in case of error, whereas, when the policy is 
eAllocationPolicyHostOnly, the first allocation performed by 
IRMemoryMap::Malloc and FindSpace is the value 0 for the first allocation. 

This fix should restore the fall-back mode to evaluate expressions through 
local interpretation when an allocation by IRForTarget::CompleteDataAllocation 
is performed.

http://reviews.llvm.org/D11270

Files:
  source/Expression/IRForTarget.cpp

Index: source/Expression/IRForTarget.cpp
===================================================================
--- source/Expression/IRForTarget.cpp
+++ source/Expression/IRForTarget.cpp
@@ -2478,13 +2478,13 @@

     if (log)
     {
-        if (allocation)
+        if (allocation != LLDB_INVALID_ADDRESS)
             log->Printf("Allocated static data at 0x%llx", (unsigned long 
long)allocation);
         else
             log->Printf("Failed to allocate static data");
     }

-    if (!allocation || allocation == LLDB_INVALID_ADDRESS)
+    if (allocation == LLDB_INVALID_ADDRESS)
         return false;

     Constant *relocated_addr = ConstantInt::get(m_intptr_ty, 
(uint64_t)allocation);


Index: source/Expression/IRForTarget.cpp
===================================================================
--- source/Expression/IRForTarget.cpp
+++ source/Expression/IRForTarget.cpp
@@ -2478,13 +2478,13 @@

     if (log)
     {
-        if (allocation)
+        if (allocation != LLDB_INVALID_ADDRESS)
             log->Printf("Allocated static data at 0x%llx", (unsigned long long)allocation);
         else
             log->Printf("Failed to allocate static data");
     }

-    if (!allocation || allocation == LLDB_INVALID_ADDRESS)
+    if (allocation == LLDB_INVALID_ADDRESS)
         return false;

     Constant *relocated_addr = ConstantInt::get(m_intptr_ty, (uint64_t)allocation);
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to