aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-09-15 12:06:02 -0600
committerTom Tromey <tromey@adacore.com>2023-01-03 08:45:01 -0700
commit12bb802fab16b5bf8edc027c247741bd75db1257 (patch)
tree84137329f4f0b22c6de684da7a3e27ef2fefcecf /gdb
parent7f22044a6b7ce968aacd8b26f608370940ec158d (diff)
downloadgdb-12bb802fab16b5bf8edc027c247741bd75db1257.zip
gdb-12bb802fab16b5bf8edc027c247741bd75db1257.tar.gz
gdb-12bb802fab16b5bf8edc027c247741bd75db1257.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/loc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 0acc638..fe91d60 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);