This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB default breakpoint instruction for SuperH
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: Min ZOU <zou dot min at renesas dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 19 Jun 2006 10:54:10 +0100
- Subject: Re: GDB default breakpoint instruction for SuperH
- References: <447261B2.6090805@renesas.com>
Min ZOU wrote:
Hi,
I looked at this GDB (v6.4) source file: gdb/config/sh/tm-sh.h . In
side, it specifies the default breakpoint instruction for SH, which
causes GDB to insert 0xc320 (trapa #32) into target when breakpoint is
set. See below:
#define DEPRECATED_BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 } /* Used in
remote.c *
/
#define DEPRECATED_LITTLE_REMOTE_BREAKPOINT { 0x20, 0xc3 } /* Used in
remote.c *
/
I wonder why by default 0x20 is used instead of other number without
knowing the target SuperH processor type ?
Thanks!
I don't think the target processor type is important here. The
interesting thing is what your trap handler does with different numbers.
See sim/sh/gencode.c (look for 'trapa') and sim/sh/interp.c (function
trap) to see what the simulator does with various trap numbers. It would
appear that the the correct number is 0xc3.
Another place to look might be the SH Linux kernel, if that's where you
intend to use it.
Andrew Stubbs