Author: adrian
Date: Tue Feb 19 02:09:18 2013
New Revision: 246958
URL: http://svnweb.freebsd.org/changeset/base/246958

Log:
  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.mal...@gmx.de>

Modified:
  head/gnu/usr.bin/gdb/kgdb/kgdb.1
  head/gnu/usr.bin/gdb/kgdb/main.c

Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.1
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/kgdb.1    Tue Feb 19 02:07:36 2013        
(r246957)
+++ head/gnu/usr.bin/gdb/kgdb/kgdb.1    Tue Feb 19 02:09:18 2013        
(r246958)
@@ -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

Modified: head/gnu/usr.bin/gdb/kgdb/main.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/main.c    Tue Feb 19 02:07:36 2013        
(r246957)
+++ head/gnu/usr.bin/gdb/kgdb/main.c    Tue Feb 19 02:09:18 2013        
(r246958)
@@ -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",
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to