[Lldb-commits] [lldb] r335341 - ResolveAddress: check returned value of resolving functions.

Tatyana Krasnukha via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 22 05:24:58 PDT 2018


Author: tkrasnukha
Date: Fri Jun 22 05:24:57 2018
New Revision: 335341

URL: http://llvm.org/viewvc/llvm-project?rev=335341&view=rev
Log:
ResolveAddress: check returned value of resolving functions.

Modified:
    lldb/trunk/source/Core/Disassembler.cpp

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=335341&r1=335340&r2=335341&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Fri Jun 22 05:24:57 2018
@@ -112,14 +112,15 @@ static void ResolveAddress(const Executi
     // it to something
     Target *target = exe_ctx.GetTargetPtr();
     if (target) {
-      if (target->GetSectionLoadList().IsEmpty()) {
-        target->GetImages().ResolveFileAddress(addr.GetOffset(), resolved_addr);
-      } else {
-        target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
-                                                        resolved_addr);
-      }
+      bool is_resolved =
+          target->GetSectionLoadList().IsEmpty() ?
+              target->GetImages().ResolveFileAddress(addr.GetOffset(),
+                                                     resolved_addr) :
+              target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
+                                                              resolved_addr);
+
       // We weren't able to resolve the address, just treat it as a raw address
-      if (resolved_addr.IsValid())
+      if (is_resolved && resolved_addr.IsValid())
         return;
     }
   }




More information about the lldb-commits mailing list