This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Insight session regression (?)
- To: Keith Seitz <keiths at cygnus dot com>
- Subject: Re: Insight session regression (?)
- From: Tom Tromey <tromey at redhat dot com>
- Date: 04 Oct 2001 20:26:14 -0600
- Cc: Insight List <insight at sourceware dot cygnus dot com>
- References: <Pine.GSO.4.33.0110031352240.11248-100000@makita.cygnus.com>
- Reply-To: tromey at redhat dot com
>>>>> "Keith" == Keith Seitz <keiths@cygnus.com> writes:
>> My patch circumvents saving the session in this case, and then changes
>> the preloop to load a session if one exists.
Keith> I hate to say this, but your approach is completely different
Keith> from the one I would have guessed to try, so now I have to ask
Keith> if you've tried my approach and found it lacking. :-)
I didn't look at any other approach.
Keith> gdbtk_tcl_exec_file_display will create a new session for any
Keith> loaded executable, and I think this thinko may be the reason
Keith> one can get multiple sessions for the same exe.
Yes, I hadn't noticed this. I really don't understand the file
loading code -- I haven't looked at it, and I remember seeing patches
in that area before that just didn't make sense to me (and not because
they were wrong :-).
Keith> Of course this leads to another problem: we cannot set
Keith> breakpoints and the like until AFTER symbol reading, so we're
Keith> stuck with a global again! Argh.
Can't we put something on file_changed_hook? But if we do this then
we have to modify session_load -- right now it assumes that it should
request the executable (it calls set_exe). Now I think there is a
flaw in my patch -- we'll actually load the executable twice.
Keith> I dunno. Now I have to think about it some more. I'm inclined
Keith> to put it all in file hooks, but as we've discovered, we need
Keith> to wait until gdb is done loading everything.
How about this plan?
We change session_load to *only* load the file via set_exe. Do the
rest of the work on a new proc on file_changed_hook. This proc looks
to see if there is a session with the same name as the current exe; if
so it loads it.
Keith> We could put it in the file_changed_hook, since that is called
Keith> AFTER reading the exe and symbols. Problem with this, though,
Keith> is that it only gets called IF the user used "file" at the
Keith> prompt (or passed a file to gdb's command line). We lose if the
Keith> user uses "exec-file" and "add-symbol-file". But then, we'd be
Keith> in no worse shape than we are now, would we?
I think this is a fine approach (I wrote my above text about
file_changed_hook before I read this...).
I agree that something like exec-file or symbol-file confuses the
issue of sessions. I don't know what to do about those. I've never
used either of those commands.
I'll give this a poke soon.
Tom