aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore A. Roth <troth@openavr.org>2003-05-15 18:10:04 +0000
committerTheodore A. Roth <troth@openavr.org>2003-05-15 18:10:04 +0000
commit909cd28efca6079fe5aaf6d91c94bee541e9104d (patch)
treeca50ea0288ff163c7ddfd49f908e45d9762ce27e
parentb923b08ddfdf22cbf8e4e412510a44f57773ac5b (diff)
downloadgdb-909cd28efca6079fe5aaf6d91c94bee541e9104d.zip
gdb-909cd28efca6079fe5aaf6d91c94bee541e9104d.tar.gz
gdb-909cd28efca6079fe5aaf6d91c94bee541e9104d.tar.bz2
* avr-tdep.c (avr_breakpoint_from_pc): New function.
(avr_gdbarch_init): Set breakpoint_from_pc method.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/avr-tdep.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cbcc0be..739d22d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-15 Theodore A. Roth <troth@openavr.org>
+
+ * avr-tdep.c (avr_breakpoint_from_pc): New function.
+ (avr_gdbarch_init): Set breakpoint_from_pc method.
+
2003-05-15 Andrew Cagney <cagney@redhat.com>
* regcache.c (build_regcache): Set deprecated_register_valid
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index b84e90c..59e2c58 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1091,6 +1091,18 @@ avr_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
+/* Not all avr devices support the BREAK insn. Those that don't should treat
+ it as a NOP. Thus, it should be ok. Since the avr is currently a remote
+ only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
+
+const unsigned char *
+avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+{
+ static unsigned char avr_break_insn [] = { 0x98, 0x95 };
+ *lenptr = sizeof (avr_break_insn);
+ return avr_break_insn;
+}
+
/* Initialize the gdbarch structure for the AVR's. */
static struct gdbarch *
@@ -1189,6 +1201,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_remote_translate_xfer_address (gdbarch,