From owner-freebsd-current@FreeBSD.ORG Wed Jan 16 16:05:08 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1ED1D5D; Wed, 16 Jan 2013 16:05:08 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f50.google.com (mail-da0-f50.google.com [209.85.210.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9FAD92FD; Wed, 16 Jan 2013 16:05:08 +0000 (UTC) Received: by mail-da0-f50.google.com with SMTP id h15so633383dan.9 for ; Wed, 16 Jan 2013 08:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=XYH3yi/pVxg1MX0/aberFWCl9l/GHojyVdJSlz/mxb4=; b=zEsg+t+rcFaJPCSpKOuunuZ/4uLpllfiD8MKUZpffMXZH85BxVSUje3ydhoz2/wRsz OJTjja97Pd00XMvUW7TGXMR5WjwRsclj2rjeOWcIEmoHdWQxxp/zP3POTtXMOFDtIvSO pVLtNYJj7JeSTdp6srmeR/YXjPb8Gj2AJHaepgsfdsClexnE4pAHJj4DX8WRGz7PPWg+ SRQ28oqQxbFGxRoEGCNdm9BHzU3PLQrjhAYLJF4+ClLLyhDDWxaAoR1bE8H2f2ffZxD5 Ut3GxgQ4Ry96tjz00Nr7brvs8DCOFV3EevICuoCfXfkRxDNR5N/zX4Uka6qxkTaFI8Oq 4GvQ== X-Received: by 10.68.245.67 with SMTP id xm3mr3903540pbc.152.1358352308365; Wed, 16 Jan 2013 08:05:08 -0800 (PST) Received: from [192.168.20.12] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id q4sm10179120paz.20.2013.01.16.08.05.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 08:05:07 -0800 (PST) References: <89207049-41FF-479D-90EE-89652937AB29@bsdimp.com> Mime-Version: 1.0 (1.0) In-Reply-To: <89207049-41FF-479D-90EE-89652937AB29@bsdimp.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <816C84A4-BF12-468C-BED8-797A319E9CDC@gmail.com> X-Mailer: iPhone Mail (10A523) From: Garrett Cooper Subject: Re: [RFC] support -b when starting gdb Date: Wed, 16 Jan 2013 08:05:06 -0800 To: Warner Losh Cc: "freebsd-hackers@freebsd.org" , Adrian Chadd , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 16:05:08 -0000 On Jan 16, 2013, at 7:35 AM, Warner Losh wrote: > How does 'set remotebaud' not do what you want? >=20 > Warner >=20 > On Jan 15, 2013, at 10:15 PM, Adrian Chadd wrote: >=20 >> Hi, >>=20 >> There doesn't seem to be a blessed way to set the baudrate from inside >> gdb/kgdb. It seems to be set from '-b' on the command line. >>=20 >> However kgdb doesn't have this support. >>=20 >> This patch adds -b support so kgdb so I can override the default speed >> (9600 it seems) to speak kgdb over serial to a 115200 console MIPS >> device. >>=20 >> The MIPS stuff has other issues; I'll talk about those later. >>=20 >> Thanks, >>=20 >>=20 >>=20 >> Adrian >>=20 >>=20 >> Index: gnu/usr.bin/gdb/kgdb/main.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- gnu/usr.bin/gdb/kgdb/main.c (revision 245281) >> +++ gnu/usr.bin/gdb/kgdb/main.c (working copy) >> @@ -333,11 +333,24 @@ >> args.argv =3D malloc(sizeof(char *)); >> args.argv[0] =3D argv[0]; >>=20 >> - while ((ch =3D getopt(argc, argv, "ac:d:fn:qr:vw")) !=3D -1) { >> + while ((ch =3D getopt(argc, argv, "ab:c:d:fn:qr:vw")) !=3D -1) { >> switch (ch) { >> case 'a': >> annotation_level++; >> break; >> + case 'b': >> + { >> + int i; >> + char *p; >> + >> + i =3D strtol (optarg, &p, 0); >> + if (i =3D=3D 0 && p =3D=3D optarg) >> + warnx("warning: could not set baud >> rate to `%s'.\n", >> + optarg); >> + else >> + baud_rate =3D i; >> + } >> + break; >> case 'c': /* use given core file. */ >> if (vmcore !=3D NULL) { >> warnx("option %c: can only be specified onc= e", It's more of a convenience factor and easier to script command line argument= s IMO. Thanks, -Garrett=