[RFA] Display all DWARF 5 language names

Message ID 20180405165440.7505-1-tom@tromey.com
State New
Headers show
Series
  • [RFA] Display all DWARF 5 language names
Related show

Commit Message

Tom Tromey April 5, 2018, 4:54 p.m.
I happened to notice that objdump was not printing "Rust" when showing
the DW_AT_language for a CU:

    <10>   DW_AT_language    : 28	(Unknown: 1c)

This patch adds all the new language constants from DWARF 5 to
binutils/dwarf.c.

2018-04-05  Tom Tromey  <tom@tromey.com>

	* dwarf.c (read_and_display_attr_value): Add missing DW_LANG
	constants from DWARF 5.
---
 binutils/ChangeLog |  5 +++++
 binutils/dwarf.c   | 10 ++++++++++
 2 files changed, 15 insertions(+)

-- 
2.13.6

Comments

Nick Clifton April 6, 2018, 8:21 a.m. | #1
Hi Tom,

> 	* dwarf.c (read_and_display_attr_value): Add missing DW_LANG

> 	constants from DWARF 5.


Approved - please apply.

Cheers
  Nick

Patch

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 1a97ff3cb9..5c52cadd7c 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@ 
+2018-04-05  Tom Tromey  <tom@tromey.com>
+
+	* dwarf.c (read_and_display_attr_value): Add missing DW_LANG
+	constants from DWARF 5.
+
 2018-04-05  Maciej W. Rozycki  <macro@mips.com>
 
 	* testsuite/binutils-all/strip-13.d: Also expect `unsupported
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 17896e6110..10b4e284ce 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2352,12 +2352,22 @@  read_and_display_attr_value (unsigned long           attribute,
 	  /* DWARF 4 values.  */
 	case DW_LANG_Python:		printf ("(Python)"); break;
 	  /* DWARF 5 values.  */
+	case DW_LANG_OpenCL:		printf ("(OpenCL)"); break;
 	case DW_LANG_Go:		printf ("(Go)"); break;
+	case DW_LANG_Modula3:		printf ("(Modula 3)"); break;
+	case DW_LANG_Haskell:		printf ("(Haskell)"); break;
+	case DW_LANG_C_plus_plus_03:	printf ("(C++03)"); break;
 	case DW_LANG_C_plus_plus_11:	printf ("(C++11)"); break;
+	case DW_LANG_OCaml:		printf ("(OCaml)"); break;
+	case DW_LANG_Rust:		printf ("(Rust)"); break;
 	case DW_LANG_C11:		printf ("(C11)"); break;
+	case DW_LANG_Swift:		printf ("(Swift)"); break;
+	case DW_LANG_Julia:		printf ("(Julia)"); break;
+	case DW_LANG_Dylan:		printf ("(Dylan)"); break;
 	case DW_LANG_C_plus_plus_14:	printf ("(C++14)"); break;
 	case DW_LANG_Fortran03:		printf ("(Fortran 03)"); break;
 	case DW_LANG_Fortran08:		printf ("(Fortran 08)"); break;
+	case DW_LANG_RenderScript:	printf ("(RenderScript)"); break;
 	  /* MIPS extension.  */
 	case DW_LANG_Mips_Assembler:	printf ("(MIPS assembler)"); break;
 	  /* UPC extension.  */