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
abbrev-cache.h
abbrev.c
abbrev.h
ada-imported.c
aranges.c
aranges.h
attribute.c
attribute.h
call-site.h
comp-unit-head.c
comp-unit-head.h
cooked-index.c
cooked-index.h
cu.c
cu.h
die.c
die.h
dwz.c
dwz.h
error.h
expr.c
expr.h
file-and-dir.h
frame-tailcall.c
frame-tailcall.h
frame.c
frame.h
index-cache.c
index-cache.h
index-common.c
index-common.h
index-write.c
index-write.h
leb.c
leb.h
line-header.c
line-header.h
loc.c Wrap help strings at 80 columns 2024-11-11 07:44:27 -07:00
loc.h
macro.c
macro.h
mapped-index.h
parent-map.h
public.h
read-debug-names.c
read-debug-names.h
read-gdb-index.c
read-gdb-index.h
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
sect-names.h
section.c
section.h
stringify.c
stringify.h
tag.h
types.h