public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Add value::set_modifiable Date: Mon, 13 Feb 2023 22:30:57 +0000 (GMT) [thread overview] Message-ID: <20230213223057.81B4D3858D35@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e6cf1e1b42c1e44610cc8b2997f883275f0b244d commit e6cf1e1b42c1e44610cc8b2997f883275f0b244d Author: Tom Tromey <tom@tromey.com> Date: Wed Feb 1 08:25:21 2023 -0700 Add value::set_modifiable This introduces a value::set_modifiable and changes a couple of spots to use it. I'm not completely sure the comments by deprecated_modifiable are correct any more. Perhaps they should be removed and the method renamed. Like so many before me, though, I've deferred investigation of the issue. Approved-By: Simon Marchi <simon.marchi@efficios.com> Diff: --- gdb/value.c | 4 ++-- gdb/value.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/value.c b/gdb/value.c index 1921aecdbc1..640053ddce5 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1680,7 +1680,7 @@ record_latest_value (struct value *val) /* We preserve VALUE_LVAL so that the user can find out where it was fetched from. This is a bit dubious, because then *&$1 does not just return $1 but the current contents of that location. c'est la vie... */ - val->m_modifiable = 0; + val->set_modifiable (0); value_history.push_back (release_value (val)); @@ -2173,7 +2173,7 @@ set_internalvar (struct internalvar *var, struct value *val) default: new_kind = INTERNALVAR_VALUE; struct value *copy = val->copy (); - copy->m_modifiable = 1; + copy->set_modifiable (1); /* Force the value to be fetched from the target now, to avoid problems later when this internalvar is referenced and the target is gone or diff --git a/gdb/value.h b/gdb/value.h index 7e232f378ed..f35bfc7206c 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -229,6 +229,10 @@ public: int deprecated_modifiable () const { return m_modifiable; } + /* Set or clear the modifiable flag. */ + void set_modifiable (int val) + { m_modifiable = val; } + LONGEST pointed_to_offset () const { return m_pointed_to_offset; }
reply other threads:[~2023-02-13 22:30 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=20230213223057.81B4D3858D35@sourceware.org \ --to=tromey@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: linkBe 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).