aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMarko Mlinar <markom@opencores.org>2002-10-09 11:59:54 +0000
committerMarko Mlinar <markom@opencores.org>2002-10-09 11:59:54 +0000
commitf74fa174bfe402c8883c1a6198d8ef8920698594 (patch)
tree15b514df1d6f8f94205ed689c1055a87ae6a6c9d /gdb
parent57349743d5a73b60ce32e5aa38ad3ebc0b361e8a (diff)
downloadgdb-f74fa174bfe402c8883c1a6198d8ef8920698594.zip
gdb-f74fa174bfe402c8883c1a6198d8ef8920698594.tar.gz
gdb-f74fa174bfe402c8883c1a6198d8ef8920698594.tar.bz2
Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/gdbarch.c27
-rw-r--r--gdb/gdbarch.h16
-rwxr-xr-xgdb/gdbarch.sh1
4 files changed, 50 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dc2a6a4..e77698f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-09 Marko Mlinar <markom@opencores.org>
+
+ * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C.
+ * gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
2002-10-08 Petr Sorfa <petrs@caldera.com>
Revised and re-submitted by John Wolfe <jlw@caldera.com>
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index c0c4f9f..bca1043 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -270,6 +270,7 @@ struct gdbarch
gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
const char * name_of_malloc;
int cannot_step_breakpoint;
+ int have_nonsteppable_watchpoint;
};
@@ -807,6 +808,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* 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 */
+ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -1383,6 +1385,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->get_saved_register
/*GET_SAVED_REGISTER ()*/);
#endif
+#ifdef HAVE_STEPPABLE_WATCHPOINT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: HAVE_STEPPABLE_WATCHPOINT # %s\n",
+ XSTRING (HAVE_STEPPABLE_WATCHPOINT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: HAVE_STEPPABLE_WATCHPOINT = %d\n",
+ HAVE_STEPPABLE_WATCHPOINT);
+#endif
#ifdef INIT_EXTRA_FRAME_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -5052,6 +5062,23 @@ set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
}
+int
+gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
+ return gdbarch->have_nonsteppable_watchpoint;
+}
+
+void
+set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
+ int have_nonsteppable_watchpoint)
+{
+ gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index b14d3c1..c204cf0 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -2595,6 +2595,22 @@ extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int can
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
+#endif
+
+extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
+#endif
+#endif
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 79c7fe5..c18639e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -663,6 +663,7 @@ f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct
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
+v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
EOF
}