summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-12-09 11:45:41 +0100
committerMark Wielaard <mjw@redhat.com>2015-01-23 17:29:19 +0100
commit743649fd80776de922475362bf3ac8b44511bb24 (patch)
treebb0e90750f05a5d2840cbfca16aab939b703b283 /include
parent198297aafb4f7a9717be8370581b048ae9107c14 (diff)
downloadbinutils-gdb-743649fd80776de922475362bf3ac8b44511bb24.tar.gz
Use GCC5/DWARF5 DW_AT_noreturn to mark functions that don't return normally.
Add a flag field is_noreturn to struct func_type. Make calling_convention a small bit field to not increase the size of the struct. Set is_noreturn if the new GCC5/DWARF5 DW_AT_noreturn is set on a DW_TAG_subprogram. Use this information to warn the user before doing a finish or return from a function that does not return normally to its caller. (gdb) finish warning: Function endless does not return normally. Try to finish anyway? (y or n) (gdb) return warning: Function does not return normally to caller. Make endless return now? (y or n) gdb/ChangeLog * dwarf2read.c (read_subroutine_type): Set TYPE_NO_RETURN from DW_AT_noreturn. * gdbtypes.h (struct func_type): Add is_noreturn field flag. Make calling_convention an 8 bit bit field. (TYPE_NO_RETURN): New macro. * infcmd.c (finish_command): Query if function does not return normally. * stack.c (return_command): Likewise. gdb/testsuite/ChangeLog * gdb.base/noreturn-return.c: New file. * gdb.base/noreturn-return.exp: New file. * gdb.base/noreturn-finish.c: New file. * gdb.base/noreturn-finish.exp: New file. include/ChangeLog * dwarf2.def (DW_AT_noreturn): New DWARF5 attribute. The dwarf2.h addition and the code to emit the new attribute is already in the gcc tree.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/dwarf2.def2
2 files changed, 6 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 31f1e18093e..21b6ae6a0fe 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-15 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf2.def (DW_AT_noreturn): New DWARF5 attribute.
+
2015-01-14 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* libiberty.h: Merge from GCC.
diff --git a/include/dwarf2.def b/include/dwarf2.def
index 5da3ae0e449..3aecdfcfff7 100644
--- a/include/dwarf2.def
+++ b/include/dwarf2.def
@@ -306,6 +306,8 @@ DW_AT (DW_AT_data_bit_offset, 0x6b)
DW_AT (DW_AT_const_expr, 0x6c)
DW_AT (DW_AT_enum_class, 0x6d)
DW_AT (DW_AT_linkage_name, 0x6e)
+/* DWARF 5. */
+DW_AT (DW_AT_noreturn, 0x87)
DW_AT_DUP (DW_AT_lo_user, 0x2000) /* Implementation-defined range start. */
DW_AT_DUP (DW_AT_hi_user, 0x3fff) /* Implementation-defined range end. */