Check for null result from gdb_demangle
I am sending this patch on behalf of kmoy@google.com, who discovered the bug
and wrote the fix.
gdb_demangle can return null for strings that don't properly demangle. The null
check was mistakenly removed in commit 43816ebc33
. Without this check, GDB
aborts when loading symbols from some binaries.
gdb/ChangeLog
2020-02-21 Ali Tamur <tamur@google.com>
* dwarf2/read.c (dwarf2_name): Add null check.
This commit is contained in:
parent
a4425a57c7
commit
4f180d5396
@ -1,3 +1,7 @@
|
||||
2020-02-21 Ali Tamur <tamur@google.com>
|
||||
|
||||
* dwarf2/read.c (dwarf2_name): Add null check.
|
||||
|
||||
2020-02-20 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* dwarf2/read.c (dwarf2_find_containing_comp_unit): Use ">", not
|
||||
|
@ -21756,6 +21756,8 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
gdb::unique_xmalloc_ptr<char> demangled
|
||||
(gdb_demangle (DW_STRING (attr), DMGL_TYPES));
|
||||
if (demangled == nullptr)
|
||||
return nullptr;
|
||||
|
||||
const char *base;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user