diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-28 02:18:39 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-28 02:18:39 +0000 |
commit | 9c41f6a6804548bc0c0a00968459a452bb2a0ff4 (patch) | |
tree | 0851feda3649c9e9197e78eb66fabbcbf4e7b6b5 /gdb/remote-utils.c | |
parent | 81f6013aa2448ca035e72d1b6343c87ffd488f0f (diff) | |
download | gdb-9c41f6a6804548bc0c0a00968459a452bb2a0ff4.zip gdb-9c41f6a6804548bc0c0a00968459a452bb2a0ff4.tar.gz gdb-9c41f6a6804548bc0c0a00968459a452bb2a0ff4.tar.bz2 |
* main.c (baud_rate): Add FIXME comment about printing -1 value.
* remote-utils.c (usage): Fix message to be accurate and conform
more closely to normal conventions.
* remote-utils.c (gr_files_info): Have the exec_bfd test control
whether to show information about exec_bfd, and not control whether
to show information about device and speed.
* remote-utils.c (gr_open): If sr_get_device returns NULL, give
usage message, don't dump core.
* remote-bug.c (bug_write_memory): Use alloca, not GCC extension
for variable size array.
(bug_fetch_register, bug_store_register): Rename "value" to
"fpreg_buf" because some compilers don't like variables whose
names are the same as types.
(bug_store_register): Use a cast when converting char * to
unsigned char *.
Diffstat (limited to 'gdb/remote-utils.c')
-rw-r--r-- | gdb/remote-utils.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/gdb/remote-utils.c b/gdb/remote-utils.c index 75137e4..21acc2c 100644 --- a/gdb/remote-utils.c +++ b/gdb/remote-utils.c @@ -76,10 +76,8 @@ usage(proto, junk) if (junk != NULL) fprintf_unfiltered(gdb_stderr, "Unrecognized arguments: `%s'.\n", junk); - /* FIXME-now: service@host? */ - - error("Usage: target %s <device <speed <debug>>>\n\ -or target %s <host> <port>\n", proto, proto); + error ("Usage: target %s [DEVICE [SPEED [DEBUG]]]\n\ +where DEVICE is the name of a device or HOST:PORT", proto, proto); return; } @@ -167,6 +165,13 @@ gr_open(args, from_tty, gr) if (sr_get_desc() != NULL) gr_close (0); + /* If no args are specified, then we use the device specified by a + previous command or "set remotedevice". But if there is no + device, better stop now, not dump core. */ + + if (sr_get_device () == NULL) + usage (gr->ops->to_shortname, NULL); + sr_set_desc(SERIAL_OPEN (sr_get_device())); if (!sr_get_desc()) perror_with_name((char *) sr_get_device()); @@ -430,22 +435,18 @@ void gr_files_info (ops) struct target_ops *ops; { - char *file = "nothing"; - - if (exec_bfd) - file = bfd_get_filename (exec_bfd); - - if (exec_bfd) - { #ifdef __GO32__ - printf_filtered ("\tAttached to DOS asynctsr\n"); + printf_filtered ("\tAttached to DOS asynctsr\n"); #else - printf_filtered ("\tAttached to %s at %d baud\n", - sr_get_device(), sr_get_baud_rate()); + printf_filtered ("\tAttached to %s at %d baud\n", + sr_get_device(), sr_get_baud_rate()); #endif - } - printf_filtered ("\tand running program %s\n", file); + if (exec_bfd) + { + printf_filtered ("\tand running program %s\n", + bfd_get_filename (exec_bfd)); + } printf_filtered ("\tusing the %s protocol.\n", ops->to_shortname); } |