This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFC] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Eli Zaretskii'" <eliz at gnu dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 6 Nov 2012 14:54:48 +0100
- Subject: RE: [RFC] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- 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>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé?: samedi 3 novembre 2012 11:36
> À?: pierre.muller@ics-cnrs.unistra.fr
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: [RFC] Fix .text section offset for windows DLL (was Calling
> __stdcall functions in the inferior)
>
> > Date: Mon, 15 Oct 2012 19:23:13 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: gdb-patches@sourceware.org
> >
> > > From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> > > 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 = 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.
>
> Sorry for the long delay.
>
> 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
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