Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>,
	Doug Evans <dje@google.com>,        <gdb-patches@sourceware.org>
Subject: Re: [RFC] Don't allow setting register in non-innermost frame
Date: Tue, 11 Sep 2012 17:12:00 -0000	[thread overview]
Message-ID: <87ehm8a3gg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <504D49DA.6070006@codesourcery.com> (Yao Qi's message of "Mon, 10	Sep 2012 10:00:58 +0800")

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> I checked the difference of value of register and value of variable
Yao> (saved in register), TYPE_OBJFILE_OWNED (value_type (toval)) is the
Yao> only difference between them.  IIUC, type of variable is owned by an
Yao> objfile, while type of register is not (alloc_type vs. alloc_type_arch),
Yao> so looks we can use it to differentiate values in register and values
Yao> in variables.

I would rather not use this approach.
My reason is that there is no obvious connection between
TYPE_OBJFILE_OWNED and register-ness -- and it is the sort of invariant
that is very difficult to ensure will remain true over time.

If lval_register can't work, then another choice would be a new flag on
struct value.  This would be somewhat ugly but, I think, more robust.

As Jan points out, it does seem strange to warn about the set rather
than query.  A warning comes too late.

After re-reading the whole thread I wonder whether pressing forward with
this patch is best.  IIUC this didn't arise from any user complaint but
rather just thinking about the problem.  And, while I agree it could be
confusing in some situations, in practice it seems that perhaps it has
never actually bitten anybody.

Tom


  parent reply	other threads:[~2012-09-11 17:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17  2:21 Yao Qi
2012-08-20 20:19 ` Doug Evans
2012-08-21  3:27   ` Yao Qi
2012-08-23 16:25   ` Tom Tromey
2012-08-29  9:51     ` Yao Qi
2012-09-04 22:37       ` dje
2012-09-07 10:01         ` Yao Qi
2012-09-07 10:11           ` Eli Zaretskii
2012-09-07 10:21             ` Yao Qi
2012-09-07 11:27               ` Eli Zaretskii
2012-09-07 13:14                 ` Yao Qi
2012-09-07 14:32                   ` Eli Zaretskii
2012-09-07 16:46     ` Jan Kratochvil
2012-09-09  2:31       ` Yao Qi
2012-09-10  2:02       ` Yao Qi
2012-09-10  7:47         ` Jan Kratochvil
2012-09-10 19:43           ` Jan Kratochvil
2012-09-11 17:12         ` Tom Tromey [this message]
2012-09-11 17:19           ` Jan Kratochvil
2012-09-11 17:23             ` Tom Tromey
2012-09-12  0:51           ` Yao Qi
2012-09-12 13:19             ` Jan Kratochvil

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=87ehm8a3gg.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=yao@codesourcery.com \
    /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