* Avoid decode_objc clobbering current language
@ 2008-05-21 19:38 Andreas Schwab
2008-05-24 8:18 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2008-05-21 19:38 UTC (permalink / raw)
To: gdb-patches
This fixes the failure in gdb.ada/frame_args.exp:
(gdb) break break_me
Breakpoint 1 at 0x10001170: file /cvs/gdb/gdb/testsuite/gdb.ada/frame_args/pck.adb, line 21.
(gdb) run
Starting program: /sykes/cvs/test/ppc/gdb/gdb/testsuite/gdb.ada/frame_args/foo
Error in re-setting breakpoint 1: Function "break_me" not defined.
Program exited normally.
(gdb) FAIL: gdb.ada/frame_args.exp: running to break_me in runto
The problem is that sal_decode_line_1 (here called from
breakpoint_re_set_one) calls decode_objc, which indirectly calls
get_selected_frame. Since the program is just being started there is no
selected frame yet, thus get_selected_frame called select_frame, which
re-sets current_language (typically to language_c). Thus the
set_language call in breakpoint_re_set_one is useless.
Andreas.
2008-05-21 Andreas Schwab <schwab@suse.de>
* linespec.c (decode_objc): Save current language around call to
get_selected_block.
--- gdb/linespec.c.~1.79.~ 2008-05-20 10:58:04.000000000 +0200
+++ gdb/linespec.c 2008-05-21 18:17:04.000000000 +0200
@@ -1116,8 +1116,16 @@ decode_objc (char **argptr, int funfirst
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)
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Avoid decode_objc clobbering current language
2008-05-21 19:38 Avoid decode_objc clobbering current language Andreas Schwab
@ 2008-05-24 8:18 ` Joel Brobecker
2008-05-26 15:48 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2008-05-24 8:18 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
Hi Andreas,
> The problem is that sal_decode_line_1 (here called from
> breakpoint_re_set_one) calls decode_objc, which indirectly calls
> get_selected_frame. Since the program is just being started there is no
> selected frame yet, thus get_selected_frame called select_frame, which
> re-sets current_language (typically to language_c). Thus the
> set_language call in breakpoint_re_set_one is useless.
This is an issue that I'm planning to address properly. I had some plans
earlier this year to do it, but then decided to think about it some more.
Basically, the idea is to reduce the use of the current_language to
the minimum, which is use it as the context when the user enters a
command.
It's one of the things that I want to get done around July to September.
> 2008-05-21 Andreas Schwab <schwab@suse.de>
>
> * linespec.c (decode_objc): Save current language around call to
> get_selected_block.
In the meantime, I think that this is reasonable. Eventually when
the change mentioned above gets under way, I will remove your change.
I feel confident that it will not be missed, because I will have to
review all the uses of current_language anyway. I hope I'm not missing
something!
So, if you confirm that this caused no regression, please go ahead and
commit.
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Avoid decode_objc clobbering current language
2008-05-24 8:18 ` Joel Brobecker
@ 2008-05-26 15:48 ` Andreas Schwab
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2008-05-26 15:48 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker <brobecker@adacore.com> writes:
> So, if you confirm that this caused no regression, please go ahead and
> commit.
I had tested it on powerpc-linux.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-23 23:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-21 19:38 Avoid decode_objc clobbering current language Andreas Schwab
2008-05-24 8:18 ` Joel Brobecker
2008-05-26 15:48 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox