From: Murray Jensen <Murray.Jensen@cmst.csiro.au>
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Compile gdbserver for powerpc
Date: Wed, 21 Jun 2000 11:49:51 +1000 [thread overview]
Message-ID: <5804.961552191@msa.cmst.csiro.au> (raw)
In-Reply-To: Message from Lucinda Schafer <lucsch@adaptivemicro.com> of "Tue, 20 Jun 2000 10:35:21 EST." <A109131318C4D1119AC20060088DECE330F451@amwmail.adaptivemicro.com>
On Tue, 20 Jun 2000 10:35:21 -0500, Lucinda Schafer <lucsch@adaptivemicro.com>
writes:
>>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/
next prev parent reply other threads:[~2000-06-21 1:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <lucsch@adaptivemicro.com>
2000-06-20 15:35 ` Compile gdbserver for powerpc Lucinda Schafer
2000-06-21 1:49 ` Murray Jensen [this message]
2000-06-26 6:36 ` Graham Stoney
2000-06-20 14:59 interface.etd1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5804.961552191@msa.cmst.csiro.au \
--to=murray.jensen@cmst.csiro.au \
--cc=linuxppc-embedded@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).