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
This commit is contained in:
Adrian Chadd 2013-01-21 01:46:36 +00:00
parent e3f0800bd1
commit 23dbd4334a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245705

View File

@ -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",