[Lldb-commits] [PATCH] LLDB ARM Register context support

Tamas Berghammer tberghammer at google.com
Tue Mar 31 08:49:57 PDT 2015


PosixThread and ProcessPosix don't used on Linux but it is used on FreeBSD. There is no problem with adding arm handling to there but don't expect any effect from it on Linux.


================
Comment at: Plugins/Process/POSIX/ProcessPOSIX.cpp:678-700
@@ -674,1 +677,25 @@
+            // but the linux kernel does otherwise.
+            static const uint8_t g_arm_breakpoint_opcode[] = { 0xf0, 0x01, 0xf0, 0xe7 };
+            static const uint8_t g_thumb_breakpoint_opcode[] = { 0x01, 0xde };
+
+            lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0));
+            AddressClass addr_class = eAddressClassUnknown;
+
+            if (bp_loc_sp)
+                addr_class = bp_loc_sp->GetAddress ().GetAddressClass ();
+
+            if (addr_class == eAddressClassCodeAlternateISA
+                || (addr_class == eAddressClassUnknown
+                    && bp_loc_sp->GetAddress().GetOffset() & 1))
+            {
+                opcode = g_thumb_breakpoint_opcode;
+                opcode_size = sizeof(g_thumb_breakpoint_opcode);
+            }
+            else
+            {
+                opcode = g_arm_breakpoint_opcode;
+                opcode_size = sizeof(g_arm_breakpoint_opcode);
+            }
+        }
+        break;
     case llvm::Triple::aarch64:
----------------
emaste wrote:
> ProcessPOSIX.cpp is used by Linux and FreeBSD so if Linux implements non-standard behaviour this will need to be changed
AFAIK this class is not used on Linux because of the "remote debugging approach" for local debugging also. Linux uses the code in PlatformLinux and in NativeProcessLinux (unfortunately both) so please add the trap opcode there.

================
Comment at: Plugins/Process/Utility/RegisterInfos_arm.h:178-181
@@ +177,6 @@
+//  ======      ======= ==  =============       =============   ============    ===============         ===============     =========================   =====================   ============= ==========    ===============
+{   "r0",       NULL,   4,  GPR_OFFSET(0),      eEncodingUint,  eFormatHex,     { gcc_r0,               dwarf_r0,           LLDB_INVALID_REGNUM,        gdb_arm_r0,             gpr_r0      },      NULL,              NULL},
+{   "r1",       NULL,   4,  GPR_OFFSET(1),      eEncodingUint,  eFormatHex,     { gcc_r1,               dwarf_r1,           LLDB_INVALID_REGNUM,        gdb_arm_r1,             gpr_r1      },      NULL,              NULL},
+{   "r2",       NULL,   4,  GPR_OFFSET(2),      eEncodingUint,  eFormatHex,     { gcc_r2,               dwarf_r2,           LLDB_INVALID_REGNUM,        gdb_arm_r2,             gpr_r2      },      NULL,              NULL},
+{   "r3",       NULL,   4,  GPR_OFFSET(3),      eEncodingUint,  eFormatHex,     { gcc_r3,               dwarf_r3,           LLDB_INVALID_REGNUM,        gdb_arm_r3,             gpr_r3      },      NULL,              NULL},
+{   "r4",       NULL,   4,  GPR_OFFSET(4),      eEncodingUint,  eFormatHex,     { gcc_r4,               dwarf_r4,           LLDB_INVALID_REGNUM,        gdb_arm_r4,             gpr_r4      },      NULL,              NULL},
----------------
Please mark them with LLDB_REGNUM_GENERIC_ARG[1-4] (required for expression evaluation)

http://reviews.llvm.org/D8719

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list