This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC-v5] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- From: asmwarrior <asmwarrior at gmail dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: 'Joel Brobecker' <brobecker at adacore dot com>, 'Eli Zaretskii' <eliz at gnu dot org>, gdb-patches at sourceware dot org
- Date: Sat, 08 Dec 2012 00:17:26 +0800
- Subject: Re: [RFC-v5] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- Newsgroups: gmane.comp.gdb.patches
- 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>
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