aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorAleksandar Ristovski <aristovski@qnx.com>2008-09-03 13:39:56 +0000
committerAleksandar Ristovski <aristovski@qnx.com>2008-09-03 13:39:56 +0000
commit514f746bdc40681c8a32ef8077adeae4f2098db2 (patch)
tree55d90a7ec4954e25b8bf969c68f6a63841f2820a /gdb/i386-tdep.c
parentee60f13c8b7d9ed38d7d5d63f8889277848ff675 (diff)
downloadgdb-514f746bdc40681c8a32ef8077adeae4f2098db2.zip
gdb-514f746bdc40681c8a32ef8077adeae4f2098db2.tar.gz
gdb-514f746bdc40681c8a32ef8077adeae4f2098db2.tar.bz2
* breakpoint.c (breakpoint_init_inferior): Mark as not inserted only
non-permanent breakpoints. (bpstat_stop_status): Change enable_state to bp_disabled only for non-permanent breakpoints. (bp_loc_is_permanent): New function. (create_breakpoint): Check if the location points to a permanent breakpoint and if it does, make breakpoint permanent. (update_breakpoint_locations): Make sure new locations of permanent breakpoints are properly initialized. * i386-tdep.c (i386_skip_permanent_breakpoint): New function. (i386_gdbarch_init): Set gdbarch_skip_permanent_breakpoint. * gdb.arch/i386-bp_permanent.exp: New test.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 3e215fc..40cbde5 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2624,6 +2624,18 @@ i386_fetch_pointer_argument (struct frame_info *frame, int argi,
return read_memory_unsigned_integer (sp + (4 * (argi + 1)), 4);
}
+static void
+i386_skip_permanent_breakpoint (struct regcache *regcache)
+{
+ CORE_ADDR current_pc = regcache_read_pc (regcache);
+
+ /* On i386, breakpoint is exactly 1 byte long, so we just
+ adjust the PC in the regcache. */
+ current_pc += 1;
+ regcache_write_pc (regcache, current_pc);
+}
+
+
static struct gdbarch *
i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
@@ -2812,6 +2824,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (tdep->mm0_regnum == 0)
tdep->mm0_regnum = gdbarch_num_regs (gdbarch);
+ set_gdbarch_skip_permanent_breakpoint (gdbarch,
+ i386_skip_permanent_breakpoint);
+
return gdbarch;
}