aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-07-22 12:28:33 -0600
committerTom Tromey <tromey@adacore.com>2020-07-22 12:28:33 -0600
commit32fa152e3bfcf021ce49767be547fae5129d922b (patch)
tree23436ea92981455106cfe719460d2bd0674a67df /gdb/mi
parent8c419a91d761989b824d1bbe3b4575068317181e (diff)
downloadgdb-32fa152e3bfcf021ce49767be547fae5129d922b.zip
gdb-32fa152e3bfcf021ce49767be547fae5129d922b.tar.gz
gdb-32fa152e3bfcf021ce49767be547fae5129d922b.tar.bz2
Fix crash in -stack-list-arguments
-stack-list-arguments will crash when stopped in an Ada procedure that has an argument with a certain name ("_objectO" -- which can only be generated by the compiler). The bug occurs because lookup_symbol will fail in this case. This patch changes -stack-list-arguments to mirror what is done with arguments elsewhere. (As an aside, I don't understand why this lookup is even needed, but I assume it is some stabs thing?) In the longer term I think it would be good to share this code between MI and the CLI. However, due to the upcoming release, I preferred a more local fix. gdb/ChangeLog 2020-07-22 Tom Tromey <tromey@adacore.com> * mi/mi-cmd-stack.c (list_args_or_locals): Use lookup_symbol_search_name. gdb/testsuite/ChangeLog 2020-07-22 Tom Tromey <tromey@adacore.com> * gdb.ada/mi_prot.exp: New file. * gdb.ada/mi_prot/pkg.adb: New file. * gdb.ada/mi_prot/pkg.ads: New file. * gdb.ada/mi_prot/prot.adb: New file.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-stack.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index ef09109..a8ef46d 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -634,9 +634,8 @@ list_args_or_locals (const frame_print_options &fp_opts,
struct frame_arg arg, entryarg;
if (SYMBOL_IS_ARGUMENT (sym))
- sym2 = lookup_symbol (sym->linkage_name (),
- block, VAR_DOMAIN,
- NULL).symbol;
+ sym2 = lookup_symbol_search_name (sym->search_name (),
+ block, VAR_DOMAIN).symbol;
else
sym2 = sym;
gdb_assert (sym2 != NULL);