From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24769 invoked by alias); 6 Nov 2012 13:55:05 -0000 Received: (qmail 24753 invoked by uid 22791); 6 Nov 2012 13:55:04 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Nov 2012 13:54:56 +0000 Received: from md13.u-strasbg.fr (md13.u-strasbg.fr [130.79.200.248]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA6DsqKe083433 ; Tue, 6 Nov 2012 14:54:52 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms13.u-strasbg.fr [130.79.204.113]) by md13.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA6Dspdi022958 ; Tue, 6 Nov 2012 14:54:52 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA6DsoH4015560 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Tue, 6 Nov 2012 14:54:51 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" Cc: References: <83a9vs89r9.fsf@gnu.org> <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> <834nm07z0s.fsf@gnu.org> <5077FEB9.4030304@redhat.com> <83y5jb7rfe.fsf@gnu.org> <006001cdaada$00c81f00$02585d00$%muller@ics-cnrs.unistra.fr> <83obk34pku.fsf@gnu.org> <838vaj55yj.fsf@gnu.org> In-Reply-To: <838vaj55yj.fsf@gnu.org> Subject: RE: [RFC] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) Date: Tue, 06 Nov 2012 13:55:00 -0000 Message-ID: <001801cdbc26$4a0ce2b0$de26a810$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2012-11/txt/msg00109.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Eli Zaretskii > Envoy=E9=A0: samedi 3 novembre 2012 11:36 > =C0=A0: pierre.muller@ics-cnrs.unistra.fr > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFC] Fix .text section offset for windows DLL (was Calling > __stdcall functions in the inferior) >=20 > > Date: Mon, 15 Oct 2012 19:23:13 +0200 > > From: Eli Zaretskii > > Cc: gdb-patches@sourceware.org > > > > > From: "Pierre Muller" > > > Date: Mon, 15 Oct 2012 15:35:55 +0200 > > > > > > After some investigation, I noticed that > > > the minimal symbol GetLastError was offset by 0xf0000 > > > respective to the '_imp__GetLastError@0'. > > > > > > The patch attached allowed me to call > > > (gdb) call GetLastError () > > > And get a simple > > > $2 =3D 126 > > > (for instance, depending on when you do the call). > > > > Thanks. > > > > > Could someone please test the patch and > > > confirm that it does fix the problem? > > > > I will try that in a few days. >=20 > Sorry for the long delay. >=20 > I tried that now, but then I realized that the patch cannot be applied > to GDB 7.5, because it uses gdb_bfd.h stuff. I tried to work around > that by replacing the call to gdb_bfd_open_maybe_remote by > bfd_open_maybe_remote; that compiled, but when I tried to use the > resulting binary, it crashed in the marked assertion: Just try to completely remove the call to gdb_bfd_unref and it should work fine (at least to try it out, because it will probably leak some file handles=20 that way...) I will resubmit another patch version shortly and the same change should also allow it to be applied to 7.5 version. Pierre Muller