From c4fc331b68cc8222e90fbdcc279b6d2bd915529c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 23 May 2008 23:39:03 +0000 Subject: [PATCH] * linespec.c (decode_objc): Save current language around call to get_selected_block. --- gdb/ChangeLog | 5 +++++ gdb/linespec.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ee7cb5658a5..11af398979c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-05-24 Andreas Schwab + + * linespec.c (decode_objc): Save current language around call to + get_selected_block. + 2008-05-23 Joel Brobecker * valprint.h (get_array_bounds): Renames get_array_low_bound. diff --git a/gdb/linespec.c b/gdb/linespec.c index 6386834ec0d..953e726bed5 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1116,8 +1116,16 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, if (file_symtab != NULL) block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), STATIC_BLOCK); else - block = get_selected_block (0); - + { + 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); + } + copy = find_imps (file_symtab, block, *argptr, NULL, &i1, &i2); if (i1 > 0) -- 2.30.2