From 160db9b2959e9b01ef38cca2a1f211c5ae3c1224 Mon Sep 17 00:00:00 2001 From: Geoffrey Noer Date: Mon, 11 Aug 1997 00:01:59 +0000 Subject: Sun Aug 10 16:49:09 1997 Geoffrey Noer * ocd.c: move ocd_write_bytes proto to ocd.h since it is used by ppc-bdm.c, use OCD_LOG_FILE to help debugging, define BDM_BREAKPOINT if not defined in tm.h (ocd_error): add new error cases (ocd_start_remote): send the OCD_INIT command before OCD_AYT and OCD_GET_VERSION calls (ocd_write_bytes): no longer static (ocd_insert_breakpoint): no longer static (ocd_remove_breakpoint): new * ocd.h: add protos for ocd_write_bytes, ocd_insert_breakpoint, and ocd_remove_breakpoint * ppc-bdm.c: change bdm_ppc_ops so we call ocd_insert_breakpoint and ocd_remove_breakpoint instead of memory_insert_breakpoint and memory_remove_breakpoint. (bdm_ppc_open): after calling ocd_open, modify DER register so interrupts will drop us into debugging mode, finally disable the watchdog timer on the board so we don't leave BDM mode unexpectedly. --- gdb/ppc-bdm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'gdb/ppc-bdm.c') diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c index 38878d0..dcc2690 100644 --- a/gdb/ppc-bdm.c +++ b/gdb/ppc-bdm.c @@ -50,12 +50,23 @@ extern struct target_ops bdm_ppc_ops; /* Forward decl */ /* Open a connection to a remote debugger. NAME is the filename used for communication. */ +char nowatchdog[4] = {0xff,0xff,0xff,0x88}; + static void bdm_ppc_open (name, from_tty) char *name; int from_tty; { + CORE_ADDR watchdogaddr = 0xff000004; + ocd_open (name, from_tty, OCD_TARGET_MOTO_PPC, &bdm_ppc_ops); + + /* We want interrupts to drop us into debugging mode. */ + /* Modify the DER register to accomplish this. */ + ocd_write_bdm_register (149, 0x20024000); + + /* Disable watchdog timer on the board */ + ocd_write_bytes (watchdogaddr, nowatchdog, 4); } /* Wait until the remote machine stops, then return, @@ -225,8 +236,8 @@ struct target_ops bdm_ppc_ops = { ocd_prepare_to_store, /* to_prepare_to_store */ ocd_xfer_memory, /* to_xfer_memory */ ocd_files_info, /* to_files_info */ - memory_insert_breakpoint, /* to_insert_breakpoint */ - memory_remove_breakpoint, /* to_remove_breakpoint */ + ocd_insert_breakpoint, /* to_insert_breakpoint */ + ocd_remove_breakpoint, /* to_remove_breakpoint */ NULL, /* to_terminal_init */ NULL, /* to_terminal_inferior */ NULL, /* to_terminal_ours_for_output */ -- cgit v1.1