summaryrefslogtreecommitdiff
path: root/gdb/monitor.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-02-19 19:41:21 +0000
committerPedro Alves <palves@redhat.com>2013-02-19 19:41:21 +0000
commit4df4eb13c0177a1587ce86a8a87219c828809a92 (patch)
tree12a334161bf005b1c2d53b80ea09007861f89d18 /gdb/monitor.c
parent9b12f766243a75cb840330fa941715b38aa609e4 (diff)
downloadgdb-4df4eb13c0177a1587ce86a8a87219c828809a92.tar.gz
Garbage collect struct monitor_ops::load_routine.
While touching monitor_load in a previous patch, I noticed this method is no longer set to anything other than NULL in the tree, so we can remove it. Tested by building with --enable-targets=all. 2013-02-19 Pedro Alves <palves@redhat.com> Garbage collect 'struct monitor_ops'::load_routine. * monitor.h (struct monitor_ops) <load_routine>: Remove field. * monitor.c (monitor_load): No longer call current_monitor->load_routine. * dbug-rom.c (init_dbug_cmds): Don't set 'load_routine'. * m32r-rom.c (init_m32r_cmds): Don't set 'load_routine'. * ppcbug-rom.c (init_ppc_cmds): Don't set 'load_routine'.
Diffstat (limited to 'gdb/monitor.c')
-rw-r--r--gdb/monitor.c69
1 files changed, 32 insertions, 37 deletions
diff --git a/gdb/monitor.c b/gdb/monitor.c
index f4ec12ca2d9..e6a97669b03 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2178,55 +2178,50 @@ monitor_wait_srec_ack (void)
static void
monitor_load (char *args, int from_tty)
{
- monitor_debug ("MON load\n");
+ CORE_ADDR load_offset = 0;
+ char **argv;
+ struct cleanup *old_cleanups;
+ char *filename;
- if (current_monitor->load_routine)
- current_monitor->load_routine (monitor_desc, args, hashmark);
- else
- { /* The default is ascii S-records. */
- CORE_ADDR load_offset = 0;
- char **argv;
- struct cleanup *old_cleanups;
- char *filename;
+ monitor_debug ("MON load\n");
- if (args == NULL)
- error_no_arg (_("file to load"));
+ if (args == NULL)
+ error_no_arg (_("file to load"));
- argv = gdb_buildargv (args);
- old_cleanups = make_cleanup_freeargv (argv);
+ argv = gdb_buildargv (args);
+ old_cleanups = make_cleanup_freeargv (argv);
- filename = tilde_expand (argv[0]);
- make_cleanup (xfree, filename);
+ filename = tilde_expand (argv[0]);
+ make_cleanup (xfree, filename);
- /* Enable user to specify address for downloading as 2nd arg to load. */
- if (argv[1] != NULL)
- {
- const char *endptr;
+ /* Enable user to specify address for downloading as 2nd arg to load. */
+ if (argv[1] != NULL)
+ {
+ const char *endptr;
- load_offset = strtoulst (argv[1], &endptr, 0);
+ load_offset = strtoulst (argv[1], &endptr, 0);
- /* If the last word was not a valid number then
- treat it as a file name with spaces in. */
- if (argv[1] == endptr)
- error (_("Invalid download offset:%s."), argv[1]);
+ /* If the last word was not a valid number then
+ treat it as a file name with spaces in. */
+ if (argv[1] == endptr)
+ error (_("Invalid download offset:%s."), argv[1]);
- if (argv[2] != NULL)
- error (_("Too many parameters."));
- }
+ if (argv[2] != NULL)
+ error (_("Too many parameters."));
+ }
- monitor_printf (current_monitor->load);
- if (current_monitor->loadresp)
- monitor_expect (current_monitor->loadresp, NULL, 0);
+ monitor_printf (current_monitor->load);
+ if (current_monitor->loadresp)
+ monitor_expect (current_monitor->loadresp, NULL, 0);
- load_srec (monitor_desc, filename, load_offset,
- 32, SREC_ALL, hashmark,
- current_monitor->flags & MO_SREC_ACK ?
- monitor_wait_srec_ack : NULL);
+ load_srec (monitor_desc, filename, load_offset,
+ 32, SREC_ALL, hashmark,
+ current_monitor->flags & MO_SREC_ACK ?
+ monitor_wait_srec_ack : NULL);
- monitor_expect_prompt (NULL, 0);
+ monitor_expect_prompt (NULL, 0);
- do_cleanups (old_cleanups);
- }
+ do_cleanups (old_cleanups);
/* Finally, make the PC point at the start address. */
if (exec_bfd)