[commit] [avr] Add breakpoint-from-pc gdbarch method.
Theodore A. Roth
troth@openavr.org
Thu May 15 18:16:00 GMT 2003
I have committed the attached patch which adds a breakpoint-from-pc
method for the avr.
Ted Roth
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.
-------------- next part --------------
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.
Index: avr-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/avr-tdep.c,v
retrieving revision 1.47
diff -u -r1.47 avr-tdep.c
--- avr-tdep.c 14 May 2003 20:09:14 -0000 1.47
+++ avr-tdep.c 15 May 2003 18:04:43 -0000
@@ -1091,6 +1091,18 @@
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 @@
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,
More information about the Gdb-patches
mailing list