[Lldb-commits] [PATCH] D17860: Fix "ninja check-lldb" crash in IRExecutionUnit.cpp

Ted Woodward via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 9 13:01:01 PST 2016


ted updated this revision to Diff 50189.
ted added a comment.

Updated to address Jim's comments.


http://reviews.llvm.org/D17860

Files:
  source/Expression/IRExecutionUnit.cpp

Index: source/Expression/IRExecutionUnit.cpp
===================================================================
--- source/Expression/IRExecutionUnit.cpp
+++ source/Expression/IRExecutionUnit.cpp
@@ -798,15 +798,25 @@
 
                 const bool is_external = (candidate_sc.function) ||
                                          (candidate_sc.symbol && candidate_sc.symbol->IsExternal());
+                if (candidate_sc.symbol)
+                {
+                    load_address = candidate_sc.symbol->ResolveCallableAddress(*target);
 
-                load_address = candidate_sc.symbol->ResolveCallableAddress(*target);
+                    if (load_address == LLDB_INVALID_ADDRESS)
+                    {
+                        if (target->GetProcessSP())
+                            load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target);
+                        else
+                            load_address = candidate_sc.symbol->GetAddress().GetFileAddress();
+                    }
+                }
 
-                if (load_address == LLDB_INVALID_ADDRESS)
+                if (load_address == LLDB_INVALID_ADDRESS && candidate_sc.function)
                 {
-                    if (target->GetProcessSP())
-                        load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target);
-                    else
-                        load_address = candidate_sc.symbol->GetAddress().GetFileAddress();
+                        if (target->GetProcessSP())
+                            load_address = candidate_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(target);
+                        else
+                            load_address = candidate_sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
                 }
 
                 if (load_address != LLDB_INVALID_ADDRESS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17860.50189.patch
Type: text/x-patch
Size: 1878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160309/30009dcd/attachment.bin>


More information about the lldb-commits mailing list