2011-01-14 05:45:53 KGDB Help
Frank Gill (UNITED STATES)
Message: 97456
Been using printk's to get by with debugging but i need help with KGDB configuration. Any help would be appreciated. (I am going to try with console now but am still curious as to what the problem is).
Configuration = BF537 STAMP + 2010RC5.
My steps:
1. Compiled and built the 2010RC5. (with KGDB enabled and bootargs set to the configuration mentioned in the following wiki: docs.blackfin.uclinux.org/doku.php?id=linux-kernel:debug:kgdb#modify_the_kernel_command_line1).
Output from dmesg: Kernel command line: console=ttyBF0,57600 kgdboe=@TARGET/,@HOST/
I've also enabled the internal test suite which get run on bootup and the tests runs fine. This is a snippet from the boot.
kgdb: Registered I/O driver kgdbts.
kgdbts:RUN plant and detach test
kgdbts:RUN sw breakpoint test
kgdbts:RUN bad memory access test
kgdbts:RUN singlestep test 1000 iterations
kgdbts:RUN singlestep [0/1000]
kgdbts:RUN singlestep [100/1000]
kgdbts:RUN singlestep [200/1000]
kgdbts:RUN singlestep [300/1000]
kgdbts:RUN singlestep [400/1000]
kgdbts:RUN singlestep [500/1000]
kgdbts:RUN singlestep [600/1000]
kgdbts:RUN singlestep [700/1000]
kgdbts:RUN singlestep [800/1000]
kgdbts:RUN singlestep [900/1000]
kgdbts:RUN hw breakpoint test
kgdbts:RUN do_fork for 100 breakpoints
(I then compiled again and got rid of the tests)
2. tftpboot 0x1000000 uImage
3. bootm
4. ifconfig eth0 IPADDR
5. pings between target and host to verify connectivity. Connectivity is fine.
6. cd uclinux-dist/linuxXXX/
7. bfin-elf-gdb vmlinux
8. target remote udp:IPADDR:6443
Output I get
(gdb) target remote udp:IPADDRESS:6443
warning: The remote protocol may be unreliable over UDP. Some events may be lost, rendering further debugging impossible.
Remote debugging using udp:IPADDRESS:6443
Remote communication error: Connection refused.
I don't get any of those kgdboe output statements described in the section corresponding to this problem.
I did a ps for all running processes:
PID USER VSZ STAT COMMAND
1 root 562 S /init
2 root 0 SW [kthreadd]
3 root 0 SW [ksoftirqd/0]
4 root 0 SW [watchdog/0]
5 root 0 SW [events/0]
6 root 0 SW [khelper]
9 root 0 SW [async/mgr]
48 root 0 SW [sync_supers]
50 root 0 SW [bdi-default]
52 root 0 SW [kblockd/0]
54 root 0 SW [bfin-spi.0]
76 root 0 SW [khungtaskd]
77 root 0 SW [kswapd0]
115 root 0 SW [kgdbts_unreg]
120 root 0 SW [mtdblockd]
157 root 752 S -/bin/sh
158 root 484 S /sbin/inetd
159 root 740 S /sbin/syslogd -n
160 root 736 S /sbin/klogd -n 190 root 740 R ps
QuoteReplyEditDelete
2011-01-14 06:07:06 Re: KGDB Help
Frank Gill (UNITED STATES)
Message: 97457
This is on the BF537-STAMP, not any other custom board or anything.
Clean build of 2010RC5 with KGDB related options and modified bootargs is causing a Kernel Panic.
Panic attached.
KernelPanic.rtf
QuoteReplyEditDelete
2011-01-14 10:51:18 Re: KGDB Help
Mike Frysinger (UNITED STATES)
Message: 97458
please post the acutal boot output you're seeing, as well as your config files. just run `make bugreport` to generate all the files we're looking for.
QuoteReplyEditDelete
2011-01-15 04:22:30 Re: KGDB Help
Frank Gill (UNITED STATES)
Message: 97466
Hardware: BF537 STAMP, 2010RC5 uclinux dist
Bug report attached. Please let me know what i'm doing wrong. Thanks.
KGDB over Ethernet:
(Tried with straight cable and cross-over cable).
I followed the steps on the wiki and added kgdoe=@TARGETIP/,@HOSTIP/ to the bootargs
(gdb) target remote udp:IPADDRESS:6443
warning: The remote protocol may be unreliable over UDP.
Some events may be lost, rendering further debugging impossible.
Remote debugging using udp:IPADDRESS:6443
Remote communication error: Connection refused.
KGDB Over Console:
Default boot args set to:
console=ttyBF0,57600 kgdboc=ttyBF1,57600n8
(I also tried console=ttyBF0,57600 kgdboc=ttyBF1,57600)
I also tried changing the console numbers.
On the board:
Penguin image
Have a lot of fun...
BusyBox v1.16.2 (2011-01-14 22:05:36 PST) hush - the humble shell
root:/> SysRq : DEBUG
Entering KGDB
On the Host:
fgill@ubuntu:~/2010R1-RC5/linux-2.6.x$ bfin-elf-gdb vmlinux
GNU gdb 6.6
Copyright (C) 2006 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 "--host=i686-pc-linux-gnu --target=bfin-elf"...
(gdb) set remotebaud 57600
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
(gdb)
bugreport.tar.gz
QuoteReplyEditDelete
2011-01-15 13:50:36 Re: KGDB Help
Mike Frysinger (UNITED STATES)
Message: 97468
please post the full boot loop of the kernel from when u-boot starts it to when it gets to a shell prompt
QuoteReplyEditDelete
2011-01-16 23:06:41 Re: KGDB Help
Sonic Zhang (CHINA)
Message: 97488
I guess in kgdb over ethernet mode, you forgot to append "ip=xx.xx.xx.xx in" in your bootargs, while in kgdb over uart mode, you forgot to disable UART1 port in bfin serial driver.