]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix Windows regression
authorTom Tromey <tromey@adacore.com>
Fri, 16 Aug 2024 17:43:33 +0000 (11:43 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 20 Aug 2024 14:31:35 +0000 (08:31 -0600)
commit cb9f919f ("gdb: add program_space parameter to
lookup_minimal_symbol_text") caused a crash on Windows.  In this
function, section can be nullptr, but it is unconditionally
dereferenced by the change introduced by the patch.

I tested this using the AdaCore internal test suite.

v2: always use current_program_space, reverting to be behavior before
cb9f919f.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/symtab.c

index 9b3562eeb303bb91b8fc4ee1dc74832b301c03a9..ce5e2520bd174aa4a7e3a52b5b2eefa36815575d 100644 (file)
@@ -3174,7 +3174,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
     if (msymbol.minsym->type () == mst_solib_trampoline)
       {
        bound_minimal_symbol mfunsym
-         = lookup_minimal_symbol_text (section->objfile->pspace (),
+         = lookup_minimal_symbol_text (current_program_space,
                                        msymbol.minsym->linkage_name (),
                                        nullptr);