From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31450 invoked by alias); 7 Dec 2012 16:15:16 -0000 Received: (qmail 31438 invoked by uid 22791); 7 Dec 2012 16:15:15 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_GD X-Spam-Check-By: sourceware.org Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Dec 2012 16:15:09 +0000 Received: by mail-pb0-f41.google.com with SMTP id xa7so471987pbc.0 for ; Fri, 07 Dec 2012 08:15:08 -0800 (PST) Received: by 10.68.232.201 with SMTP id tq9mr17167845pbc.12.1354896908803; Fri, 07 Dec 2012 08:15:08 -0800 (PST) Received: from [192.168.1.128] ([115.193.12.169]) by mx.google.com with ESMTPS id t10sm6830914paz.5.2012.12.07.08.15.00 (version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 08:15:07 -0800 (PST) Message-ID: <50C21696.7040006@gmail.com> Date: Fri, 07 Dec 2012 16:15:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0a1 MIME-Version: 1.0 Newsgroups: gmane.comp.gdb.patches To: Pierre Muller CC: 'Joel Brobecker' , 'Eli Zaretskii' , gdb-patches@sourceware.org Subject: Re: [RFC-v5] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) 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> In-Reply-To: <29545.4593528577$1354894901@news.gmane.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/msg00185.txt.bz2 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="-gdwarf-2 -O0" > > After that, you should get optimized out variables... I will did this if I have more time. > > I also installed CodeBlocks to test if I can reproduce your crash, > but I never got any ... The codeblocks.exe was built myself, which has debug information in it. > > 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) == 0) >> return i; > to confirm that the problem originates here? > 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 = 0; i < nb_sections; i++) if (section_name && (§ions[i]) && sections[i].section_name) if (strcmp (sections[i].section_name, section_name) == 0) return i; return PE_SECTION_INDEX_INVALID; } But still the same crash in strcmp(). Yuanhui Zhang