Message ID | 20140326132445.7568d2a2@octopus |
---|---|
State | New |
Headers | show |
>>>>> "Julian" == Julian Brown <julian@codesourcery.com> writes:
Julian> include/
Julian> * dwarf2.h (enum dwarf_calling_convention): Add
Julian> DW_CC_GNU_thiscall_i386.
We've been trying to ensure that all GNU DWARF extensions are
documented. In the past we had problems where an extension was added
and then, years later, its use was unclear.
The usual approach is some appropriate text somewhere on the GCC wiki
(though I suppose a note in the mail archives would do in a pinch) along
with a URL in a comment in the appropriate file (dwarf2.h or
dwarf2.def).
Could you please do that?
thanks,
Tom
On Wed, 26 Mar 2014 10:25:19 -0600 Tom Tromey <tromey@redhat.com> wrote: > >>>>> "Julian" == Julian Brown <julian@codesourcery.com> writes: > > Julian> include/ > Julian> * dwarf2.h (enum dwarf_calling_convention): Add > Julian> DW_CC_GNU_thiscall_i386. > > We've been trying to ensure that all GNU DWARF extensions are > documented. In the past we had problems where an extension was added > and then, years later, its use was unclear. > > The usual approach is some appropriate text somewhere on the GCC wiki > (though I suppose a note in the mail archives would do in a pinch) > along with a URL in a comment in the appropriate file (dwarf2.h or > dwarf2.def). > > Could you please do that? How's this, as a first attempt? http://gcc.gnu.org/wiki/GNUDwarfExtensions Thanks, Julian
On Thu, 27 Mar 2014 12:47:23 +0000 Julian Brown <julian@codesourcery.com> wrote: > On Wed, 26 Mar 2014 10:25:19 -0600 > Tom Tromey <tromey@redhat.com> wrote: > > > >>>>> "Julian" == Julian Brown <julian@codesourcery.com> writes: > > > > Julian> include/ > > Julian> * dwarf2.h (enum dwarf_calling_convention): Add > > Julian> DW_CC_GNU_thiscall_i386. > > > > We've been trying to ensure that all GNU DWARF extensions are > > documented. In the past we had problems where an extension was > > added and then, years later, its use was unclear. > > > > The usual approach is some appropriate text somewhere on the GCC > > wiki (though I suppose a note in the mail archives would do in a > > pinch) along with a URL in a comment in the appropriate file > > (dwarf2.h or dwarf2.def). > > > > Could you please do that? > > How's this, as a first attempt? > > http://gcc.gnu.org/wiki/GNUDwarfExtensions Ping? Julian
Tom> The usual approach is some appropriate text somewhere on the GCC wiki Tom> (though I suppose a note in the mail archives would do in a pinch) Tom> along with a URL in a comment in the appropriate file (dwarf2.h or Tom> dwarf2.def). Tom> Could you please do that? Julian> How's this, as a first attempt? Julian> http://gcc.gnu.org/wiki/GNUDwarfExtensions Sorry I didn't reply to this sooner. That page looks great. Thanks for doing this. Tom
On Wed, 7 May 2014 09:41:27 -0600 Tom Tromey <tromey@redhat.com> wrote: > Tom> The usual approach is some appropriate text somewhere on the GCC > Tom> wiki (though I suppose a note in the mail archives would do in a > Tom> pinch) along with a URL in a comment in the appropriate file > Tom> (dwarf2.h or dwarf2.def). > > Tom> Could you please do that? > > Julian> How's this, as a first attempt? > Julian> http://gcc.gnu.org/wiki/GNUDwarfExtensions > > Sorry I didn't reply to this sooner. > That page looks great. Thanks for doing this. Thanks! Now, does anyone want to review the patch itself? :-) Cheers, Julian
On Fri, 9 May 2014 17:33:41 +0100 Julian Brown <julian@codesourcery.com> wrote: > On Wed, 7 May 2014 09:41:27 -0600 > Tom Tromey <tromey@redhat.com> wrote: > > > Tom> The usual approach is some appropriate text somewhere on the > > Tom> GCC wiki (though I suppose a note in the mail archives would > > Tom> do in a pinch) along with a URL in a comment in the > > Tom> appropriate file (dwarf2.h or dwarf2.def). > > > > Tom> Could you please do that? > > > > Julian> How's this, as a first attempt? > > Julian> http://gcc.gnu.org/wiki/GNUDwarfExtensions > > > > Sorry I didn't reply to this sooner. > > That page looks great. Thanks for doing this. > > Thanks! Now, does anyone want to review the patch itself? :-) Ping? Julian
Index: include/dwarf2.h =================================================================== --- include/dwarf2.h (revision 208642) +++ include/dwarf2.h (working copy) @@ -182,6 +182,7 @@ enum dwarf_calling_convention DW_CC_GNU_renesas_sh = 0x40, DW_CC_GNU_borland_fastcall_i386 = 0x41, + DW_CC_GNU_thiscall_i386 = 0x42, /* This DW_CC_ value is not currently generated by any toolchain. It is used internally to GDB to indicate OpenCL C functions that have been Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 208642) +++ gcc/config/i386/i386.c (working copy) @@ -14155,6 +14155,21 @@ output_pic_addr_const (FILE *file, rtx x } } +/* Return Dwarf2 tag for calling convention to use for FUNCTION. */ + +static int +ix86_dwarf_calling_convention (const_tree function) +{ + unsigned int ccvt = ix86_get_callcvt (function); + + /* This is needed so that the debugger can reliably detect when to use the + "thiscall" calling convention to invoke inferior functions/methods. */ + if ((ccvt & IX86_CALLCVT_THISCALL) != 0) + return DW_CC_GNU_thiscall_i386; + + return DW_CC_normal; +} + /* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. We need to emit DTP-relative relocations. */ @@ -46984,6 +46999,9 @@ ix86_atomic_assign_expand_fenv (tree *ho #undef TARGET_C_MODE_FOR_SUFFIX #define TARGET_C_MODE_FOR_SUFFIX ix86_c_mode_for_suffix +#undef TARGET_DWARF_CALLING_CONVENTION +#define TARGET_DWARF_CALLING_CONVENTION ix86_dwarf_calling_convention + #ifdef HAVE_AS_TLS #undef TARGET_ASM_OUTPUT_DWARF_DTPREL #define TARGET_ASM_OUTPUT_DWARF_DTPREL i386_output_dwarf_dtprel