public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Don't let property evaluation affect the current language
@ 2023-01-03 16:44 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-01-03 16:44 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=12bb802fab16b5bf8edc027c247741bd75db1257

commit 12bb802fab16b5bf8edc027c247741bd75db1257
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Sep 15 12:06:02 2022 -0600

    Don't let property evaluation affect the current language
    
    On PPC, we saw that calling an inferior function could sometimes
    change the current language, because gdb would select the call dummy
    frame -- associated with _start.
    
    This patch changes gdb so that the current language is never affected
    by DWARF property evaluation.

Diff:
---
 gdb/dwarf2/loc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 0acc63805e7..fe91d609f19 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1641,6 +1641,11 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
   if (prop == NULL)
     return false;
 
+  /* Evaluating a property should not change the current language.
+     Without this here this could happen if the code below selects a
+     frame.  */
+  scoped_restore_current_language save_language;
+
   if (frame == NULL && has_stack_frames ())
     frame = get_selected_frame (NULL);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-03 16:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 16:44 [binutils-gdb] Don't let property evaluation affect the current language Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).