[PATCH] dwarf.c handle new DWARFv5 C11, C++11 and C++14 DW_LANG constants.

Mark Wielaard mjw@redhat.com
Mon Nov 24 20:29:00 GMT 2014


The following patch is needed to recognize the new DW_LANG constants
that GCC 5 might emit as implemented by this GCC patch:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02852.html

binutils/ChangeLog

	* dwarf.c (read_and_display_attr_value): Handle DW_LANG_C11,
	DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.

include/ChangeLog

	* dwarf2.h: Add DW_LANG_C_plus_plus_11, DW_LANG_C11 and
	DW_LANG_C_plus_plus_14.

OK to commit?

Thanks,

Mark

---
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 8213f4d..a0cc96d 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -1908,6 +1908,9 @@ read_and_display_attr_value (unsigned long attribute,
 	case DW_LANG_Python:		printf ("(Python)"); break;
 	  /* DWARF 5 values.  */
 	case DW_LANG_Go:		printf ("(Go)"); break;
+	case DW_LANG_C_plus_plus_11:	printf ("(C++11)"); break;
+	case DW_LANG_C11:		printf ("(ANSI C11)"); break;
+	case DW_LANG_C_plus_plus_14:	printf ("(C++14)"); break;
 	  /* MIPS extension.  */
 	case DW_LANG_Mips_Assembler:	printf ("(MIPS assembler)"); break;
 	  /* UPC extension.  */
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 120e2c1..ca440dd 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -309,6 +309,10 @@ enum dwarf_source_language
     /* DWARF 5.  */
     DW_LANG_Go = 0x0016,
 
+    DW_LANG_C_plus_plus_11 = 0x001a, /* dwarf5.20141029.pdf DRAFT */
+    DW_LANG_C11 = 0x001d,
+    DW_LANG_C_plus_plus_14 = 0x0021,
+
     DW_LANG_lo_user = 0x8000,	/* Implementation-defined range start.  */
     DW_LANG_hi_user = 0xffff,	/* Implementation-defined range start.  */
 
-- 
1.8.3.1



More information about the Binutils mailing list