From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 5/9] Don't let property evaluation affect the current language
Date: Fri, 7 Oct 2022 12:01:16 -0600 [thread overview]
Message-ID: <20221007180120.1866772-6-tromey@adacore.com> (raw)
In-Reply-To: <20221007180120.1866772-1-tromey@adacore.com>
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.
---
gdb/dwarf2/loc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index ad45d57a654..3333bf438ff 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1647,6 +1647,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);
--
2.34.3
next prev parent reply other threads:[~2022-10-07 18:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 18:01 [PATCH 0/9] Fix "finish" with variably-sized types Tom Tromey
2022-10-07 18:01 ` [PATCH 1/9] Fix crash in amd64-tdep.c Tom Tromey
2022-10-07 18:01 ` [PATCH 2/9] Add new overload of gdbarch_return_value Tom Tromey
2022-10-07 18:01 ` [PATCH 3/9] Don't emit gdbarch_return_value Tom Tromey
2022-10-07 18:01 ` [PATCH 4/9] Introduce value_at_non_lval Tom Tromey
2022-10-07 18:01 ` Tom Tromey [this message]
2022-10-07 18:01 ` [PATCH 6/9] Convert selected architectures to gdbarch_return_value_as_value Tom Tromey
2022-10-07 18:01 ` [PATCH 7/9] Fix inferior calls with variably-sized return type Tom Tromey
2022-10-07 18:01 ` [PATCH 8/9] Use value_at_non_lval in get_call_return_value Tom Tromey
2022-10-07 18:01 ` [PATCH 9/9] Add test case for "finish" with variably-sized types Tom Tromey
2023-01-03 16:44 ` [PATCH 0/9] Fix " Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221007180120.1866772-6-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).