aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/gdbarch.c28
-rw-r--r--gdb/gdbarch.h16
-rwxr-xr-xgdb/gdbarch.sh1
-rw-r--r--gdb/infrun.c15
5 files changed, 59 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b2c884f2..b1c3249 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-02 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C.
+ * gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
2002-10-02 Daniel Jacobowitz <drow@mvista.com>
Fix PR gdb/778
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index bc27aae..c0c4f9f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -269,6 +269,7 @@ struct gdbarch
gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
const char * name_of_malloc;
+ int cannot_step_breakpoint;
};
@@ -427,6 +428,7 @@ struct gdbarch startup_gdbarch =
0,
0,
"malloc",
+ 0,
/* startup_gdbarch() */
};
@@ -804,6 +806,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
/* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
/* Skip verify of name_of_malloc, invalid_p == 0 */
+ /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -993,6 +996,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->cannot_fetch_register
/*CANNOT_FETCH_REGISTER ()*/);
#endif
+#ifdef CANNOT_STEP_BREAKPOINT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
+ XSTRING (CANNOT_STEP_BREAKPOINT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
+ CANNOT_STEP_BREAKPOINT);
+#endif
#ifdef CANNOT_STORE_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -5024,6 +5035,23 @@ set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
gdbarch->name_of_malloc = name_of_malloc;
}
+int
+gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
+ return gdbarch->cannot_step_breakpoint;
+}
+
+void
+set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
+ int cannot_step_breakpoint)
+{
+ gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 2f26cba..b14d3c1 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -2579,6 +2579,22 @@ extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * na
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
+#define CANNOT_STEP_BREAKPOINT (0)
+#endif
+
+extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
+#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT)
+#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
+#endif
+#endif
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 0ee74df..79c7fe5 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -662,6 +662,7 @@ F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile
f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0
+v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
EOF
}
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0f0c96b..89a1d23 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -870,13 +870,14 @@ resume (int step, enum target_signal sig)
resume_ptid = inferior_ptid;
}
-#ifdef CANNOT_STEP_BREAKPOINT
- /* Most targets can step a breakpoint instruction, thus executing it
- normally. But if this one cannot, just continue and we will hit
- it anyway. */
- if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
- step = 0;
-#endif
+ if (CANNOT_STEP_BREAKPOINT)
+ {
+ /* Most targets can step a breakpoint instruction, thus
+ executing it normally. But if this one cannot, just
+ continue and we will hit it anyway. */
+ if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
+ step = 0;
+ }
target_resume (resume_ptid, step, sig);
}