This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/16263] New: breakpoints on BL instruction in Thumb broken


https://sourceware.org/bugzilla/show_bug.cgi?id=16263

            Bug ID: 16263
           Summary: breakpoints on BL instruction in Thumb broken
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: js at sig21 dot net

For the ARM target, commit 177321bd85d5a3d4ca05d320696d8af43bc0fc05
(Daniel Jacobowitz, Mon Feb 1 16:13:17 2010), which added Thumb2
breakpoint support, broke breakpoints set on the BL instruction in
Thumb mode (and thus single stepping through Thumb code). 
arm_breakpoint_from_pc() inserts tdep->thumb2_breakpoint
instead of tdep->thumb_breakpoint because the length of the BL
instruction is 32bit (two 16bit instructions).

The code has this:
+      /* If we have a separate 32-bit breakpoint instruction for Thumb-2,
+        check whether we are replacing a 32-bit instruction.  */
+      if (tdep->thumb2_breakpoint != NULL)

but tdep->thumb2_breakpoint is set unconditionally in arm_linux_init_abi().
I confirmed that commenting out
//      tdep->thumb2_breakpoint = arm_linux_thumb2_le_breakpoint;
works around the issue.
It seems the assignment should be made
depending on whether the target actually has Thumb2 support.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]