Re: [PATCH] Add rusage reporting to procstat
On Mon, Jan 14, 2013 at 04:39:17PM -0500, John Baldwin wrote: This patch adds a new -r flag to dump the resource usage information (what you would get from getrusage() or wait()) for a given process. Sample output: % procstat -r $$ PID COMM TYPE VALUE 1428 tcsh user time 00:00:00.050182 1428 tcsh system time 00:00:00.040145 1428 tcsh maximum RSS 3328 B maximum RSS -- 3328 _bytes_? You kidding. 1428 tcsh integral shared memory 2844 B 1428 tcsh integral unshared data 6372 B 1428 tcsh integral unshared stack 1152 B 1428 tcsh page reclaims1306 1428 tcsh page faults12 1428 tcsh swaps 0 1428 tcsh block reads50 1428 tcsh block writes0 1428 tcsh messages sent 172 1428 tcsh messages received 0 1428 tcsh signals received 33 1428 tcsh voluntary context switches 1167 1428 tcsh involuntary context switches1 http://www.FreeBSD.org/~jhb/patches/procstat_rusage.patch Any thoughts, etc.? -- John Baldwin ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: [PATCH] Add rusage reporting to procstat
On Tue, Jan 15, 2013 at 01:49:01PM +, David Chisnall wrote: On 15 Jan 2013, at 13:47, Slawa Olhovchenkov wrote: maximum RSS -- 3328 _bytes_? You kidding. I think this is a bug in our getrusage. I've seen similar (4KB) things in a program that mmap()s 12KB of input, allocates a load of heap memory for metadata, uses a bunch of stack, and then exits. I find it is quite odd that the figure isn't a multiple of the page size, because the resident set can't be anything other than an integer number of pages.. man getrusage ru_maxrssthe maximum resident set size utilized (in kilobytes). Dimensions of the other fields may be also wrong. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: [PATCH] Add rusage reporting to procstat
On Monday, January 14, 2013 5:44:42 pm Konstantin Belousov wrote: On Mon, Jan 14, 2013 at 04:39:17PM -0500, John Baldwin wrote: This patch adds a new -r flag to dump the resource usage information (what you would get from getrusage() or wait()) for a given process. Sample output: % procstat -r $$ PID COMM TYPE VALUE 1428 tcsh user time 00:00:00.050182 1428 tcsh system time 00:00:00.040145 1428 tcsh maximum RSS 3328 B 1428 tcsh integral shared memory 2844 B 1428 tcsh integral unshared data 6372 B 1428 tcsh integral unshared stack 1152 B 1428 tcsh page reclaims1306 1428 tcsh page faults12 1428 tcsh swaps 0 1428 tcsh block reads50 1428 tcsh block writes0 1428 tcsh messages sent 172 1428 tcsh messages received 0 1428 tcsh signals received 33 1428 tcsh voluntary context switches 1167 1428 tcsh involuntary context switches1 http://www.FreeBSD.org/~jhb/patches/procstat_rusage.patch Any thoughts, etc.? It looks fine, but use of the human-oriented resource values, together with spaces in names, makes the parsing of the output unfeasible. Yes, but that is par for the course with procstat. If we wanted to add a global flag to request machine-readable output and update the various procstat backends to honor it, I think that would be a great project. The patch only reports the process-cumulative rusage, and not the per-thread rusage, it seems. Yes, this is true. It operates on the process-wide kinfo that procstat has handy. It would not be too hard to add a thread mode (-H flag perhaps?) to have it request the kinfo_proc structures for all threads and then output those separately. -- John Baldwin ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: ktrace -d broken on current/stable-9
On Mon, Jan 14, 2013 at 06:48:13PM -0800, Garrett Cooper wrote: I tried using ktrace on a kernel compiled a week ago, and it appears to not be following forks like it should on amd64: # ktrace -d ./regress -l [snip] Not sure how it broke, but it was working a couple months ago (in particular I remember it working either around October or November), and the bug seems to have worked its way back to 9-STABLE (I'm running into the same problem if I do ktrace -d, enter a shell, then exec another shell from that shell). Haven't spent the time to bisect the commits looking for the culprit (yet), but if need be I'll trace down the culprit sometime this week. truss works, so it doesn't seem like ptrace(2) is broken. ktrace -d is not really useful in the synopsis with a command. It only means that the child processes of ktrace (at a time just before it executes the utility) should be traced as well. This is almost always an empty set, unless you do things like cmd1 ktrace -d cmd2 which will trace cmd2 and part of cmd1. You probably want ktrace -i. -- Jilles Tjoelker ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Clang warning patches
hiren panchasara wrote this message on Tue, Jan 15, 2013 at 07:52 -0800: http://www.strugglingcoder.info/patches/clang_warnings_dev_bktr.txt This patch does not look correct at all... It is simply removing code.. How is is good that after we failed to set the tv_freq that we continue on? What is the warning that we are fixing here? -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Clang warning patches
John-Mark Gurney wrote this message on Tue, Jan 15, 2013 at 15:10 -0800: hiren panchasara wrote this message on Tue, Jan 15, 2013 at 07:52 -0800: http://www.strugglingcoder.info/patches/clang_warnings_dev_bktr.txt This patch does not look correct at all... It is simply removing code.. How is is good that after we failed to set the tv_freq that we continue on? What is the warning that we are fixing here? I forgot to look at the intermediate variable that tv_channel was being assigned to... Turns out it's an unsigned int, while tv_channel is returning an int... We should fix this properly by changing temp to be an int, or moving the check inline instead of removing it blindly... I think I still have an old bktr card that I can throw in to do some basic testing... After doing some code sperlunking, looks like this bug was introduced w/ the original driver 15 years ago... And no one noticed even after moving the code around a few times... -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Missing compile_et and kerberos breaks buildworld
It seems that buildworld depends on the existence of /usr/bin/compile_et if one wants to build WITH_KERBEROS on a system that has never had Kerberos support. I discovered this issue when des@ removed the NOFOO and NO_FOO options, and the NO_KERBEROS=YES in my /etc/make.conf was neutered. The system in question has never had kerneros installed. One can emulate the problem as follows: % mv /usr/bin/compile_et /usr/bin/compile_et.old % cd /usr/src % make buildworld (a few hours later ... boom) === kerberos5/lib/libasn1 (buildincludes) compile_et /usr/src/kerberos5/lib/libasn1/../../../crypto/heimdal/lib/asn1/asn1_err.et compile_et: No such file or directory *** [asn1_err.h] Error code 1 Stop in /usr/src/kerberos5/lib/libasn1. *** [buildincludes] Error code 1 Stop in /usr/src/kerberos5/lib. *** [buildincludes] Error code 1 Stop in /usr/src/kerberos5. *** [includes] Error code 1 Stop in /usr/src/kerberos5. *** [kerberos5.includes__D] Error code 1 Stop in /usr/src. *** [_includes] Error code 1 Stop in /usr/src. *** [buildworld] Error code 1 Stop in /usr/src. The obvious step of installing compile_et gives % cd /usr/src/usr.bin/compile_et % make depend yacc -d -o parse.c /usr/src/usr.bin/compile_et/../../contrib/com_err/parse.y lex -t /usr/src/usr.bin/compile_et/../../contrib/com_err/lex.l lex.c rm -f .depend mkdep -f .depend -a-I. -I/usr/src/usr.bin/compile_et/../../contrib/com_err -std=gnu99 /usr/src/usr.bin/compile_et/../../contrib/com_err/compile_et.c parse.c lex.c /usr/src/usr.bin/compile_et/../../contrib/com_err/compile_et.c:39:20: error: getarg.h: No such file or directory /usr/src/usr.bin/compile_et/../../contrib/com_err/compile_et.c:41:19: error: roken.h: No such file or directory mkdep: compile failed *** [.depend] Error code 1 so it appears that I need to build and install libroken to get the headers getarg.h and roken.h installed in /usr/include. % cd /usr/src/kerberos5/lib/libroken % make depend make-roken roken.h make-roken: not found *** [roken.h] Error code 127 Stop in /usr/src/kerberos5/lib/libroken. Ok. Let's try building make-roken. % cd /usr/src/kerberos5/tools/make-roken % make depend make make install Hooray, that worked. % cd /usr/src/kerberos5/lib/libroken % make depend Hooray, again. % make (boom) cc -O2 -pipe -march=opteron -I/usr/src/kerberos5/lib/libroken/../../../crypto/heimdal/lib/roken -I. -DHAVE_CONFIG_H -I/usr/src/kerberos5/lib/libroken/../../include -std=gnu99 -fstack-protector -c /usr/src/kerberos5/lib/libroken/../../../crypto/heimdal/lib/roken/copyhostent.c -o copyhostent.o /usr/src/kerberos5/lib/libroken/../../../crypto/heimdal/lib/roken/copyhostent.c:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'struct' *** [copyhostent.o] Error code 1 Stop in /usr/src/kerberos5/lib/libroken. :( % make clean make depend % make make install That worked! (Apparently, something in the previous buildworld made cc unhappy.) % cd /usr/src/usr.bin/compile_et % make (boom) cc -O2 -pipe -march=opteron -I. -I/usr/src/usr.bin/compile_et/../../contrib/com_err -std=gnu99 -fstack-protector -Wno-pointer-sign -o compile_et compile_et.o parse.o lex.o -lroken /usr/obj/usr/src/usr.bin/compile_et/../../kerberos5/lib/libvers/libvers.a cc: /usr/obj/usr/src/usr.bin/compile_et/../../kerberos5/lib/libvers/libvers.a: No such file or directory *** [compile_et] Error code 1 % cd /usr/src/kerberos5/lib/libvers % make depend make make install Ok. % cd /usr/src/usr.bin/compile_et % make clean make depend make make install % cd /usr/src % make buildenv Entering world for amd64:amd64 # which compile_et /usr/bin/compile_et # exit Whoops. That can't be right. % make -DNO_CLEAN buildworld and buildworld seems to be back on-track. -- Steve ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Clang warning patches
On Tue, Jan 15, 2013 at 3:22 PM, John-Mark Gurney j...@funkthat.com wrote: John-Mark Gurney wrote this message on Tue, Jan 15, 2013 at 15:10 -0800: hiren panchasara wrote this message on Tue, Jan 15, 2013 at 07:52 -0800: http://www.strugglingcoder.info/patches/clang_warnings_dev_bktr.txt This patch does not look correct at all... It is simply removing code.. How is is good that after we failed to set the tv_freq that we continue on? What is the warning that we are fixing here? I forgot to look at the intermediate variable that tv_channel was being assigned to... Turns out it's an unsigned int, while tv_channel is returning an int... We should fix this properly by changing temp to be an int, or moving the check inline instead of removing it blindly... I agree. My bad. I should have looked at it a little more carefully. Turning temp to int looks fine. All function returns being assigned to temp are int. I think I still have an old bktr card that I can throw in to do some basic testing... I will update the patch in a bit. I do not have the hardware but let me know if I can help you in testing. Thanks, Hiren After doing some code sperlunking, looks like this bug was introduced w/ the original driver 15 years ago... And no one noticed even after moving the code around a few times... -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Missing compile_et and kerberos breaks buildworld
On Tue, Jan 15, 2013 at 03:35:25PM -0800, Steve Kargl wrote: It seems that buildworld depends on the existence of /usr/bin/compile_et if one wants to build WITH_KERBEROS on a system that has never had Kerberos support. I discovered this issue when des@ removed the NOFOO and NO_FOO options, and the NO_KERBEROS=YES in my /etc/make.conf was neutered. The system in question has never had kerneros installed. One can emulate the problem as follows: For what it is worth, reverting the removal of NO_FOO, et. al, will not fix your issue. I ran into this several months ago, and found out the hard way that many of our ports require kerberos, even if they do not advertise it - so building without kerberos on the system would fail. I started digging into it, and found what you found - compile_et does not get built prior to building the kerberos bits. It actually gets quite worse from there. I do not recall the details off-hand, but I recall doing 'make obj all install' in somewhat this order: - secure/ - include/ - kerberos5/ [some steps may be missing] Once I had compile_et, install_et, and a few things I do not recall right now, I could then go through and do a full buildworld/installworld. I never got much further in tracking this down. :( Glen pgpR1naz98yiQ.pgp Description: PGP signature
Re: Missing compile_et and kerberos breaks buildworld
On Tue, Jan 15, 2013 at 06:44:39PM -0500, Glen Barber wrote: On Tue, Jan 15, 2013 at 03:35:25PM -0800, Steve Kargl wrote: It seems that buildworld depends on the existence of /usr/bin/compile_et if one wants to build WITH_KERBEROS on a system that has never had Kerberos support. I discovered this issue when des@ removed the NOFOO and NO_FOO options, and the NO_KERBEROS=YES in my /etc/make.conf was neutered. The system in question has never had kerneros installed. One can emulate the problem as follows: For what it is worth, reverting the removal of NO_FOO, et. al, will not fix your issue. Actually, it would because the NO_KERBEROS=YES in /etc/make.conf would bypass building kerberos. :-) And yes, I've changed NO_KERBEROS to WITHOUT_KERBEROS and buildworld survives. I'm now looking into just how broken is bootstrapping kerberos. I ran into this several months ago, and found out the hard way that many of our ports require kerberos, even if they do not advertise it - so building without kerberos on the system would fail. I started digging into it, and found what you found - compile_et does not get built prior to building the kerberos bits. Thanks for confirming my fears. It actually gets quite worse from there. Yep. :( I just hit cc -O2 -pipe -march=opteron -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON -DENV_HACK -DSTREAMSPTY -DINET6 -I/usr/src/libexec/telnetd/../../contrib/telnet -DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -Dnet_write=telnet_net_write -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -o telnetd global.o slc.o state.o sys_term.o telnetd.o termstat.o utility.o authenc.o -lutil -ltermcap /usr/obj/usr/src/libexec/telnetd/../../lib/libtelnet/libtelnet.a -lmp -lcrypto -lcrypt -lpam -lkrb5 -lhx509 -lasn1 -lroken -lcom_err /usr/obj/usr/src/tmp/usr/lib/libroken.so: undefined reference to `unvis@FBSD_1.0cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [telnetd] Error code 1 I do not recall the details off-hand, but I recall doing 'make obj all install' in somewhat this order: - secure/ - include/ - kerberos5/ [some steps may be missing] Thanks for a possible roadmap. -- Steve ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Missing compile_et and kerberos breaks buildworld
On Tue, Jan 15, 2013 at 04:46:01PM -0800, Steve Kargl wrote: It actually gets quite worse from there. Yep. :( I just hit cc -O2 -pipe -march=opteron -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON -DENV_HACK -DSTREAMSPTY -DINET6 -I/usr/src/libexec/telnetd/../../contrib/telnet -DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -Dnet_write=telnet_net_write -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -o telnetd global.o slc.o state.o sys_term.o telnetd.o termstat.o utility.o authenc.o -lutil -ltermcap /usr/obj/usr/src/libexec/telnetd/../../lib/libtelnet/libtelnet.a -lmp -lcrypto -lcrypt -lpam -lkrb5 -lhx509 -lasn1 -lroken -lcom_err /usr/obj/usr/src/tmp/usr/lib/libroken.so: undefined reference to `unvis@FBSD_1.0cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [telnetd] Error code 1 This looks somewhat familiar. I vaguely recall setting WITHOUT_TELNET to get past this. Once buildworld finished successfully, I removed it from src.conf, and things built afterwards. I do not recall the details off-hand, but I recall doing 'make obj all install' in somewhat this order: - secure/ - include/ - kerberos5/ [some steps may be missing] Thanks for a possible roadmap. I wish I had more useful details to provide. I'm going based on memory at this point. One other thing - make sure WITHOUT_GSSAPI (for ports) does not exist in make.conf. That bit me on two of the three machines I went through this nightmare. Glen PS: I thought I filed a PR with details on this, but it seems not to be the case. :( pgpiwTUQnep3s.pgp Description: PGP signature
Re: ctfconvert again
I am working on a fix for this. It shouldn't be too bad, as we already build a cross-ctfconvert in certain cases. I just need to get some machines running older FreeBSD versions to test on to confirm that the fix worked. Should be able to test tomorrow, assuming that I am finally able to coerce old releases of FreeBSD to build on my -CURRENT machine. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
panic: pmap_insert_pt_page: pindex already inserted (r245473)
I've just gotten this panic on a -CURRENT (r245473): freebsd10-zfs dumped core - see /var/crash/vmcore.0 Tue Jan 15 20:32:15 CST 2013 FreeBSD freebsd10-zfs 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r245473: Tue Jan 15 19:45:27 CST 2013 root@freebsd10-zfs:/usr/obj/usr/src/sys/BORG-DTRACE amd64 panic: pmap_insert_pt_page: pindex already inserted GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as amd64-marcel-freebsd... Unread portion of the kernel message buffer: panic: pmap_insert_pt_page: pindex already inserted cpuid = 1 KDB: enter: panic Reading symbols from /boot/kernel/zfs.ko...Reading symbols from /boot/kernel/zfs.ko.symbols...done. done. Loaded symbols for /boot/kernel/zfs.ko Reading symbols from /boot/kernel/acl_nfs4.ko...Reading symbols from /boot/kernel/acl_nfs4.ko.symbols...done. done. Loaded symbols for /boot/kernel/acl_nfs4.ko Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from /boot/kernel/opensolaris.ko.symbols...done. done. Loaded symbols for /boot/kernel/opensolaris.ko Reading symbols from /boot/modules/vboxguest.ko...done. Loaded symbols for /boot/modules/vboxguest.ko #0 doadump (textdump=934624608) at pcpu.h:229 229 pcpu.h: No such file or directory. in pcpu.h (kgdb) #0 doadump (textdump=934624608) at pcpu.h:229 #1 0x8030a722 in db_fncall (dummy1=value optimized out, dummy2=value optimized out, dummy3=value optimized out, dummy4=value optimized out) at /usr/src/sys/ddb/db_command.c:578 #2 0x8030a3fa in db_command (last_cmdp=value optimized out, cmd_table=value optimized out, dopager=1) at /usr/src/sys/ddb/db_command.c:449 #3 0x8030a1b2 in db_command_loop () at /usr/src/sys/ddb/db_command.c:502 #4 0x8030cb00 in db_trap (type=value optimized out, code=0) at /usr/src/sys/ddb/db_main.c:231 #5 0x805691c3 in kdb_trap (type=10, code=0, tf=value optimized out) at /usr/src/sys/kern/subr_kdb.c:654 #6 0x80740993 in trap (frame=0xff8437b540d0) at /usr/src/sys/amd64/amd64/trap.c:579 I have the core.txt.0 at: http://www.lerctr.org/~ler/core.txt.0 This is in a VirtualBox VM running on a -CURRENT host. What else do you need? I do have the core. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: l...@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893 ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: ktrace -d broken on current/stable-9
On Tue, Jan 15, 2013 at 2:53 PM, Jilles Tjoelker jil...@stack.nl wrote: On Mon, Jan 14, 2013 at 06:48:13PM -0800, Garrett Cooper wrote: I tried using ktrace on a kernel compiled a week ago, and it appears to not be following forks like it should on amd64: # ktrace -d ./regress -l [snip] Not sure how it broke, but it was working a couple months ago (in particular I remember it working either around October or November), and the bug seems to have worked its way back to 9-STABLE (I'm running into the same problem if I do ktrace -d, enter a shell, then exec another shell from that shell). Haven't spent the time to bisect the commits looking for the culprit (yet), but if need be I'll trace down the culprit sometime this week. truss works, so it doesn't seem like ptrace(2) is broken. ktrace -d is not really useful in the synopsis with a command. It only means that the child processes of ktrace (at a time just before it executes the utility) should be traced as well. This is almost always an empty set, unless you do things like cmd1 ktrace -d cmd2 which will trace cmd2 and part of cmd1. You probably want ktrace -i. Dangit -- forgot about that option. Ok, PEBKAC award for me. Thanks, -Garrett ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
[RFC] support -b baudrate when starting gdb
Hi, 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. However kgdb doesn't have this support. 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. The MIPS stuff has other issues; I'll talk about those later. Thanks, Adrian Index: gnu/usr.bin/gdb/kgdb/main.c === --- gnu/usr.bin/gdb/kgdb/main.c (revision 245281) +++ gnu/usr.bin/gdb/kgdb/main.c (working copy) @@ -333,11 +333,24 @@ 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, ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: [RFC] support -b baudrate when starting gdb
Also, I found 'set remotebaud' and 'set debug remote 1' to do this. I'd like to add the code just to support the same -b flag as gdb (so -r can also be used with a non-standard serial port.) Thanks, Adrian On 15 January 2013 21:15, Adrian Chadd adr...@freebsd.org wrote: Hi, 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. However kgdb doesn't have this support. 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. The MIPS stuff has other issues; I'll talk about those later. Thanks, Adrian Index: gnu/usr.bin/gdb/kgdb/main.c === --- gnu/usr.bin/gdb/kgdb/main.c (revision 245281) +++ gnu/usr.bin/gdb/kgdb/main.c (working copy) @@ -333,11 +333,24 @@ 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, ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org