]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdw: Add Erlang, Elixir and Gleam language constants
authorMark Wielaard <mark@klomp.org>
Tue, 2 Dec 2025 14:41:23 +0000 (15:41 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 2 Dec 2025 14:41:33 +0000 (15:41 +0100)
The DWARF standard recently added language constants for Erlang,
Elixir and Gleam. https://dwarfstd.org/languages.html
https://dwarfstd.org/languages-v6.html

* libdw/dwarf.h: Add DW_LANG_Erlang, DW_LNAME_Erlang,
DW_LANG_Elixir, DW_LNAME_Elixir, DW_LANG_Gleam and
DW_LNAME_Gleam.
* libdw/dwarf_default_lower_bound.c
(dwarf_default_lower_bound): Add DW_LANG_Gleam, DW_LANG_Erlang
and DW_LANG_Elixir.
(dwarf_language_lower_bound): Add DW_LNAME_Gleam, DW_LNAME_Erlang
and DW_LNAME_Elixir.
* libdw/dwarf_srclang.c (srclang_to_language): Handle
DW_LANG_Erlang, DW_LANG_Elixir and DW_LANG_Gleam.
(language_to_srclang): Handle DW_LNAME_Erlang, DW_LNAME_Elixir
and Add DW_LNAME_Gleam.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/dwarf.h
libdw/dwarf_default_lower_bound.c
libdw/dwarf_srclang.c

index e1808096ca5fb4fc6829f1794c6374ce37a6a791..cc43727290cf91f34fdf33b57a09a36c5019b1cc 100644 (file)
@@ -778,6 +778,9 @@ enum
     DW_LANG_V = 0x0043,                     /* V Programming Language */
     DW_LANG_Algol68 = 0x0044,       /* Algol68 */
     DW_LANG_Nim = 0x0045,           /* Nim */
+    DW_LANG_Erlang = 0x0046,        /* Erlang */
+    DW_LANG_Elixir = 0x0047,        /* Elixir */
+    DW_LANG_Gleam = 0x0048,         /* Gleam */
 
     DW_LANG_lo_user = 0x8000,
     DW_LANG_Mips_Assembler = 0x8001, /* Assembler */
@@ -837,6 +840,9 @@ enum
     DW_LNAME_V = 0x002d,
     DW_LNAME_Algol68 = 0x002e,
     DW_LNAME_Nim = 0x002f,
+    DW_LNAME_Erlang = 0x0030,
+    DW_LNAME_Elixir = 0x0031,
+    DW_LNAME_Gleam = 0x0032,
 
     DW_LNAME_lo_user = 0x8000,
     DW_LNAME_hi_user = 0xffff
index 71a313fe577ce26d6216e68da8c22a6aa5ad1a42..a729ed1fc860a2561e8747a5ea16df67059c5945 100644 (file)
@@ -90,6 +90,7 @@ dwarf_default_lower_bound (int lang, Dwarf_Sword *result)
     case DW_LANG_Hylo:
     case DW_LANG_V:
     case DW_LANG_Nim:
+    case DW_LANG_Gleam:
       *result = 0;
       return 0;
 
@@ -112,6 +113,8 @@ dwarf_default_lower_bound (int lang, Dwarf_Sword *result)
     case DW_LANG_Ada2012:
     case DW_LANG_Fortran23:
     case DW_LANG_Algol68:
+    case DW_LANG_Erlang:
+    case DW_LANG_Elixir:
       *result = 1;
       return 0;
 
@@ -172,6 +175,7 @@ dwarf_language_lower_bound (Dwarf_Word lang, Dwarf_Sword *result)
     case DW_LNAME_Metal:
     case DW_LNAME_V:
     case DW_LNAME_Nim:
+    case DW_LNAME_Gleam:
       *result = 0;
       return 0;
 
@@ -184,6 +188,8 @@ dwarf_language_lower_bound (Dwarf_Word lang, Dwarf_Sword *result)
     case DW_LNAME_Pascal:
     case DW_LNAME_PLI:
     case DW_LNAME_Algol68:
+    case DW_LNAME_Erlang:
+    case DW_LNAME_Elixir:
       *result = 1;
       return 0;
 
index 10dfce8be3e3e8f459b106ad3deb6ed3a7634cc1..3df13757be67df7aa2806bfbe372041149755494 100644 (file)
@@ -315,6 +315,18 @@ static int srclang_to_language (Dwarf_Word srclang,
       *lname = DW_LNAME_Nim;
       *lversion = 0;
       return 0;
+    case DW_LANG_Erlang:
+      *lname = DW_LNAME_Erlang;
+      *lversion = 0;
+      return 0;
+    case DW_LANG_Elixir:
+      *lname = DW_LNAME_Elixir;
+      *lversion = 0;
+      return 0;
+    case DW_LANG_Gleam:
+      *lname = DW_LNAME_Gleam;
+      *lversion = 0;
+      return 0;
     default:
       __libdw_seterrno (DWARF_E_UNKNOWN_LANGUAGE);
       return -1;
@@ -513,6 +525,15 @@ language_to_srclang (Dwarf_Word lname, Dwarf_Word lversion, Dwarf_Word *value)
     case DW_LNAME_Nim:
       *value = DW_LANG_Nim;
       return 0;
+    case DW_LNAME_Erlang:
+      *value = DW_LANG_Erlang;
+      return 0;
+    case DW_LNAME_Elixir:
+      *value = DW_LANG_Elixir;
+      return 0;
+    case DW_LNAME_Gleam:
+      *value = DW_LANG_Gleam;
+      return 0;
     default:
       __libdw_seterrno (DWARF_E_UNKNOWN_LANGUAGE);
       return -1;