aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-05-03 11:28:22 -0600
committerTom Tromey <tom@tromey.com>2025-05-06 14:58:56 -0600
commit1edb555c59cea300eb4ed9fec7cb86790acc2234 (patch)
tree031c9d1d005221798f1f8a4851fe2d7b004ba615 /gdb
parent5479d3d404191f4f780e44ed9006eb2ff9a835fe (diff)
downloadbinutils-1edb555c59cea300eb4ed9fec7cb86790acc2234.zip
binutils-1edb555c59cea300eb4ed9fec7cb86790acc2234.tar.gz
binutils-1edb555c59cea300eb4ed9fec7cb86790acc2234.tar.bz2
Do not set yydebug in cp-name-parser.y
This reverts the change to cp-name-parser.y, avoiding a TSan report. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/cp-name-parser.y8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index e7317b7..d4ab98c 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -2047,9 +2047,11 @@ cp_demangled_name_to_comp (const char *demangled_name,
auto result = std::make_unique<demangle_parse_info> ();
cpname_state state (demangled_name, result.get ());
- scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
- parser_debug);
-
+ /* Note that we can't set yydebug here, as is done in the other
+ parsers. Bison implements yydebug as a global, even with a pure
+ parser, and this parser is run from worker threads. So, changing
+ yydebug causes TSan reports. If you need to debug this parser,
+ debug gdb and set the global from the outer gdb. */
if (yyparse (&state))
{
if (state.global_errmsg && errmsg)