From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14451 invoked by alias); 20 Sep 2017 11:40:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14261 invoked by uid 89); 20 Sep 2017 11:40:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1638 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Sep 2017 11:40:57 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FF4E7EA8F; Wed, 20 Sep 2017 11:40:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FF4E7EA8F 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@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A113B60BE2; Wed, 20 Sep 2017 11:40:55 +0000 (UTC) Subject: Re: [PATCH] gdbserver x86 on win32: call init_target_desc To: Simon Marchi , gdb-patches@sourceware.org References: <1505892323-14964-1-git-send-email-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: <29769ae5-5411-3b52-71da-b488e7789dd4@redhat.com> Date: Wed, 20 Sep 2017 11:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1505892323-14964-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00482.txt.bz2 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