summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-02-19 02:09:18 +0000
committeradrian <adrian@FreeBSD.org>2013-02-19 02:09:18 +0000
commit7c5c2ceb800933c363adda6c307b08b701bd3c54 (patch)
tree5cf938d80507656df651e642f5807dff65ab2775 /gnu
parent66b9a88a9276238dd82d4e95992133baa9881fcd (diff)
downloadFreeBSD-src-7c5c2ceb800933c363adda6c307b08b701bd3c54.zip
FreeBSD-src-7c5c2ceb800933c363adda6c307b08b701bd3c54.tar.gz
kgdb enhancements!
* document the kgdb -b flag * better verify what's valid with -b * add more comprehensive command line help PR: kern/175743 Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.14
-rw-r--r--gnu/usr.bin/gdb/kgdb/main.c19
2 files changed, 13 insertions, 10 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.1 b/gnu/usr.bin/gdb/kgdb/kgdb.1
index 4073d70..58d0786 100644
--- a/gnu/usr.bin/gdb/kgdb/kgdb.1
+++ b/gnu/usr.bin/gdb/kgdb/kgdb.1
@@ -33,6 +33,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl a | Fl f | Fl fullname
+.Op Fl b Ar rate
.Op Fl q | Fl quiet
.Op Fl v
.Op Fl w
@@ -62,6 +63,9 @@ The
or
.Fl fullname
options are supported for backward compatibility as well.
+.It Fl b Ar rate
+Set the baudrate to
+.Ar rate .
.It Fl q
Suppress printing of the banner when the debugger starts.
The
diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c
index 45a3dc0..aa062a2 100644
--- a/gnu/usr.bin/gdb/kgdb/main.c
+++ b/gnu/usr.bin/gdb/kgdb/main.c
@@ -83,7 +83,7 @@ usage(void)
{
fprintf(stderr,
- "usage: %s [-afqvw] [-d crashdir] [-c core | -n dumpnr | -r device]\n"
+ "usage: %s [-afqvw] [-b rate] [-d crashdir] [-c core | -n dumpnr | -r device]\n"
"\t[kernel [core]]\n", getprogname());
exit(1);
}
@@ -338,19 +338,18 @@ main(int argc, char *argv[])
case 'a':
annotation_level++;
break;
- case 'b':
- {
- int i;
- char *p;
+ case 'b': {
+ int i;
+ char *p;
- i = strtol (optarg, &p, 0);
- if (i == 0 && p == optarg)
+ i = strtol(optarg, &p, 0);
+ if (*p != '\0' || p == optarg)
warnx("warning: could not set baud rate to `%s'.\n",
optarg);
- else
- baud_rate = i;
- }
+ else
+ baud_rate = i;
break;
+ }
case 'c': /* use given core file. */
if (vmcore != NULL) {
warnx("option %c: can only be specified once",
OpenPOWER on IntegriCloud