diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-23 09:43:49 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-03-23 10:18:15 -0600 |
commit | 9bb9b2f9d6d5aa90f579494d8407375a87a9ad0b (patch) | |
tree | decac06af2245024c51a76359d310f13212eaebb /gdb/linespec.c | |
parent | c90939d2d08caedf4f777112a1aafa0c69a9d1c1 (diff) | |
download | gdb-9bb9b2f9d6d5aa90f579494d8407375a87a9ad0b.zip gdb-9bb9b2f9d6d5aa90f579494d8407375a87a9ad0b.tar.gz gdb-9bb9b2f9d6d5aa90f579494d8407375a87a9ad0b.tar.bz2 |
Use scoped_restore_current_language in two places
I found a couple of spots that manually saved and restored the current
language. This patch changes them to use
scoped_restore_current_language.
Tested by the buildbot.
gdb/ChangeLog
2019-03-23 Tom Tromey <tom@tromey.com>
* linespec.c (get_current_search_block): Use
scoped_restore_current_language.
* symmisc.c (dump_symtab): Use scoped_restore_current_language.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r-- | gdb/linespec.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index e902b11..8e2ade0 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1190,16 +1190,10 @@ iterate_over_all_matching_symtabs static const struct block * get_current_search_block (void) { - const struct block *block; - enum language save_language; - /* get_selected_block can change the current language when there is no selected frame yet. */ - save_language = current_language->la_language; - block = get_selected_block (0); - set_language (save_language); - - return block; + scoped_restore_current_language save_language; + return get_selected_block (0); } /* Iterate over static and global blocks. */ |