aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-05-28 15:47:53 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-05-28 15:47:53 -0400
commit989ade05525047fc6b94f24ece5fc09e076027b0 (patch)
tree572f397400e3008548b24603eeaebc15cc5ce594
parentc47bae859a5af0d95224d90000df0e529f7c5aa0 (diff)
downloadgdb-989ade05525047fc6b94f24ece5fc09e076027b0.zip
gdb-989ade05525047fc6b94f24ece5fc09e076027b0.tar.gz
gdb-989ade05525047fc6b94f24ece5fc09e076027b0.tar.bz2
gdb: add comment in dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value
Add a comment to clarify why we temporarily override some of the context's fields, and especially the per_objfile field. A longer explanation can be found in this previous commit 44486dcf19b ("gdb: use caller objfile in dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value") gdb/ChangeLog: * dwarf2/loc.c (class dwarf_evaluate_loc_desc) <push_dwarf_reg_entry_value>: Add comment. Change-Id: I60c6e1062799f729b30a9db78bcb6448783324b4
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2/loc.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf46c4e..44300d2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-28 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * dwarf2/loc.c (class dwarf_evaluate_loc_desc)
+ <push_dwarf_reg_entry_value>: Add comment.
+
2020-05-28 Kevin Buettner <kevinb@redhat.com>
Keith Seitz <keiths@redhat.com>
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 1aab1a4..400bb4d 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -731,6 +731,12 @@ public:
throw_error (NO_ENTRY_VALUE_ERROR,
_("Cannot resolve DW_AT_call_data_value"));
+ /* We are about to evaluate an expression in the context of the caller
+ of the current frame. This evaluation context may be different from
+ the current (callee's) context), so temporarily set the caller's context.
+
+ It is possible for the caller to be from a different objfile from the
+ callee if the call is made through a function pointer. */
scoped_restore save_frame = make_scoped_restore (&this->frame,
caller_frame);
scoped_restore save_per_cu = make_scoped_restore (&this->per_cu,