[Lldb-commits] [lldb] r249013 - Fix breakpoint opcode calculation on Linux

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 1 06:57:58 PDT 2015


Author: tberghammer
Date: Thu Oct  1 08:57:57 2015
New Revision: 249013

URL: http://llvm.org/viewvc/llvm-project?rev=249013&view=rev
Log:
Fix breakpoint opcode calculation on Linux

Change the way we detect if we have to place a thumb breakpoint instead
of an arm breakpoint in the case when no symbol table or mapping symbols
are available. Detect it based on the LSB of the FileAddress instead of
the LSB of the LoadAddress because the LSB of the LoadAddress is already
masked out.

Modified:
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=249013&r1=249012&r2=249013&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Thu Oct  1 08:57:57 2015
@@ -575,10 +575,17 @@ PlatformLinux::GetSoftwareBreakpointTrap
             AddressClass addr_class = eAddressClassUnknown;
 
             if (bp_loc_sp)
+            {
                 addr_class = bp_loc_sp->GetAddress ().GetAddressClass ();
 
-            if (addr_class == eAddressClassCodeAlternateISA
-                || (addr_class == eAddressClassUnknown && (bp_site->GetLoadAddress() & 1)))
+                if (addr_class == eAddressClassUnknown &&
+                    (bp_loc_sp->GetAddress ().GetFileAddress () & 1))
+                {
+                    addr_class = eAddressClassCodeAlternateISA;
+                }
+            }
+
+            if (addr_class == eAddressClassCodeAlternateISA)
             {
                 trap_opcode = g_thumb_breakpoint_opcode;
                 trap_opcode_size = sizeof(g_thumb_breakpoint_opcode);




More information about the lldb-commits mailing list