aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-08-14 11:22:58 -0600
committerTom Tromey <tromey@adacore.com>2024-08-15 10:14:37 -0600
commitd47600c85d26176cc7030da78f8cfc6e98bcfbbf (patch)
tree13954325667b4bd371453bed04c99decb1185d93 /gdb/symmisc.c
parent5c8f918639f1df77599c50fddfdfe23a2e3cbf35 (diff)
downloadbinutils-d47600c85d26176cc7030da78f8cfc6e98bcfbbf.zip
binutils-d47600c85d26176cc7030da78f8cfc6e98bcfbbf.tar.gz
binutils-d47600c85d26176cc7030da78f8cfc6e98bcfbbf.tar.bz2
Add another constructor to scoped_restore_current_language
While working on something else, I noticed that this is relatively common: scoped_restore_current_language save; set_language (something); This patch adds a second constructor to scoped_restore_current_language to simplify this idiom. Reviewed-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index b4e0360..7f81415 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -366,8 +366,7 @@ dump_symtab (struct symtab *symtab, struct ui_file *outfile)
But use only real languages, not placeholders. */
if (symtab->language () != language_unknown)
{
- scoped_restore_current_language save_lang;
- set_language (symtab->language ());
+ scoped_restore_current_language save_lang (symtab->language ());
dump_symtab_1 (symtab, outfile);
}
else