Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] keep-variable command
Date: Thu, 17 Nov 2005 12:42:00 -0000	[thread overview]
Message-ID: <437C728E.70601@st.com> (raw)
In-Reply-To: <8f2776cb0511161528y372fde8cuaa7ddecf863f277a@mail.gmail.com>

Jim Blandy wrote:
> - Converting types to strings needs to be done in a
>   language-independent manner.  It's a shame that types don't seem to
>   point to a language.  But it would be better to use LA_PRINT_TYPE
>   than to build the name by hand.

That prints to a stream. Is there a way to make it 'print' to a buffer? 
I haven't studied it in depth.

> - Types can be local to some scope.  Even if you print out a type's
>   name, how can you discover what scope to re-parse it in?  Right now
>   you're just getting whatever happens to be in
>   expression_context_block, right?

Yes, but the variables are fixed up lazily. In theory, if the user 
doesn't access it until it makes sense then there will be no problem. Of 
course, if they just say 'show conv' then some variables may well not 
find types.

> Do you really need all this?  Can you tell us more about the situation?

We have a number of scripts which want to keep values regardless of what 
happens to the symbol tables - they mostly describe the configuration of 
the target (location of memory mapped registers, that kind of thing). I 
think they are all just char, int or pointer variants of those.

This worked OK for a while without anything special (we just didn't 
delete them), but the type fixing was in response to some evil crashing 
bugs we had. I discovered it had been working more by chance than design 
and did something about it - it is always wrong to make assumptions 
about pointers into tables that are being rebuilt. The fact that made it 
work for other types was something of a freebie.

Regardless of whether I really _need_ all of it I rather _like_ the fact 
that it Just Works ... mostly.

Andrew


  parent reply	other threads:[~2005-11-17 12:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16 15:54 Andrew STUBBS
2005-11-16 20:26 ` Eli Zaretskii
2005-11-17  1:07   ` Jim Blandy
2005-11-17  9:56     ` Daniel Jacobowitz
2005-11-17 15:07       ` Andrew STUBBS
2005-11-17 12:42     ` Andrew STUBBS [this message]
2005-11-17 12:26   ` Andrew STUBBS
2005-11-17 19:33     ` Eli Zaretskii
2005-11-17 19:36       ` Daniel Jacobowitz

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=437C728E.70601@st.com \
    --to=andrew.stubbs@st.com \
    --cc=eliz@gnu.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