summaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-09-18 09:25:49 +0200
committerTom de Vries <tdevries@suse.de>2021-09-18 09:25:49 +0200
commit2c71f639a04fad36b5f7b255909ede09b63afdf9 (patch)
tree325ee9398313ad6a302f7e0986deabe21944579b /gdb/language.h
parent10c21d953d8b26f75e73d6fdba1320093c657b6c (diff)
downloadbinutils-gdb-2c71f639a04fad36b5f7b255909ede09b63afdf9.tar.gz
[gdb/ada] Handle artificial local symbols
With current master and gcc 7.5.0/8.5.0, we have this timeout: ... (gdb) print s^M Multiple matches for s^M [0] cancel^M [1] s at src/gdb/testsuite/gdb.ada/interface/foo.adb:20^M [2] s at src/gdb/testsuite/gdb.ada/interface/foo.adb:?^M > FAIL: gdb.ada/interface.exp: print s (timeout) ... [ The FAIL doesn't reproduce with gcc 9.3.1. This difference in behaviour bisects to gcc commit d70ba0c10de. The FAIL with earlier gcc bisects to gdb commit ba8694b650b. ] The FAIL is caused by gcc generating this debug info describing a named artificial variable: ... <2><1204>: Abbrev Number: 31 (DW_TAG_variable) <1205> DW_AT_name : s.14 <1209> DW_AT_type : <0x1213> <120d> DW_AT_artificial : 1 <120d> DW_AT_location : 5 byte block: 91 e0 7d 23 18 \ (DW_OP_fbreg: -288; DW_OP_plus_uconst: 24) ... An easy way to fix this would be to simply not put named artificial variables into the symbol table. However, that causes regressions for Ada. It relies on being able to get the value from such variables, using a named reference. Fix this instead by marking the symbol as artificial, and: - ignoring such symbols in ada_resolve_variable, which fixes the FAIL - ignoring such ada symbols in do_print_variable_and_value, which prevents them from showing up in "info locals" Note that a fix for the latter was submitted here ( https://sourceware.org/pipermail/gdb-patches/2008-January/054994.html ), and this patch borrows from it. Tested on x86_64-linux. Co-Authored-By: Joel Brobecker <brobecker@adacore.com> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28180
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 21ed47b3580..40d22d20559 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -327,6 +327,14 @@ struct language_defn
return {};
}
+ /* Return true if SYMBOL represents an entity that is not
+ supposed to be seen by the user. To be used to filter symbols
+ during printing. */
+ virtual bool symbol_printing_suppressed (struct symbol *symbol) const
+ {
+ return false;
+ }
+
/* The per-architecture (OS/ABI) language information. */
virtual void language_arch_info (struct gdbarch *,