public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: add comment in dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value
Date: Thu, 28 May 2020 19:49:34 +0000 (GMT)	[thread overview]
Message-ID: <20200528194934.EFE5E385DC1C@sourceware.org> (raw)

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

commit 989ade05525047fc6b94f24ece5fc09e076027b0
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Thu May 28 15:47:53 2020 -0400

    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

Diff:
---
 gdb/ChangeLog    | 5 +++++
 gdb/dwarf2/loc.c | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf46c4e92bd..44300d258ea 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 1aab1a4f51b..400bb4d16fc 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,


                 reply	other threads:[~2020-05-28 19:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200528194934.EFE5E385DC1C@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@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).