From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 16 17:52:47 2013 Return-Path: Delivered-To: freebsd-hackers@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 E99D2D91 for ; Wed, 16 Jan 2013 17:52:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com [209.85.216.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9BC8CE0E for ; Wed, 16 Jan 2013 17:52:47 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id a19so1380606qad.19 for ; Wed, 16 Jan 2013 09:52:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=XAhSP1O+XHJJvMqOsBZuZgAq4miDMH9V8XqZpNoLvxU=; b=OaRkwiDHA3NO2/AtHKRIJp/Ssib8s3yoh9LSTD/vWDWSJx9MF9KBZoLtvY5m2D1vlG ZJjGif6ABQklrpoRegh1ze9jVgjB4GSdg/5fptnfCyVDm6W2cyiyHcP6rJWLdIhmhlO/ FByTpGfNmzUJmcyVuseuTLJEVgvjWd1BQzhjXBrRmnynireec901K5PdCKXttQjj2w/A KGVJiPbp27AfP9p2HngmOq7nkXHDlKjs6JwzNaqvN7P1d/wWHRvfjzG8Qi6HMraf73Xp cMmso9gBk6RicWFldSf1yig+scbBkXC/8wjUb1R+6SzhMuhrlbZxbEF7Ar0CnOUlXKl5 GpVA== X-Received: by 10.49.49.226 with SMTP id x2mr2452224qen.45.1358358761153; Wed, 16 Jan 2013 09:52:41 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id x9sm13235807qen.1.2013.01.16.09.52.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 09:52:39 -0800 (PST) Sender: Warner Losh Subject: Re: [RFC] support -b when starting gdb Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <816C84A4-BF12-468C-BED8-797A319E9CDC@gmail.com> Date: Wed, 16 Jan 2013 10:52:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <52655D4C-6B01-4E62-B639-51142EEE8353@bsdimp.com> References: <89207049-41FF-479D-90EE-89652937AB29@bsdimp.com> <816C84A4-BF12-468C-BED8-797A319E9CDC@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQlp6qILH8zx5ONsrthZKo0WMcK2geAETqfNIAiJEv1EUgcflckB+fYNge5hDPAcu8M6aZjg Cc: "freebsd-hackers@freebsd.org" , Adrian Chadd , freebsd-current X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 17:52:48 -0000 On Jan 16, 2013, at 9:05 AM, Garrett Cooper wrote: > On Jan 16, 2013, at 7:35 AM, Warner Losh wrote: >=20 >> 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 = once", >=20 > It's more of a convenience factor and easier to script command line = arguments IMO. True, but he said there was no way to do it... I have this in my setup = scripts when I have to do serial debugging... Warner