This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdbserver x86 on win32: call init_target_desc
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 20 Sep 2017 12:40:54 +0100
- Subject: Re: [PATCH] gdbserver x86 on win32: call init_target_desc
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FF4E7EA8F
- References: <1505892323-14964-1-git-send-email-simon.marchi@ericsson.com>
On 09/20/2017 08:25 AM, Simon Marchi wrote:
> When trying to run gdbserver compiled for x86 win32 under wine, I get:
>
> $ wine ./gdbserver/gdbserver.exe --once :1234 ./test
> /home/emaisin/src/binutils-gdb/gdb/gdbserver/regcache.c:177: A problem internal to GDBserver has been detected.
> regcache* new_register_cache(const target_desc*): Assertion `tdesc->registers_size != 0' failed.
>
> It seems like on that platform, init_target_desc is never called, so
> registers_size is never computed.
>
> My first thought was to call init_target_desc somewhere in win32-low.c,
> but it turns out that when using win32 on arm, the target description is
> already initialized by the generated code. My second thought was to
> call it in {i386,amd64}_create_target_description, but those functions
> are shared with GDB, and init_target_desc is gdbserver-specific. So I
> ended up with the simplest fix, calling it in i386_arch_setup.
I assume that lynx-i386-low.c and nto-x86-low.c have the same problem?
$ grep create_target_description *.c
linux-x86-tdesc.c: *tdesc = i386_create_target_description (xcr0, true);
linux-x86-tdesc.c: *tdesc = amd64_create_target_description (xcr0, is_x32, true);
lynx-i386-low.c: lynx_tdesc = i386_create_target_description (X86_XSTATE_SSE_MASK, false);
nto-x86-low.c: nto_tdesc = i386_create_target_description (X86_XSTATE_SSE_MASK, false);
win32-i386-low.c: win32_tdesc = amd64_create_target_description (X86_XSTATE_SSE_MASK, false,
win32-i386-low.c: win32_tdesc = i386_create_target_description (X86_XSTATE_SSE_MASK, false);
Thanks,
Pedro Alves