aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-07-08 11:45:55 -0600
committerTom Tromey <tromey@adacore.com>2021-08-02 10:48:29 -0600
commit9698f7141065f5eaea44a17331b3f29ae712a79e (patch)
tree1682e3ac88d8901feaab0815899c56f7b3e312dc /gdb/stack.c
parentba8694b650b60c29126fd958575ffa1ca4f6c415 (diff)
downloadgdb-9698f7141065f5eaea44a17331b3f29ae712a79e.zip
gdb-9698f7141065f5eaea44a17331b3f29ae712a79e.tar.gz
gdb-9698f7141065f5eaea44a17331b3f29ae712a79e.tar.bz2
Remove uses of fprintf_symbol_filtered
I believe that many calls to fprintf_symbol_filtered are incorrect. In particular, there are some that pass a symbol's print name, like: fprintf_symbol_filtered (gdb_stdout, sym->print_name (), current_language->la_language, DMGL_ANSI); fprintf_symbol_filtered uses the "demangle" global to decide whether or not to demangle -- but print_name does this as well. This can lead to double-demangling. Normally this could be innocuous, except I also plan to change Ada demangling in a way that causes this to fail.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index aa20018..516e4d4 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -427,17 +427,14 @@ print_frame_arg (const frame_print_options &fp_opts,
annotate_arg_emitter arg_emitter;
ui_out_emit_tuple tuple_emitter (uiout, NULL);
- fprintf_symbol_filtered (&stb, arg->sym->print_name (),
- arg->sym->language (), DMGL_PARAMS | DMGL_ANSI);
+ fputs_filtered (arg->sym->print_name (), &stb);
if (arg->entry_kind == print_entry_values_compact)
{
/* It is OK to provide invalid MI-like stream as with
PRINT_ENTRY_VALUE_COMPACT we never use MI. */
stb.puts ("=");
- fprintf_symbol_filtered (&stb, arg->sym->print_name (),
- arg->sym->language (),
- DMGL_PARAMS | DMGL_ANSI);
+ fputs_filtered (arg->sym->print_name (), &stb);
}
if (arg->entry_kind == print_entry_values_only
|| arg->entry_kind == print_entry_values_compact)
@@ -1368,8 +1365,7 @@ print_frame (const frame_print_options &fp_opts,
annotate_frame_function_name ();
string_file stb;
- fprintf_symbol_filtered (&stb, funname ? funname.get () : "??",
- funlang, DMGL_ANSI);
+ fputs_filtered (funname ? funname.get () : "??", &stb);
uiout->field_stream ("func", stb, function_name_style.style ());
uiout->wrap_hint (" ");
annotate_frame_args ();
@@ -1564,8 +1560,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
if (funname)
{
printf_filtered (" in ");
- fprintf_symbol_filtered (gdb_stdout, funname, funlang,
- DMGL_ANSI | DMGL_PARAMS);
+ fputs_filtered (funname, gdb_stdout);
}
wrap_here (" ");
if (sal.symtab)