This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix "thiscall" method calling convention for inferior calls (PR15559)
- From: Tom Tromey <tromey at redhat dot com>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 19 May 2014 08:50:35 -0600
- Subject: Re: [PATCH] Fix "thiscall" method calling convention for inferior calls (PR15559)
- Authentication-results: sourceware.org; auth=none
- References: <20140326132302 dot 09b6fc35 at octopus>
>>>>> "Julian" == Julian Brown <julian@codesourcery.com> writes:
Julian> This is an adaptation of the patch in PR15559 that handles calling
Julian> inferior methods (on win32/mingw32) using the "thiscall" calling
Julian> convention -- i.e. with the "this" pointer in the ecx register. Instead
Julian> of attempting to detect the GCC version used to compile a particular
Julian> function/method to determine the calling convention to use (which didn't
Julian> seem to work well for me), I've introduced a new GNU-specific Dwarf code
Julian> to represent the calling convention in question.
Thanks. I read through the patch and it all looks good to me.
Julian> include/
Julian> * dwarf2.h (enum dwarf_calling_convention): Add code for
Julian> DW_CC_GNU_thiscall_i386.
This has to be approved on the gcc side, but then it is fine to import.
Or you can wait for one of my more or less random mass imports.
Julian> gdb/
Julian> * dwarf2read.c (dwarf2_add_member_fn): Add calling convention
Julian> argument to smash_to_method_type call.
Julian> (quirk_gcc_member_function_pointer): Likewise.
Julian> (read_tag_ptr_to_member_type): Likewise.
Julian> (smash_to_method_type): Add CALLING_CONVENTION argument. Initialise
Julian> func-specific type for method types, and set the calling convention
Julian> as appropriate.
Julian> (init_type): Call INIT_FUNC_SPECIFIC for method types as well as
Julian> function types.
Julian> * gdbtypes.h (struct main_type): Adjust comment for FUNC_STUFF.
Julian> (struct func_type): Adjust comment.
Julian> * stabsread.c (read_type): Add dummy calling-convention argument to
Julian> smash_to_method_type call.
Julian> * i386-tdep.c (utils.h, infcall.h, dwarf2.h): Include files.
Julian> (i386_push_dummy_call): Handle "thiscall" calling convention.
This is ok contingent on the gcc patch.
Tom