Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Jim Blandy <jimb@red-bean.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fixup convenience variables on endian switch
Date: Thu, 17 Nov 2005 19:54:00 -0000	[thread overview]
Message-ID: <437CDC7D.1010404@st.com> (raw)
In-Reply-To: <20051117190240.GA19136@nevyn.them.org>

Daniel Jacobowitz wrote:
>>So you only really need to preserve convenience variables whose types
>>are builtin types, and don't go away when symbol tables are reloaded. 
>>Wouldn't it be simpler just to have clear_internalvars only clear
>>variables whose types belong to objfiles?

Unless I am mistaken even builtin types have to be refreshed. It is a 
long time since I did this work, but I'm sure they are not as simple as 
you make out. At least, they didn't use to be ... this work originally 
comes from a 5.3 baseline.

> I think you've switched patches - this is about updating variables on
> an endianness switch, not clearing them when we reload.  I think that
> one way or another, we ought to preserve the values or discard the
> convenience variables; leaving them corrupted fails my "can I explain
> this behavior to a user" test.

The current behaviour is to leave them corrupted.

>>Or you could define a hook that runs a user-defined command when the
>>architecture changes.  Then your script could define a command that
>>sets up your variables, and have GDB run that command when the
>>architecture is known.  We'd have to think about the best time to run
>>the hook, but I'm sure something reasonable could be worked out.

This doesn't actually seem easier - I have already done the work one way 
and it is totally reliable for builtin types (once configured for each 
host anyway). It also makes the user interface considerably less 
friendly and then there's there's Daniel's test to be passed - the user 
will say "why can't it Just Work?"

> Just seems nasty.  Why not preserve things that we know how to
> preserve, and clear anything we don't?  We know how to preserve
> scalars by reading them into a LONGEST, and floats by reading them into
> a DOUBLEST.  Structures require complicated recursion and unions are
> intractable.

I would prefer we didn't actually clear the value - we currently get it 
back if the endian switches again.

The more I think about this the more I think it might be nice to 
preserve the value of difficult types in the background, should the 
endian switch back (or type return from the dead), and present the value 
to the user as a message '$v = void <wrong endian>' (or '$v = void <type 
unknown>').

Just a thought ....

Andrew


  reply	other threads:[~2005-11-17 19:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16 15:13 Andrew STUBBS
2005-11-17  0:34 ` Jim Blandy
2005-11-17  3:57 ` Daniel Jacobowitz
2005-11-17 13:46   ` Andrew STUBBS
2005-11-17 19:22     ` Jim Blandy
2005-11-17 19:25       ` Daniel Jacobowitz
2005-11-17 19:54         ` Andrew STUBBS [this message]
2005-11-18  1:27         ` Jim Blandy

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=437CDC7D.1010404@st.com \
    --to=andrew.stubbs@st.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@red-bean.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