summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2017-08-07 17:02:04 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2017-08-07 17:02:04 +0100
commitba7b109b296feac8cf8cab74db5f824dfa631610 (patch)
tree50468ccc26db264428129deb47848ffa5ae877a4 /gdb
parentMark big and mach with ATTRIBUTE_UNUSED (diff)
downloadbinutils-gdb-ba7b109b296feac8cf8cab74db5f824dfa631610.tar.gz
binutils-gdb-ba7b109b296feac8cf8cab74db5f824dfa631610.tar.bz2
binutils-gdb-ba7b109b296feac8cf8cab74db5f824dfa631610.zip
PR breakpoints/21886: mem-break: Fix breakpoint insertion location
Fix a commit cd6c3b4ffc4e ("New gdbarch methods breakpoint_kind_from_pc and sw_breakpoint_from_kind") regression and restore the use of `->placed_address' rather than `->reqstd_address' as the location for a memory breakpoint to be inserted at. Previously `gdbarch_breakpoint_from_pc' was used that made that adjustment in `default_memory_insert_breakpoint' from the preinitialized value, however with the said commit that call is gone, so the passed `->placed_address' has to be used for the initialization. The regression manifests itself as the inability to debug any MIPS/Linux compressed ISA dynamic executable as GDB corrupts the dynamic loader with one of its implicit breakpoints, causing the program to crash, as seen for example with the `mips-linux-gnu' target, o32 ABI, MIPS16 code, and the gdb.base/advance.exp test case: (gdb) continue Continuing. Program received signal SIGBUS, Bus error. _dl_debug_initialize (ldbase=0, ns=0) at dl-debug.c:51 51 r = &_r_debug; (gdb) FAIL: gdb.base/advance.exp: Can't run to main gdb/ PR breakpoints/21886 * mem-break.c (default_memory_insert_breakpoint): Use `->placed_address' rather than `->reqstd_address' for the breakpoint location.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/mem-break.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d550938ae9c..e15e9f2eea6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2017-08-07 Maciej W. Rozycki <macro@imgtec.com>
+ PR breakpoints/21886
+ * mem-break.c (default_memory_insert_breakpoint): Use
+ `->placed_address' rather than `->reqstd_address' for the
+ breakpoint location.
+
+2017-08-07 Maciej W. Rozycki <macro@imgtec.com>
+
* arch-utils.c (default_print_insn): Remove arch/mach/endian
assertions.
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index f87eea46830..e35d0a50716 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -37,7 +37,7 @@ int
default_memory_insert_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
- CORE_ADDR addr = bp_tgt->reqstd_address;
+ CORE_ADDR addr = bp_tgt->placed_address;
const unsigned char *bp;
gdb_byte *readbuf;
int bplen;