GCC uses several GNU-specific constants (from the "user" ranges) for some attributes. This page describes them briefly.
DW_AT_calling_convention
Calling Convention Name |
Value |
DW_CC_GNU_renesas_sh |
0x40 |
DW_CC_GNU_borland_fastcall_i386 |
0x41 |
DW_CC_GNU_thiscall_i386 (proposed) |
0x42 |
Renesas calling convention
Borland "fastcall" calling convention
Microsoft 32-bit Windows "thiscall" calling convention
When targeting Windows, GCC (prior to 4.7.0) used a calling convention like cdecl for non-static member functions, i.e. with arguments pushed on the stack right-to-left, followed by the this pointer. Past GCC 4.7.0, behaviour was changed to be more like Microsoft's compiler -- arguments are still pushed in the same way, but the this pointer is passed in the %ecx register instead.
The DW_AT_calling_convention tag with the value DW_CC_GNU_thiscall_i386 can be used to unambiguously mark methods using the latter calling convention (i.e. as a child of the method's DW_TAG_subprogram node). A debugger can then correctly lay out arguments to such non-static member functions correctly if they are invoked interactively.