This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


  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.


Attachment: fix-dll-offset-v4.patch
Description: Binary data

Attachment: fix-dll-branch.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]