diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-10-28 13:57:51 +0100 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-11-20 22:41:08 +0100 |
commit | 43d397ca8f097e8f0ab0c245afeaa22b8da7ac52 (patch) | |
tree | 1c183e3b8a15c44e9912cc319b56ab7480d4b679 /gdb/symtab.c | |
parent | 9e6a1ab6652e8461f786d5c308f632a7c0acc53f (diff) | |
download | gdb-43d397ca8f097e8f0ab0c245afeaa22b8da7ac52.zip gdb-43d397ca8f097e8f0ab0c245afeaa22b8da7ac52.tar.gz gdb-43d397ca8f097e8f0ab0c245afeaa22b8da7ac52.tar.bz2 |
Use scoped_switch_to_sym_language_if_auto in symtab.c to switch language.
Use scoped_switch_to_sym_language_if_auto in treg_matches_sym_type_name to
replace the local logic that was doing the same as the new class
scoped_switch_to_sym_language_if_auto.
Use scoped_switch_to_sym_language_if_auto inside print_symbol_info, so
that symbol information is printed in the symbol language when
language mode is auto.
This modifies the behaviour of the test dw2-case-insensitive.exp,
as the function FUNC_lang is now printed with the Fortran syntax
(as declared in the .S file).
gdb/ChangeLog
2018-11-20 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.c (treg_matches_sym_type_name): Use
scoped_switch_to_sym_language_if_auto instead of local logic.
(print_symbol_info): Use scoped_switch_to_sym_language_if_auto
to switch to SYM language when language mode is auto.
gdb/testsuite/ChangeLog
2018-11-20 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.dwarf2/dw2-case-insensitive.exp: Update due to auto switch to
FUNC_lang language syntax.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 7a77bcf..f8c755f 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4288,15 +4288,12 @@ treg_matches_sym_type_name (const compiled_regex &treg, if (sym_type == NULL) return false; - if (language_mode == language_mode_auto) - { - scoped_restore_current_language l; + { + scoped_switch_to_sym_language_if_auto l (sym); - set_language (SYMBOL_LANGUAGE (sym)); - printed_sym_type_name = type_to_string (sym_type); - } - else printed_sym_type_name = type_to_string (sym_type); + } + if (symbol_lookup_debug > 1) { @@ -4600,6 +4597,7 @@ print_symbol_info (enum search_domain kind, struct symbol *sym, int block, const char *last) { + scoped_switch_to_sym_language_if_auto l (sym); struct symtab *s = symbol_symtab (sym); if (last != NULL) |