This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] keep-variable command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]