[Lldb-commits] [PATCH] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

Bhushan Attarde via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 11 01:21:20 PST 2016


bhushan created this revision.
bhushan added a reviewer: clayborg.
bhushan added subscribers: lldb-commits, nitesh.jain, mohit.bhakkad, sagar, jaydeep.
bhushan set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D16049

Files:
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===================================================================
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2442,18 +2442,18 @@
             SymbolContext sc;
             uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
             temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc);
+            Address sym_addr;
             if (sc.function)
-            {
-                function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
-                if (function_start == LLDB_INVALID_ADDRESS)
-                    function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
-            }
+                sym_addr = sc.function->GetAddressRange().GetBaseAddress();
             else if (sc.symbol)
-            {
-                Address sym_addr = sc.symbol->GetAddress();
+                sym_addr = sc.symbol->GetAddress();
+
+            function_start = sym_addr.GetLoadAddress(this);
+            if (function_start == LLDB_INVALID_ADDRESS)
                 function_start = sym_addr.GetFileAddress();
-            }
-            current_offset = addr - function_start;
+
+            if (function_start)
+                current_offset = addr - function_start;
         }
 
         // If breakpoint address is start of function then we dont have to do anything.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16049.44438.patch
Type: text/x-patch
Size: 1440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160111/cc8ae8cb/attachment.bin>


More information about the lldb-commits mailing list