[v2,1/2] dwarf_lang_to_enum_language: Map new DWARF5 constants

Message ID 20241209162531.657914-1-ahajkova@redhat.com
State New
Headers
Series [v2,1/2] dwarf_lang_to_enum_language: Map new DWARF5 constants |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Alexandra Hájková Dec. 9, 2024, 4:25 p.m. UTC
  Add new DWARF5 language codes to gdb/dwarf2/read.c where
they are converted to GDB language names. The codes
were added to include/dwarf.h by syncing with gcc, Ada language
codes were added to dwarf.h earlier.
---
v2: Add DW_LANG_C_plus_plus_17
 gdb/dwarf2/read.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Tom Tromey Dec. 9, 2024, 7:59 p.m. UTC | #1
>>>>> Alexandra Hájková <ahajkova@redhat.com> writes:

> Add new DWARF5 language codes to gdb/dwarf2/read.c where
> they are converted to GDB language names. The codes
> were added to include/dwarf.h by syncing with gcc, Ada language
> codes were added to dwarf.h earlier.

Thank you.  This is ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Andrew Burgess Dec. 10, 2024, 8:35 a.m. UTC | #2
Alexandra Hájková <ahajkova@redhat.com> writes:

> Add new DWARF5 language codes to gdb/dwarf2/read.c where
> they are converted to GDB language names. The codes
> were added to include/dwarf.h by syncing with gcc, Ada language
> codes were added to dwarf.h earlier.
> ---
> v2: Add DW_LANG_C_plus_plus_17
>  gdb/dwarf2/read.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Thanks for doing this.  This patch:

Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew

>
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 5a5e27f30a6..4fbc9566ef7 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -17937,6 +17937,8 @@ dwarf_lang_to_enum_language (unsigned int lang)
>      case DW_LANG_C89:
>      case DW_LANG_C99:
>      case DW_LANG_C11:
> +    case DW_LANG_C17:
> +    case DW_LANG_C23:
>      case DW_LANG_C:
>      case DW_LANG_UPC:
>        language = language_c;
> @@ -17945,6 +17947,9 @@ dwarf_lang_to_enum_language (unsigned int lang)
>      case DW_LANG_C_plus_plus:
>      case DW_LANG_C_plus_plus_11:
>      case DW_LANG_C_plus_plus_14:
> +    case DW_LANG_C_plus_plus_17:
> +    case DW_LANG_C_plus_plus_20:
> +    case DW_LANG_C_plus_plus_23:
>        language = language_cplus;
>        break;
>      case DW_LANG_D:
> @@ -17955,16 +17960,21 @@ dwarf_lang_to_enum_language (unsigned int lang)
>      case DW_LANG_Fortran95:
>      case DW_LANG_Fortran03:
>      case DW_LANG_Fortran08:
> +    case DW_LANG_Fortran18:
> +    case DW_LANG_Fortran23:
>        language = language_fortran;
>        break;
>      case DW_LANG_Go:
>        language = language_go;
>        break;
> +    case DW_LANG_Assembly:
>      case DW_LANG_Mips_Assembler:
>        language = language_asm;
>        break;
>      case DW_LANG_Ada83:
>      case DW_LANG_Ada95:
> +    case DW_LANG_Ada2005:
> +    case DW_LANG_Ada2012:
>        language = language_ada;
>        break;
>      case DW_LANG_Modula2:
> -- 
> 2.47.0
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 5a5e27f30a6..4fbc9566ef7 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17937,6 +17937,8 @@  dwarf_lang_to_enum_language (unsigned int lang)
     case DW_LANG_C89:
     case DW_LANG_C99:
     case DW_LANG_C11:
+    case DW_LANG_C17:
+    case DW_LANG_C23:
     case DW_LANG_C:
     case DW_LANG_UPC:
       language = language_c;
@@ -17945,6 +17947,9 @@  dwarf_lang_to_enum_language (unsigned int lang)
     case DW_LANG_C_plus_plus:
     case DW_LANG_C_plus_plus_11:
     case DW_LANG_C_plus_plus_14:
+    case DW_LANG_C_plus_plus_17:
+    case DW_LANG_C_plus_plus_20:
+    case DW_LANG_C_plus_plus_23:
       language = language_cplus;
       break;
     case DW_LANG_D:
@@ -17955,16 +17960,21 @@  dwarf_lang_to_enum_language (unsigned int lang)
     case DW_LANG_Fortran95:
     case DW_LANG_Fortran03:
     case DW_LANG_Fortran08:
+    case DW_LANG_Fortran18:
+    case DW_LANG_Fortran23:
       language = language_fortran;
       break;
     case DW_LANG_Go:
       language = language_go;
       break;
+    case DW_LANG_Assembly:
     case DW_LANG_Mips_Assembler:
       language = language_asm;
       break;
     case DW_LANG_Ada83:
     case DW_LANG_Ada95:
+    case DW_LANG_Ada2005:
+    case DW_LANG_Ada2012:
       language = language_ada;
       break;
     case DW_LANG_Modula2: