aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1997-09-25 01:26:36 +0000
committerStu Grossman <grossman@cygnus>1997-09-25 01:26:36 +0000
commit45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa (patch)
treee34e5accd538bab88c44b9091ba8f6e8998d96cc /gdb/remote-sim.c
parent4d5d36f015212384d5540c5d65ae9e220ad226cc (diff)
downloadfsf-binutils-gdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.zip
fsf-binutils-gdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.tar.gz
fsf-binutils-gdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.tar.bz2
* The following block of changes add support for debugging assembly
source files. * breakpoint.c (resolve_sal_pc): Prevent crash when pc isn't associated with a function. * buildsym.c (record_line start_symtab end_symtab): Don't delete symtabs which only have line numbers (but no other debug symbols). * dbxread.c (read_dbx_symtab end_psymtab): Ditto. * remote-sim.c: New functions gdbsim_insert/remove_breakpoint. Use intrinsic simulator breakpoints if available, otherwise do it the hard way. * configure.tgt: Add d30v. * d30v-tdep.c: New file. * config/d30v/d30v.mt, config/d30v/tm-d30v.h: New files.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c53
1 files changed, 51 insertions, 2 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 49e573f..0bdb354 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -810,6 +810,55 @@ gdbsim_mourn_inferior ()
generic_mourn_inferior ();
}
+static int
+gdbsim_insert_breakpoint (addr, contents_cache)
+ CORE_ADDR addr;
+ char *contents_cache;
+{
+#ifdef SIM_HAS_BREAKPOINTS
+ SIM_RC retcode;
+
+ retcode = sim_set_breakpoint (gdbsim_desc, addr);
+
+ switch (retcode)
+ {
+ case SIM_RC_OK:
+ return 0;
+ case SIM_RC_INSUFFICIENT_RESOURCES:
+ return ENOMEM;
+ default:
+ return EIO;
+ }
+#else
+ return memory_insert_breakpoint (addr, contents_cache);
+#endif
+}
+
+static int
+gdbsim_remove_breakpoint (addr, contents_cache)
+ CORE_ADDR addr;
+ char *contents_cache;
+{
+#ifdef SIM_HAS_BREAKPOINTS
+ SIM_RC retcode;
+
+ retcode = sim_clear_breakpoint (gdbsim_desc, addr);
+
+ switch (retcode)
+ {
+ case SIM_RC_OK:
+ case SIM_RC_UNKNOWN_BREAKPOINT:
+ return 0;
+ case SIM_RC_INSUFFICIENT_RESOURCES:
+ return ENOMEM;
+ default:
+ return EIO;
+ }
+#else
+ return memory_remove_breakpoint (addr, contents_cache);
+#endif
+}
+
/* Pass the command argument through to the simulator verbatim. The
simulator must do any command interpretation work. */
@@ -854,8 +903,8 @@ struct target_ops gdbsim_ops = {
gdbsim_prepare_to_store, /* to_prepare_to_store */
gdbsim_xfer_inferior_memory, /* to_xfer_memory */
gdbsim_files_info, /* to_files_info */
- memory_insert_breakpoint, /* to_insert_breakpoint */
- memory_remove_breakpoint, /* to_remove_breakpoint */
+ gdbsim_insert_breakpoint, /* to_insert_breakpoint */
+ gdbsim_remove_breakpoint, /* to_remove_breakpoint */
NULL, /* to_terminal_init */
NULL, /* to_terminal_inferior */
NULL, /* to_terminal_ours_for_output */