* Re: kgdb errors with serial console
[not found] <BDD07355-7199-4A2E-8426-F6D43EA5D313@mac.com>
@ 2010-10-07 22:37 ` Jason Wessel
[not found] ` <7BA01CAF-DD25-4AB6-9498-8AB89E2EDDE1@mac.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jason Wessel @ 2010-10-07 22:37 UTC (permalink / raw)
To: Elvis Dowson; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List
On 10/07/2010 04:47 PM, Elvis Dowson wrote:
> Hi,
> I'm getting the following errors when attempting to use kgdb with the serial console. Any idea how I can resolve this issue?
>
> The correct serial parameters when I use kermit with the target board is
>
> set flow-control off
> set carrier-watch none
> set speed 115200
>
> and it connects correctly.
>
> I'm not sure if the gdb configuration commands for the serial port are sufficient, and if there is a parameter that I am missing here. The host is connected to the target using an FTDI USB to serial converter, so it appears as /dev/ttyUSB0 on the host and as ttyS2 on the target.
>
> # su
> # cd /tool/patches/android-rowboat-froyo-2.2-patchwork/kernel
> # arm-angstrom-linux-gnueabi-gdb
> (gdb) file vmlinux
> Reading symbols from /tool/patches/android-rowboat-froyo-2.2-patchwork/kernel/vmlinux...done.
>
> (gdb) set remotebaud 115200
> (gdb) set remoteflow 0
> (gdb) set debug remote 1
> (gdb) set debug serial 1
>
You don't want to use this one, it just tends to pollute the logs, "set
debug remote 1" should be enough.
> (gdb) target remote /dev/ttyUSB0
>
>
Looks to me like you did not activate the kernel debugger before using
gdb to enter, because the gdb you are using is not going to send the
"sysrq g" sequence.
What you would want to do here is to "echo g > /proc/sysrq-trigger" with
your terminal program, disconnect and then try connecting the debugger
to the kernel. Another option is to use the agent-proxy so you can
have a console connection and a debugger connection.
It would probably also be good to test if the debugger is working at all
on your serial port.
Configure the debugger with:
# echo ttyS2 > /sys/module/kgdboc/parameters/kgdboc
kgdb: Registered I/O driver kgdboc.
# echo g > /proc/sysrq-trigger
SysRq : DEBUG
And now to exit debugger you must blindly and perfectly type
$D#44+
Nothing will be echoed because at this stage the kernel serial polling
driver would just be collecting characters.
After typing that the kernel should return back to the running state and
print something like:
+$OK#9a#
Jason.
> Remote debugging using /dev/ttyUSB0
> Sending packet: $qSupported#37...[
> r +]Ack
> [$][q][S][u][p][p][o][r][t][e][d][#][3][7]Packet received: qSupported
> Packet qSupported (supported-packets) is supported
> warning: unrecognized item "qSupported" in "qSupported" response
> Sending packet: $Hg0#df...[+]Ack
> [$][H][g][0][#][d][f]Packet received: Hg0
> Sending packet: $?#3f...[+]Ack
> [$][?][#][3][f]Packet received: ?
> Sending packet: $Hc-1#09...[+]Ack
> [$][H][c][-][1][#][0][9]Packet received: Hc-1
> Sending packet: $qC#b4...[+]Ack
> [$][q][C][#][b][4]Packet received: qC
> Sending packet: $qAttached#8f...[+]Ack
> [$][q][A][t][t][a][c][h][e][d][#][8][f]Packet received: qAttached
> Packet qAttached (query-attached) is supported
> Sending packet: $qOffsets#4b...[+]Ack
> [$][q][O][f][f][s][\r][\r][\n][e][t][s][#][4][b]Bad checksum, sentsum=0x4b, csum=0x6f, buf=qOffs\r\r\nets
> [-][<Timeout: 2 seconds>]Timed out.
> [-][<Timeout: 2 seconds>]Timed out.
> Ignoring packet error, continuing...
> Malformed response to offset query, qOffs
> ets
> (gdb)
>
>
> Best regards,
>
> Elvis Dowson
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kgdb errors with serial console
[not found] ` <7BA01CAF-DD25-4AB6-9498-8AB89E2EDDE1@mac.com>
@ 2010-10-07 23:44 ` Jason Wessel
[not found] ` <917F9CCC-F3D3-4E23-B955-412F08CE8E2E@mac.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jason Wessel @ 2010-10-07 23:44 UTC (permalink / raw)
To: Elvis Dowson; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List
On 10/07/2010 06:07 PM, Elvis Dowson wrote:
> On Oct 8, 2010, at 2:37 AM, Jason Wessel wrote:
>
>
>> It would probably also be good to test if the debugger is working at all
>> on your serial port.
>>
>> Configure the debugger with:
>> # echo ttyS2 > /sys/module/kgdboc/parameters/kgdboc
>> kgdb: Registered I/O driver kgdboc.
>> # echo g > /proc/sysrq-trigger
>> SysRq : DEBUG
>>
>> And now to exit debugger you must blindly and perfectly type
>> $D#44+
>>
>> Nothing will be echoed because at this stage the kernel serial polling
>> driver would just be collecting characters.
>>
>> After typing that the kernel should return back to the running state and
>> print something like:
>> +$OK#9a#
>>
>
> Cool, I tried all the commands that you suggested and it worked perfectly. I got the same outputs.
>
> So, if I understand correctly, I boot into the kernel without the kgbdwait option, and then manually launch the kgdb and then connect from Eclipse using gdb.
>
> The system waits at the root login prompt.
>
Probably just set a break point at sys_sync.
Of course if you are willing to try something a bit more complex you can
probably make use of being able to interactively break in with the
eclipse gdb plugin, assuming your serial port is connected to a linux
host, and it appeared that way based on your description.
On your host you could set up the following:
git clone git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git
cd agent-proxy
make
./agent-proxy 4440^4441 0 /dev/ttyUSB0,115200 &
telnet localhost 4440
Now in your gdbinit file you replace the target remote with
target remote localhost:4441
The agent proxy should take care of sending the sysrq g for you, and the
telnet window will provide you a look at the target console.
Jason.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kgdb errors with serial console
[not found] ` <917F9CCC-F3D3-4E23-B955-412F08CE8E2E@mac.com>
@ 2010-10-08 13:17 ` Jason Wessel
0 siblings, 0 replies; 3+ messages in thread
From: Jason Wessel @ 2010-10-08 13:17 UTC (permalink / raw)
To: Elvis Dowson; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List
On 10/08/2010 05:41 AM, Elvis Dowson wrote:
> Hi Jason,
> I'm getting eclipse target time outs, I've attached link to the video here : http://drop.io/kgdbwe01
>
Because you are using a serial link you certainly want to close any
related to extra data you don't need. Not knowing a whole lot about
what the Eclipse plugin gdb does, it is hard to know if this was an
eclipse timeout or not.
If you add the following to your .gdbinit it will at least tell you what
happened at the end.
set remotelogfile /tmp/gdb_serial_log.txt
It would be good to know if eclipse timed out and it just detached from
the target, or if some command crashed gdb. It is purely a guess, but
it is probably eclipse requesting lots of information and simply timing out.
> and then launched eclipse debugger. It loads the vmlinux file, and a bunch of junk characters keep appearing continuously on the telnet session.
>
>
The "junk" you speak of is simply the gdb serial traffic, it is answered
in the FAQ
http://git.kernel.org/?p=utils/kernel/kgdb/agent-proxy.git;a=blob;f=README.TXT
> After about a minute or so, Eclipse terminates the session saying that it timed out. You can see this in the video. I edited the video, in between to trim off the long wait, with the characters scrolling in the terminal session, to the point where it crashes.
>
>
I would not expect the terminal session to crash. If an oops is
printed, it means there is an internal kgdb problem.
Jason.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-08 13:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <BDD07355-7199-4A2E-8426-F6D43EA5D313@mac.com>
2010-10-07 22:37 ` kgdb errors with serial console Jason Wessel
[not found] ` <7BA01CAF-DD25-4AB6-9498-8AB89E2EDDE1@mac.com>
2010-10-07 23:44 ` Jason Wessel
[not found] ` <917F9CCC-F3D3-4E23-B955-412F08CE8E2E@mac.com>
2010-10-08 13:17 ` Jason Wessel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox