Skip to content

Commit 074128b

Browse files
committed
Now lists dwarf_lname_version.c
modified: src/lib/libdwarf/CMakeLists.txt modified: src/lib/libdwarf/Makefile.am Deleted the code for DW_LNAME stuff, it is now in dwarf_lname_version.c as generated code. modified: src/lib/libdwarf/dwarf_query.c Added dwarf_lname_version.c modified: src/lib/libdwarf/meson.build The test code now looks in dwarf_lname_version.c in libdwarf to check its LNAME items in the switch. modified: test/test_lname.c
1 parent eaec188 commit 074128b

File tree

5 files changed

+4
-116
lines changed

5 files changed

+4
-116
lines changed

src/lib/libdwarf/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dwarf_line.c dwarf_loc.c
2020
dwarf_loclists.c
2121
dwarf_locationop_read.c
2222
dwarf_local_malloc.c
23+
dwarf_lname_version.c
2324
dwarf_lvn_name.c
2425
dwarf_machoread.c dwarf_64machoread.c dwarf_macro.c dwarf_macro5.c
2526
dwarf_memcpy_swap.c

src/lib/libdwarf/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ dwarf_leb.c \
6464
dwarf_line.c \
6565
dwarf_line.h \
6666
dwarf_line_table_reader_common.h \
67+
dwarf_lname_version.c \
6768
dwarf_loc.c \
6869
dwarf_loc.h \
6970
dwarf_loclists.h \

src/lib/libdwarf/dwarf_query.c

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,121 +2302,6 @@ dwarf_machine_architecture(Dwarf_Debug dbg,
23022302
dw_ub_offset, dw_ub_count,
23032303
dw_ub_index, dw_comdat_groupnumber);
23042304
}
2305-
/*
2306-
2307-
DWARF6 DW_LNAME values are referenced
2308-
by using dwarf_language_version_data()
2309-
(these are permitted in DWARF5, see
2310-
www.dwarfstd.org )
2311-
2312-
For DWARF5 DW_LANG values, call dwarf_srclang()
2313-
instead.
2314-
2315-
*/
2316-
2317-
int dwarf_language_version_data(
2318-
Dwarf_Unsigned dw_lang_name,
2319-
int *dw_default_lower_bound,
2320-
const char **dw_version_scheme)
2321-
{
2322-
const char *lname = 0;
2323-
int res = 0;
2324-
unsigned int ui = 0;
2325-
unsigned int unreasonable_name = 65535;
2326-
2327-
if (dw_lang_name >= unreasonable_name) {
2328-
/* Want to deal with improper code calling here,
2329-
not just trim off upper bits in the cast. */
2330-
return DW_DLV_NO_ENTRY;
2331-
}
2332-
ui = (unsigned int)dw_lang_name;
2333-
res = dwarf_get_LNAME_name(ui,&lname);
2334-
if (res == DW_DLV_NO_ENTRY) {
2335-
return res;
2336-
}
2337-
switch(dw_lang_name) {
2338-
case DW_LNAME_Ada:
2339-
case DW_LNAME_Cobol:
2340-
case DW_LNAME_Fortran:
2341-
case DW_LNAME_Pascal:
2342-
case DW_LNAME_Algol68:
2343-
*dw_default_lower_bound = 1;
2344-
*dw_version_scheme = "YYYY";
2345-
break;
2346-
case DW_LNAME_BLISS:
2347-
case DW_LNAME_Crystal:
2348-
case DW_LNAME_D :
2349-
case DW_LNAME_Dylan:
2350-
case DW_LNAME_Go :
2351-
case DW_LNAME_Haskell:
2352-
case DW_LNAME_Java:
2353-
case DW_LNAME_Kotlin:
2354-
case DW_LNAME_OCaml:
2355-
case DW_LNAME_OpenCL_C:
2356-
case DW_LNAME_Python:
2357-
case DW_LNAME_RenderScript:
2358-
case DW_LNAME_Rust:
2359-
case DW_LNAME_UPC:
2360-
case DW_LNAME_Zig:
2361-
case DW_LNAME_Assembly:
2362-
case DW_LNAME_C_sharp:
2363-
case DW_LNAME_Mojo:
2364-
case DW_LNAME_Hylo:
2365-
case DW_LNAME_HIP:
2366-
*dw_default_lower_bound = 0;
2367-
*dw_version_scheme = 0;
2368-
break;
2369-
case DW_LNAME_C:
2370-
case DW_LNAME_C_plus_plus:
2371-
case DW_LNAME_ObjC:
2372-
case DW_LNAME_ObjC_plus_plus:
2373-
case DW_LNAME_Move:
2374-
case DW_LNAME_Odin:
2375-
*dw_default_lower_bound = 0;
2376-
*dw_version_scheme = "YYYYMM";
2377-
break;
2378-
case DW_LNAME_Julia:
2379-
case DW_LNAME_Modula2:
2380-
case DW_LNAME_Modula3:
2381-
case DW_LNAME_PLI:
2382-
*dw_default_lower_bound = 1;
2383-
*dw_version_scheme = 0;
2384-
break;
2385-
case DW_LNAME_Swift:
2386-
case DW_LNAME_OpenCL_CPP:
2387-
case DW_LNAME_CPP_for_OpenCL:
2388-
*dw_default_lower_bound = 0;
2389-
*dw_version_scheme = "VVMM";
2390-
break;
2391-
case DW_LNAME_GLSL :
2392-
case DW_LNAME_GLSL_ES:
2393-
case DW_LNAME_Ruby:
2394-
case DW_LNAME_P4:
2395-
case DW_LNAME_Metal:
2396-
case DW_LNAME_V:
2397-
case DW_LNAME_Nim:
2398-
case DW_LNAME_Gleam:
2399-
*dw_default_lower_bound = 0;
2400-
*dw_version_scheme = "VVMMPP";
2401-
break;
2402-
case DW_LNAME_Erlang:
2403-
case DW_LNAME_Elixir:
2404-
*dw_default_lower_bound = 1;
2405-
*dw_version_scheme = "VVMMPP";
2406-
break;
2407-
case DW_LNAME_HLSL:
2408-
*dw_default_lower_bound = 0;
2409-
*dw_version_scheme = "YYYY";
2410-
break;
2411-
case DW_LNAME_SYCL:
2412-
*dw_default_lower_bound = 0;
2413-
*dw_version_scheme = "YYYYRR";
2414-
break;
2415-
default:
2416-
return DW_DLV_NO_ENTRY;
2417-
}
2418-
return DW_DLV_OK;
2419-
}
24202305
/* OBSOLETE NAME: Do not use dwarf_language_version_string(). */
24212306
int dwarf_language_version_string(
24222307
Dwarf_Unsigned dw_lang_name,

src/lib/libdwarf/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ libdwarf_src = [
3737
'dwarf_locationop_read.c',
3838
'dwarf_local_malloc.c',
3939
'dwarf_loclists.c',
40+
'dwarf_lname_version.c',
4041
'dwarf_lvn_name.c',
4142
'dwarf_machoread.c',
4243
'dwarf_64machoread.c',

test/test_lname.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ main(int argc, char **argv)
377377
char *path = 0;
378378
size_t len = 0;
379379
const char *libpath="/src/lib/libdwarf/dwarf.h";
380-
const char *srchdr="/src/lib/libdwarf/dwarf_query.c";
380+
const char *srchdr="/src/lib/libdwarf/dwarf_lname_version.c";
381381
int argn = 0;
382382

383383
if (argc > 1) {

0 commit comments

Comments
 (0)