From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 31 20:50:06 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D192E99D for ; Thu, 31 Jan 2013 20:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B8CE6CA for ; Thu, 31 Jan 2013 20:50:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0VKo6VZ013566 for ; Thu, 31 Jan 2013 20:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0VKo6Fg013565; Thu, 31 Jan 2013 20:50:06 GMT (envelope-from gnats) Resent-Date: Thu, 31 Jan 2013 20:50:06 GMT Resent-Message-Id: <201301312050.r0VKo6Fg013565@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christoph Mallon Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF92D7F7 for ; Thu, 31 Jan 2013 20:48:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D084EA3 for ; Thu, 31 Jan 2013 20:48:12 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKmCpA076913 for ; Thu, 31 Jan 2013 20:48:12 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r0VKmC8g076912; Thu, 31 Jan 2013 20:48:12 GMT (envelope-from nobody) Message-Id: <201301312048.r0VKmC8g076912@red.freebsd.org> Date: Thu, 31 Jan 2013 20:48:12 GMT From: Christoph Mallon To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/175743: Patches for kgdb X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:50:06 -0000 >Number: 175743 >Category: misc >Synopsis: Patches for kgdb >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu Jan 31 20:50:06 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Christoph Mallon >Release: >Organization: >Environment: >Description: Two patches for Adrian Chadd for kgdb: - Improve test whether the argument of -b is valid. - Document -b in the manpage and usage. >How-To-Repeat: >Fix: Patch attached with submission follows: >From 9d268c225e431bd8e548cfd88df5a9837a3aeb87 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 21 Jan 2013 07:27:42 +0100 Subject: [PATCH 1/2] kgdb: Improve test whether the argument of -b is valid. Now non-digits (e.g. "4k") are detected. --- gnu/usr.bin/gdb/kgdb/main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c index 45a3dc0..930cdee 100644 --- a/gnu/usr.bin/gdb/kgdb/main.c +++ b/gnu/usr.bin/gdb/kgdb/main.c @@ -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", -- 1.8.1.2 >From 3846bfff5ad1450d4d047c3d3912dd28a5235751 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 25 Jan 2013 20:58:37 +0100 Subject: [PATCH 2/2] kgdb: Document -b in the manpage and usage. --- gnu/usr.bin/gdb/kgdb/kgdb.1 | 4 ++++ gnu/usr.bin/gdb/kgdb/main.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 930cdee..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); } -- 1.8.1.2 >Release-Note: >Audit-Trail: >Unformatted: