Re: Compile gdbserver for powerpc

2 messages, 2 authors, 2000-06-26 · open the first message on its own page

Re: Compile gdbserver for powerpc

From: Murray Jensen <hidden>
Date: 2000-06-21 01:49:51

On Tue, 20 Jun 2000 10:35:21 -0500, Lucinda Schafer [off-list ref]
writes:
quoted
From Graham Stoney's "Linux for PowerPC Embedded Systems HOWTO/FAQ", Section
...
18.3 Kernel
It is not currently possible to use gdb for kenel debugging.
Whoops. This should probably change. I use gdb for kernel debugging on
the (8xx) 2.[34].x kernels (its *very* handy!). You need to enable
CONFIG_KGDB first though, and if you don't want to use the default serial
port (via SMC1?? for 8xx) you need to do a bit of hacking. Here's how:

1. make sure either CONFIG_SERIAL_CONSOLE, or CONFIG_KGDB, itself is undefined
   when 8xx_io/uart.c is compiled

2. ensure the call to kgdb_map_scc() is not done in arch/ppc/kernel/setup.c;
   replace it with a call to your own serial port init routine, if required.

3. write three functions (usually in your serial driver, and inside #ifdef
   CONFIG_SERIAL_CONSOLE, inside #ifdef CONFIG_KGDB):

	extern void putDebugChar(char kgdb_char);
	extern char getDebugChar(void);
	extern void kgdb_interruptible(int yes);

   the first two are fairly obvious - busy-wait put and get character to
   the chosen serial port. the third enables (yes==1) or disables (yes==0)
   *serial* interrupts (not all interrupts - at least I don't think so).

   e.g.	#ifdef CONFIG_SERIAL_CONSOLE
	... (serial console stuff) ...
	#ifdef CONFIG_KGDB
	void
	putDebugChar(char c)
	{
	...
	#endif /* CONFIG_KGDB */
	#endif /* CONFIG_SERIAL_CONSOLE */

1 and 2 are for the 8xx kernel - there will be similar steps for other
platforms (i.e. making sure the code for the default kgdb serial "driver" is
not compiled in, obviously so there is not a clash with the ones you write).

One thing to remember: if you enable CONFIG_KGDB, setup_arch() in
arch/ppc/kernel/setup.c will execute a breakpoint() and for the kernel
to proceed past that point, you must start gdb on your host in "remote"
mode (on the appropriate serial port with the appropriate speed) and
perform a gdb "continue" command (this caused me some concern when it
was added a few months ago, I thought my kernel was dead :-)

Hope this helps. Cheers!
								Murray...
--
Murray Jensen, CSIRO Manufacturing Sci & Tech,         Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen@cmst.csiro.au  (old address was mjj@mlb.dmt.csiro.au)


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

Re: Compile gdbserver for powerpc

From: Graham Stoney <hidden>
Date: 2000-06-26 06:36:00

On Tue, 20 Jun 2000 10:35:21 -0500, Lucinda Schafer [off-list ref]
writes:
quoted
From Graham Stoney's "Linux for PowerPC Embedded Systems HOWTO/FAQ", Section
...
18.3 Kernel
It is not currently possible to use gdb for kenel debugging.
Murray Jensen writes:
Whoops. This should probably change.
It already had. Lucinda must be looking at an old copy of the HOWTO.

Regards,
Graham
--
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help