Author: adrian
Date: Mon Jan 21 01:46:36 2013
New Revision: 245705
URL: http://svnweb.freebsd.org/changeset/base/245705

Log:
  Add command-line support to kgdb to allow the baudrate to be set.
  
  This allows a remote session to be specified with '-r' as well as a
  non-default baudrate setting using '-b'.
  
  TODO: add to the kgdb manpage.
  
  MFC after:    2 weeks

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

Modified: head/gnu/usr.bin/gdb/kgdb/main.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/main.c    Mon Jan 21 01:33:10 2013        
(r245704)
+++ head/gnu/usr.bin/gdb/kgdb/main.c    Mon Jan 21 01:46:36 2013        
(r245705)
@@ -333,11 +333,24 @@ main(int argc, char *argv[])
        args.argv = malloc(sizeof(char *));
        args.argv[0] = argv[0];
 
-       while ((ch = getopt(argc, argv, "ac:d:fn:qr:vw")) != -1) {
+       while ((ch = getopt(argc, argv, "ab:c:d:fn:qr:vw")) != -1) {
                switch (ch) {
                case 'a':
                        annotation_level++;
                        break;
+               case 'b':
+                       {
+                               int i;
+                               char *p;
+
+                               i = strtol (optarg, &p, 0);
+                               if (i == 0 && p == optarg)
+                               warnx("warning: could not set baud rate to 
`%s'.\n",
+                                   optarg);
+                               else
+                                       baud_rate = i;
+                       }
+                       break;
                case 'c':       /* use given core file. */
                        if (vmcore != NULL) {
                                warnx("option %c: can only be specified once",
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to