[RFC-v3] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Thu Nov 8 09:54:00 GMT 2012


  This is an adapted patch after the change by Pedro
to always place defs.h as first include header.

  This is just for convenience as the previous patch probably would create
conflicts if applied to up-to-date CVS tree.

  For Eli, I also attached a second version 
called fix-dll-branch.patch
that applies to gdb_7_5-branch.

Comments welcome,

Pierre Muller



2012-11-08  Pierre Muller  <muller@sourceware.org>

        * coff-pe-read.h (pe_text_section_offset): Declare new function.
        * coff-pe-read.c (debug_coff_pe_read): New static variable.
        (struct read_pe_section_data): Add section_name field.
        (pe_as16): New function.
        (IMAGE_SCN_CNT_CODE): New macro, if not already defined.
        (IMAGE_SCN_CNT_INITIALIZED_DATA): Ditto.
        (IMAGE_SCN_CNT_UNINITIALIZED_DATA): Ditto.
        (add_pe_exported_sym): Handle unnamed exported function.
        (add_pe_forwarded_sym): New function.
        (read_pe_exported_syms): Use ordinal of function to
        retrieve correct RVA address of function and handle
        forwarded symbol.
        (pe_text_section_offset): New function.
        (show_debug_coff_pe_read): New function.
        (_initialize_coff_pe_read): New function adding
        'set/show debug coff_pe_read' commands.

        * windows-tdep.c (windows_xfer_shared_library): Use
        pe_text_section_offset function instead of possibly wrong
        0x1000 constant for .text sextion offset.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-dll-offset-v4.patch
Type: application/octet-stream
Size: 22029 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20121108/34a0739e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-dll-branch.patch
Type: application/octet-stream
Size: 22143 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20121108/34a0739e/attachment-0001.obj>


More information about the Gdb-patches mailing list