emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple debugging sessions


From: Kim F. Storm
Subject: Re: Multiple debugging sessions
Date: Fri, 11 Nov 2005 10:12:13 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Miles Bader <address@hidden> writes:

> BTW, I should note that the behavior I'm complaining about is _not_ in
> the "hard case" where there's actual ambiguity.
>
> I'm talking about the simplest possible case, where you're debugging
> two completely different programs, which have no common source-file
> names, and you're mainly using gdb command-line functions -- relying
> on gdba only for e.g. showing breakpoint icons in the fringe.
>
> Even in this apparently easy case, there are very weird interactions
> between the gdb sessions.
>
> I understand that there might be greater difficulties in supporting a
> truly complicated scenario -- e.g. debugging the _same_ program
> multiple times simultaneously (or, due to the way gdb works, different
> programs with common source-file names), because there is actual
> ambiguity that must somehow be resolved -- but that's not what I'm
> really talking about.

If we want to fix this, the solution should definitely allow
debugging the _same_ program or programs sharing the same
source files.

Consider the common case of a client-server system which will often
share some low-level communication modules; we should be able to
debug that in one emacs session too.


It occurred to me that things might be quite simple if each source
buffer had a local variable (gud-*gud*-buffer) pointing back to the
corresponding *gud* buffer.

Then each *gud* buffer would have all the current global variables as
buffer local variables, and every gud function had a call to a function
which did something like:

(unless (eq current-gud-*gud*-buffer gud-*gud*-buffer)
  (with-current-buffer gud-*gud*-buffer
    (for "each global gud variable" do
      (set global-gud-variable buffer-local-value)))
  (setq current-gud-*gud*-buffer gud-*gud*-buffer))

[alternatively, accessing the global gud variables would
simply be wrapped in
  (with-current-buffer current-gud-*gud*-buffer
     some-gud-variable)]

Now, to handle the case of source buffers shared between multiple
debugging sessions, the above scheme must be slightly tweaked to
NOT do the above for such buffer, but rather just use the current
defaults, as it will then simply correspond to the currently
active gud session.

The final thing that must be fixed is to fix visual stuff when
switching between which gud session is active (such as clearing
and showing breakpoint icons, updating the "stack" window, etc.)

In fact, each session should still have all the "stack" buffers, and
switching projects should simply show the right set of buffers in the
gud windows.

About the breakpoint icons, you could make the display depend on
whether the corresponding gud project is active, i.e. use a 'when
clause on the display property which make the display of the fringe
bitmap selective on current-gud-*gud*-buffer matching a specific *gud*
buffer.

Does any of this make sense?

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]