binutils-gdb/gdb/dwarf2
Ijaz, Abdul B 9dc89f2b27 gdb: Update linkage name lookup function to allow mst_file_data/bss types.
From the commit 667ed4b14d onward, instead
of normal name GDB looks for the "jit_descriptor" linkage name in the JIT
code initialization.  Without this change, the function
"lookup_minimal_symbol_linkage", only matches the non-static data.  So in
case jit_debugger is static type then setting up breakpoint in the JIT code
fails.  Issue is seen for the intel compilers, where jit_debug_descriptor has
static type i.e. "mst_file_data".  Hence lookup_minimal_symbol_linkage returns
nullptr for it.  So, in this case breakpoint does not hit in the JIT code.
To resolve this, the commit introduces a new boolean argument to the
lookup_minimal_symbol_linkage function.  This argument allows the function to
also match mst_file_data and mst_file_bss types when set to true.  The
function is called with this new argument set to true only from JIT code
initialization handling, ensuring that the current behavior remains unchanged
for other cases.  Because handling of static types of data symbols for all cases
result in regression for "gdb.base/print-file-var.exp" test.

Example of minsym for the JIT code emitted by the intel compilers where
lookup_minimal_symbol_linkage fails without this change because jit_debugger
type is "mst_file_data".

(top-gdb) p *msymbol
$1 = {<general_symbol_info> =
{m_name = 0x7fffcc77dc95 "__jit_debug_descriptor",
m_value = {ivalue = 84325936, block = 0x506b630,
bytes = 0x506b630 <error: Cannot access memory at address 0x506b630>,
address = 0x506b630, unrel_addr = (unknown: 0x506b630),
common_block = 0x506b630, chain = 0x506b630},
language_specific = {obstack = 0x0, demangled_name = 0x0},
m_language = language_unknown, ada_mangled = 0, m_section = 29},
m_size = 24, filename = 0x55555a751b70 "JITLoaderGDB.cpp",
m_type = mst_file_data, created_by_gdb = 0,
m_target_flag_1 = 0, m_target_flag_2 = 0, m_has_size = 1,
name_set = 1, hash_next = 0x55555b86e4f0, demangled_hash_next = 0x0}

Updated the test "jit-elf-so.exp" to test the static type of jit_descriptor
object.

Approved-By: Tom Tromey <tom@tromey.com>
2024-11-17 02:02:11 +01:00
..
abbrev-cache.c gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
abbrev-cache.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
abbrev.c [gdb/symtab] Fix gdb.dwarf2/enum-type-c++.exp with cc-with-debug-types 2024-10-08 12:27:20 +02:00
abbrev.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
ada-imported.c gdb: add program_space parameter to lookup_minimal_symbol_linkage 2024-08-12 10:38:29 -04:00
aranges.c Remove gdb::hash_enum 2024-11-04 10:49:06 -07:00
aranges.h Remove addrmap_fixed::set_entry 2024-01-15 11:50:24 -07:00
attribute.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
attribute.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
call-site.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
comp-unit-head.c [gdb/symtab] Use DWARF_ERROR_PREFIX 2024-08-27 09:08:41 +02:00
comp-unit-head.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
cooked-index.c [gdb/build, c++20] Fix more deprecated implicit capture of this 2024-10-21 08:04:07 +02:00
cooked-index.h [gdb/symtab] Fix qualified name for cooked index dump 2024-10-18 00:15:57 +02:00
cu.c Use std::make_unique in more places 2024-10-20 10:13:05 -06:00
cu.h Don't obstack-allocate the call site hash table 2024-06-24 09:11:30 -06:00
die.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
die.h gdb: don't include hashtab.h in defs.h 2024-04-22 21:34:19 -04:00
dwz.c gdb: ensure has dwarf info before reading DWZ file 2024-04-03 13:47:03 +01:00
dwz.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
error.h [gdb/symtab] Change DWARF_ERROR from Dwarf Error to DWARF Error 2024-08-27 09:08:41 +02:00
expr.c gdb: Support DW_OP_constx (the standardized version of DW_OP_GNU_const_index). 2024-09-11 09:07:37 -06:00
expr.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
file-and-dir.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
frame-tailcall.c gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
frame-tailcall.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
frame.c [gdb] Fix common misspellings 2024-10-06 07:59:48 +02:00
frame.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
index-cache.c gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
index-cache.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
index-common.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
index-common.h gdb: don't include hashtab.h in defs.h 2024-04-22 21:34:19 -04:00
index-write.c [gdb/symtab] Handle multiple .debug_info sections 2024-10-29 10:08:04 +01:00
index-write.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
leb.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
leb.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
line-header.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
line-header.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
loc.c Wrap help strings at 80 columns 2024-11-11 07:44:27 -07:00
loc.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
macro.c [gdb/symtab] Emit malformed macro definition complaint once 2024-07-30 16:56:31 +02:00
macro.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
mapped-index.h gdb/dwarf2: cleanup includes 2024-08-30 13:57:11 -04:00
parent-map.h [gdb/symtab] Dump m_all_parents_map for verbose debug dwarf-read 2024-09-28 08:35:02 +02:00
public.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
read-debug-names.c [gdb/symtab] Handle multiple .debug_info sections 2024-10-29 10:08:04 +01:00
read-debug-names.h Export dwarf5_augmentation 2024-01-18 08:20:17 -07:00
read-gdb-index.c [gdb/symtab] Handle multiple .debug_info sections 2024-10-29 10:08:04 +01:00
read-gdb-index.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
read.c gdb: Update linkage name lookup function to allow mst_file_data/bss types. 2024-11-17 02:02:11 +01:00
read.h Remove gdb::hash_enum 2024-11-04 10:49:06 -07:00
sect-names.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
section.c [gdb/symtab] Use DWARF_ERROR_PREFIX 2024-08-27 09:08:41 +02:00
section.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
stringify.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
stringify.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
tag.h Ignore DW_TAG_padding in tag_is_type 2024-09-09 11:32:40 -06:00
types.h gdbsupport: constify some return values in print-utils.{h,cc} 2024-04-18 10:31:54 -04:00