diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cf46c4e92b..44300d258e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-05-28 Simon Marchi + + * dwarf2/loc.c (class dwarf_evaluate_loc_desc) + : Add comment. + 2020-05-28 Kevin Buettner Keith Seitz diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 1aab1a4f51..400bb4d16f 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,