[Linux-Xtensa] [PATCH] xtensa: add support for gdb

Baruch Siach baruch at tkos.co.il
Mon Jul 8 15:44:05 PDT 2013


Hi Marc,

On Mon, Jul 08, 2013 at 03:20:55PM -0700, Marc Gauthier wrote:
> czankel wrote:
> > Hi Marc,
> >
> > Any idea about the mismatch of that file name? Is there a mismatch
> > between the overlay file and the GDB repository?
> 
> The gdb/gdbserver/xtensa-regmap.c path does not come from
> any overlay provided by Tensilica.  There's assumed to be
> some process by which the files in the Tensilica-provided
> overlay get put in their proper location in each package.
> The idea is to keep the format and content of Tensilica
> provided overlays as stable as possible, even though open
> source packages are maintained independently and may move
> around files within their structure, etc.  So there's no
> attempt to exactly match eg. the directory structure of
> GDB, which might have led one to think the overlay tracks
> the GDB releases, which is not very practical.
> 
> Historically, some script existed, maintained in open
> source (in the buildroot project iirc), that mapped files
> from the Tensilica-provided overlay to the tarballs that
> actually get written on top of each package.  That script
> needs to track the various package releases (gdb, gcc, etc).

I generated my overlay tarball based on the conversion script at 
http://wiki.linux-xtensa.org/index.php/Toolchain_Overlay_File. This script 
needs to be updated, then.

baruch

> Looking at the latest overlays from Tensilica, they include
> both gdb/xtensa-regmap.c and gdb/xtensa-xtregs.c as
> identical files, perhaps for historical reasons.
> > On 7/8/13 1:54 AM, Baruch Siach wrote:
> > > Hi Chris, all,
> > >
> > > On Sun, Jul 07, 2013 at 08:12:52AM +0300, Baruch Siach wrote:
> > >> Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> > >> ---
> > >>
> > >> This should apply on top of
> > git://git.linux-xtensa.org/git/dev/crosstool-NG
> > >>
> > >>   scripts/build/debug/300-gdb.sh | 4 ++++
> > >>   1 file changed, 4 insertions(+)
> > >>
> > >> diff --git a/scripts/build/debug/300-gdb.sh
> > b/scripts/build/debug/300-gdb.sh
> > >> index 6c76334..fc2b8c1 100644
> > >> --- a/scripts/build/debug/300-gdb.sh
> > >> +++ b/scripts/build/debug/300-gdb.sh
> > >> @@ -93,6 +93,10 @@ do_debug_gdb_extract() {
> > >>           CT_Extract "expat-${CT_DEBUG_GDB_EXPAT_VERSION}"
> > >>           CT_Patch "expat" "${CT_DEBUG_GDB_EXPAT_VERSION}"
> > >>       fi
> > >> +
> > >> +    if [ -n "${CT_ARCH_XTENSA_CUSTOM_OVERLAY_FILE}" ]; then
> > >> +        CT_ConfigureXtensa "gdb" "${CT_GDB_VERSION}"
> > >> +    fi
> > > The overlay archive contains gdb/gdbserver/xtensa-regmap.c. However
> > > linux-xtensa-low.c #includes xtensa-xtregs.c. This causes a
> > mismatch in
> > > XTENSA_ELF_XTREG_SIZE, segfaulting gdbserver as ptrace
> > (PTRACE_GETXTREGS)
> > > overflows the userspace buffer. The fix for this is to
> > rename xtensa-regmap.c
> > > to xtensa-xtregs.c, thus overwriting the original source file.

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the linux-xtensa mailing list