[Dwarf-Discuss] DW_LANG_C11

Mark Wielaard mjw@redhat.com
Mon Mar 31 22:06:53 GMT 2014


On Sun, 2014-03-30 at 21:06 +0200, Mark Wielaard wrote:
> At first I didn't file an enhancement request since there are probably
> no changes in how to interpret the meaning of DWARF attributes. But for
> debuggers it is needed information to be able to correctly handle
> expressions for the user related to the current CU since C11 did add
> some keywords and so allows some expressions that are not valid in
> earlier standards.

I also filed a proposal to add a DW_AT_noreturn attribute for
DW_TAG_subprogram to describe the new C11 (and available through an
attribute in the GNU toolchain) noreturn function specifier:

Subject:  C11 _Noreturn function specifier attribute DW_AT_noreturn
Name:  Mark Wielaard
Email:  mjw at redhat.com
Section:  3.3.1  Page:  55
Type:  Enhancement

C11 introduces the new keyword _Noreturn that can be used as function
specifier like inline. A function declared with a _Noreturn function
specifier shall not return to its caller (it causes undefined behavior
if it would). Similar functionality is available in the GNU Toolchain
through the noreturn function attribute. It is sometimes useful for a
debugger to know which functions can only be called, but shall never
return. Figure 2. Attribute names Add DW_AT_noreturn Specifies a
function that doesn't return to its caller. 3.3.1 General Subroutine and
Entry Point Information Add a paragraph at the end saying: A subprogram
entry may have a DW_AT_noreturn attribute, which is a flag. The
attribute indicates whether the subroutine was declared with the
"noreturn" keyword or property indicating that the function can be
called, but will never return to its caller. Figure 20. Attribute
encodings Add DW_AT_noreturn 0xXX flag. APPENDIX A ATTRIBUTES BY TAG
VALUE Add DW_AT_noreturn to DW_TAG_subprogram.





More information about the Dwarf-discuss mailing list