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

Baruch Siach baruch at tkos.co.il
Mon Jul 8 01:54:14 PDT 2013


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.

baruch

-- 
     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