From f17aed8ba33ad1b7ae7b3ffd8a87f86f81cef494 Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Wed, 8 Mar 1995 01:18:08 +0000 Subject: [PATCH] * monitor.c (monitor_load): Set PC to start address when done loading. * array-rom.c monitor.h rom68k-rom.c: Clean up target_ops. Remove ref to monitor_create_inferior. --- gdb/ChangeLog | 6 ++++ gdb/array-rom.c | 78 +++++++++++++++++++++++------------------------- gdb/monitor.c | 4 +++ gdb/monitor.h | 3 +- gdb/rom68k-rom.c | 77 +++++++++++++++++++++++------------------------ 5 files changed, 87 insertions(+), 81 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d076f0b188..d382ccfab0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ Tue Mar 7 00:23:47 1995 Stu Grossman (grossman@cygnus.com) + * monitor.c (monitor_load): Set PC to start address when done + loading. + + * array-rom.c monitor.h rom68k-rom.c: Clean up target_ops. + Remove ref to monitor_create_inferior. + * monitor.c: More general cleanups. Add prototypes, remove unused routines. Fix bug with wrong number of args to error(). diff --git a/gdb/array-rom.c b/gdb/array-rom.c index adc0cc04dd..02f3d2e1d9 100644 --- a/gdb/array-rom.c +++ b/gdb/array-rom.c @@ -44,49 +44,47 @@ extern int mips_set_processor_type(); * strings. We also need a CR or LF on the end. */ -static struct target_ops array_ops = -{ - "array", +static struct target_ops array_ops = { + "array", /* to_shortname */ "Debug using the standard GDB remote protocol for the Array Tech target.", "Debug using the standard GDB remote protocol for the Array Tech target.\n\ Specify the serial device it is connected to (e.g. /dev/ttya).", - array_open, - monitor_close, - NULL, - monitor_detach, - monitor_resume, - monitor_wait, - monitor_fetch_registers, - monitor_store_registers, - monitor_prepare_to_store, - monitor_xfer_inferior_memory, - monitor_files_info, - monitor_insert_breakpoint, - monitor_remove_breakpoint, /* Breakpoints */ - 0, - 0, - 0, - 0, - 0, /* Terminal handling */ - monitor_kill, - monitor_load, /* load */ - 0, /* lookup_symbol */ - monitor_create_inferior, - monitor_mourn_inferior, - - 0, /* can_run */ - 0, /* notice_signals */ - 0, /* to_stop */ - process_stratum, - 0, /* next */ - 1, - 1, - 1, - 1, - 1, /* all mem, mem, stack, regs, exec */ - 0, - 0, /* Section pointers */ - OPS_MAGIC, /* Always the last thing */ + array_open, /* to_open */ + monitor_close, /* to_close */ + NULL, /* to_attach */ + monitor_detach, /* to_detach */ + monitor_resume, /* to_resume */ + monitor_wait, /* to_wait */ + monitor_fetch_registers, /* to_fetch_registers */ + monitor_store_registers, /* to_store_registers */ + monitor_prepare_to_store, /* to_prepare_to_store */ + monitor_xfer_memory, /* to_xfer_memory */ + monitor_files_info, /* to_files_info */ + monitor_insert_breakpoint, /* to_insert_breakpoint */ + monitor_remove_breakpoint, /* to_remove_breakpoint */ + 0, /* to_terminal_init */ + 0, /* to_terminal_inferior */ + 0, /* to_terminal_ours_for_output */ + 0, /* to_terminal_ours */ + 0, /* to_terminal_info */ + monitor_kill, /* to_kill */ + monitor_load, /* to_load */ + 0, /* to_lookup_symbol */ + NULL, /* to_create_inferior */ + monitor_mourn_inferior, /* to_mourn_inferior */ + 0, /* to_can_run */ + 0, /* to_notice_signals */ + 0, /* to_stop */ + process_stratum, /* to_stratum */ + 0, /* to_next */ + 1, /* to_has_all_memory */ + 1, /* to_has_memory */ + 1, /* to_has_stack */ + 1, /* to_has_registers */ + 1, /* to_has_execution */ + 0, /* sections */ + 0, /* sections_end */ + OPS_MAGIC /* to_magic */ }; static char *array_loadtypes[] = {"none", "srec", "default", NULL}; diff --git a/gdb/monitor.c b/gdb/monitor.c index 42d23dad83..4ac3485594 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -1083,6 +1083,10 @@ monitor_load_srec (args, protocol) putchar_unfiltered ('\n'); expect_prompt (NULL, 0); + +/* Finally, make the PC point at the start address */ + + write_register (PC_REGNUM, bfd_get_start_address (abfd)); } /* Get an ACK or a NAK from the target. returns 1 (true) or 0 (false) diff --git a/gdb/monitor.h b/gdb/monitor.h index 93e104f15e..30dc3a63cc 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -136,8 +136,7 @@ extern int monitor_insert_breakpoint(); extern int monitor_remove_breakpoint(); extern void monitor_kill(); extern void monitor_load(); -extern void monitor_create_inferior(); -extern void monitor_mourn_inferior(); +extern void monitor_mourn_inferior PARAMS ((void)); /* * FIXME: These are to temporarily maintain compatability with the diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index 608f753277..2170b14855 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -44,48 +44,47 @@ static char *rom68k_regnames[NUM_REGS] = { * strings. We also need a CR or LF on the end. */ -static struct target_ops rom68k_ops = -{ - "rom68k", - "Rom68k debug monitor for the IDP Eval board", +static struct target_ops rom68k_ops = { + "rom68k", /* to_shortname */ + "Rom68k debug monitor for the IDP Eval board", /* to_longname */ "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\ Specify the serial device it is connected to (e.g. /dev/ttya).", - rom68k_open, - monitor_close, - NULL, - monitor_detach, - monitor_resume, - monitor_wait, - monitor_fetch_registers, - monitor_store_registers, - monitor_prepare_to_store, - monitor_xfer_memory, - monitor_files_info, - monitor_insert_breakpoint, - monitor_remove_breakpoint, /* Breakpoints */ - 0, - 0, - 0, - 0, - 0, /* Terminal handling */ - monitor_kill, - monitor_load, /* load */ - 0, /* lookup_symbol */ - monitor_create_inferior, - monitor_mourn_inferior, - 0, /* can_run */ - 0, /* notice_signals */ + rom68k_open, /* to_open */ + monitor_close, /* to_close */ + NULL, /* to_attach */ + monitor_detach, /* to_detach */ + monitor_resume, /* to_resume */ + monitor_wait, /* to_wait */ + monitor_fetch_registers, /* to_fetch_registers */ + monitor_store_registers, /* to_store_registers */ + monitor_prepare_to_store, /* to_prepare_to_store */ + monitor_xfer_memory, /* to_xfer_memory */ + monitor_files_info, /* to_files_info */ + monitor_insert_breakpoint, /* to_insert_breakpoint */ + monitor_remove_breakpoint, /* to_remove_breakpoint */ + 0, /* to_terminal_init */ + 0, /* to_terminal_inferior */ + 0, /* to_terminal_ours_for_output */ + 0, /* to_terminal_ours */ + 0, /* to_terminal_info */ + monitor_kill, /* to_kill */ + monitor_load, /* to_load */ + 0, /* to_lookup_symbol */ + NULL, /* to_create_inferior */ + monitor_mourn_inferior, /* to_mourn_inferior */ + 0, /* to_can_run */ + 0, /* to_notice_signals */ 0, /* to_stop */ - process_stratum, - 0, /* next */ - 1, - 1, - 1, - 1, - 1, /* all mem, mem, stack, regs, exec */ - 0, - 0, /* Section pointers */ - OPS_MAGIC /* Always the last thing */ + process_stratum, /* to_stratum */ + 0, /* to_next */ + 1, /* to_has_all_memory */ + 1, /* to_has_memory */ + 1, /* to_has_stack */ + 1, /* to_has_registers */ + 1, /* to_has_execution */ + 0, /* sections */ + 0, /* sections_end */ + OPS_MAGIC /* to_magic */ }; static char *rom68k_loadtypes[] = {"none", "srec", "default", NULL};