Skip to contentSkip to conversation

kgdb and mpc8xx (again)

DISCUSSION Ibon Gotxi Garcia 3 participants 3 messages Mar 10, 2003 – Mar 11, 2003

lore
Share & tools
lore
#0 lore raw

Hi:

I'm trying to debug a kernel on a 8xx board with kgdb, using the SMC1. I have disabled all the outputs to the console made by the bootstrap code, and simply running kermit, i get this line

$T0540:c0009db0;01:c01152fe;#b1

If i run ppc-linux-gdb instead of kermit, i get

0xc0009db0 in breakpoint () at ppc-stub.c:726

and the board restarts itself.

I have no idea why. Maybe:

1.- It's something related with some console output (don't know if enabling kgdb disables all the console output in SMC1).
2.- A watchdog timeout happens (Does the kgdb code resets the watchdog?).
3.- Do I have to do a "set endian xxx" in ppc-linux-gdb ??? (to get that output i have done a "set endian big")

I'm using the denx kernel from the cvs and ppc-linux-gdb from ELDK 2.0.2 (on a x86 development machine)

Cheers
Ibon

--
Ibon Gotxi Garcia <[email protected]>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 11 lines · In message <1047318121.29389.44.camel@muse> you wrote:

If i run ppc-linux-gdb instead of kermit, i get

0xc0009db0 in breakpoint () at ppc-stub.c:726

and the board restarts itself.

I have no idea why. Maybe:

1.- It's something related with some console output (don't know if enabling kgdb disables all the console output in SMC1).

No.

Quoted 2 lines

2.- A watchdog timeout happens (Does the kgdb code resets the watchdog?).

If your watchdog has not been disabled by the boot loader, you have absolutely no chance to debug the system using kgdb. Either disable the watchdog, or use a BDI2000.

Quoted 1 line

3.- Do I have to do a "set endian xxx" in ppc-linux-gdb ??? (to get that

You don't.

Quoted 2 lines

I'm using the denx kernel from the cvs and ppc-linux-gdb from ELDK 2.0.2 (on a x86 development machine)

You should use ppc_8xx-gdb as documented.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Vulcans worship peace above all.

	-- McCoy, "Return to Tomorrow", stardate 4768.3

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Ibon Gotxi Garcia
Quoted 2 lines · Ibon Gotxi Garcia

1.- It's something related with some console output (don't know if enabling kgdb disables all the console output in SMC1).

It's a long time since I've done this (I've got a bdi2000 now :-) but enabling CONFIG_KGDB used to enable a call to breakpoint() in the early setup stuff - and your output from ppc-linux-gdb seems to confirm this. I am surprised that the board restarts itself - I suspect you are doing something with gdb e.g. like quitting it (which will send a command to "kill" the running process - which I think the kgdb stubs interpret as a restart).

Run your ppc-linux-gdb, and when you get the gdb prompt after the breakpoint() line (I assume you get this), do a "continue" - the kernel should continue from where it stopped. This breakpoint() gives you an opportunity to do some things before the kernel gets into full swing (maybe set a breakpoint somewhere).

Quoted 2 lines

2.- A watchdog timeout happens (Does the kgdb code resets the watchdog?).

Nothing can "reset" the watchdog (at least on 8xx and 8260) - it can only be "set" or not - usually by the boot rom. Don't enable watchdog if you want to use kgdb, unless you patch your kernel appropriately (you have to poke the watchdog registers from within the kgdb serial code - I might be able to dredge up some old patches that do this, if you want - but if you can afford it, its better to buy a bdi2000).

Quoted 2 lines

3.- Do I have to do a "set endian xxx" in ppc-linux-gdb ??? (to get that output i have done a "set endian big")

You shouldn't need to if your cross gdb is built correctly (and it will be since you are using the denx stuff). Cheers!

								Murray...

--
Murray Jensen, CSIRO Manufacturing & Infra. Tech. Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia. Fax: +61 3 9662 7853
Internet: [email protected]

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/