From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2872 invoked by alias); 7 Dec 2012 16:27:40 -0000 Received: (qmail 2828 invoked by uid 22791); 7 Dec 2012 16:27:28 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,MSGID_MULTIPLE_AT,TW_GD,TW_SM X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Dec 2012 16:27:22 +0000 Received: from md16.u-strasbg.fr (md16.u-strasbg.fr [130.79.200.206]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qB7GRFid092247 ; Fri, 7 Dec 2012 17:27:15 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms11.u-strasbg.fr [130.79.204.111]) by md16.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qB7GREqm008078 ; Fri, 7 Dec 2012 17:27:14 +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 qB7GREbX011320 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Fri, 7 Dec 2012 17:27:14 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'asmwarrior'" Cc: "'Joel Brobecker'" , "'Eli Zaretskii'" , References: <20121024194517.GK3555@adacore.com> <011901cdb2ab$48076b90$d81642b0$@muller@ics-cnrs.unistra.fr> <20121105171121.GA2972@adacore.com> <50991f5f.8382440a.1100.ffff82abSMTPIN_ADDED@mx.google.com> <509ABA17.30507@redhat.com> <000301cdbd96$f5cd9f10$e168dd30$@muller@ics-cnrs.unistra.fr> <20121122173019.GF9964@adacore.com> <15690.5992342674$1353883881@news.gmane.org> <87624si9ur.fsf@fleche.redhat.com> <001501cdccaf$ad85e9b0$0891bd10$@muller@ics-cnrs.unistra.fr> <20121207071035.GG31477@adacore.com> <50C20A66.70002@gmail.com> <29545.4593528577$1354894901@news.gmane.org> <50C21696.7040006@gmail.com> In-Reply-To: <50C21696.7040006@gmail.com> Subject: RE: [RFC-v5] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) Date: Fri, 07 Dec 2012 16:27:00 -0000 Message-ID: <000001cdd497$b721ac80$25650580$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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-12/txt/msg00187.txt.bz2 > -----Message d'origine----- > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de asmwarrior > Envoy=C3=A9 : vendredi 7 d=C3=A9cembre 2012 17:17 > =C3=80 : Pierre Muller > Cc : 'Joel Brobecker'; 'Eli Zaretskii'; gdb-patches@sourceware.org > Objet : Re: [RFC-v5] Fix .text section offset for windows DLL (was Calling > __stdcall functions in the inferior) >=20 > On 2012-12-7 23:40, Pierre Muller wrote: > > Hi Yuanhui, > > thanks for trying to debug this... > > > > First, concerning the optimized out problems, > > it would be easier if you would recompile > > GDB without optimization: > > > > make clean all CFLAGS=3D"-gdwarf-2 -O0" > > > > After that, you should get optimized out variables... >=20 > I will did this if I have more time. >=20 >=20 > > > > I also installed CodeBlocks to test if I can reproduce your crash, > > but I never got any ... >=20 > The codeblocks.exe was built myself, which has debug information in it. I tried to recompile the sources, but compilation fails on not found wxWorks headers... Despite the fact that I compiled wxWorks 2.9.4 without problems. > > > > Could it be that some weird DLL's have unnamed > > sections? > > Could you try to insert > > if (sections[i] && section[i].name) > > before > >> if (strcmp (sections[i].section_name, section_name) =3D=3D 0) > >> return i; > > to confirm that the problem originates here? > > >=20 > I add a line: > static int > get_pe_section_index (const char *section_name, > struct read_pe_section_data *sections, > int nb_sections) > { > int i; > for (i =3D 0; i < nb_sections; i++) > if (section_name && (§ions[i]) && sections[i].section_name) > if (strcmp (sections[i].section_name, section_name) =3D=3D 0) > return i; > return PE_SECTION_INDEX_INVALID; > } >=20 >=20 > But still the same crash in strcmp(). Could you try to check that section_name ansd sections array are valid... It will probably require that you recompile GDB :( At the crash point, try to go back to=20 get_pe_section_index frame and do (gdb) print section_name (gdb) print i ... (gdb) print *sections@nb_index This should print the whole array. The problem might also come from some memory corruption elsewhere in my c= ode... Thanks for helping, Pierre