[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: other weird gdb-mi problems
From: |
Nick Roberts |
Subject: |
Re: other weird gdb-mi problems |
Date: |
Fri, 28 Aug 2009 11:36:12 +1200 |
Dmitry Dzhus writes:
> Nick Roberts wrote:
>
> > It's an Emacs problem. The CLI commands "up" and "down", don't emit any
> > GDB/MI notifications so Emacs doen't know that the display needs updating.
>
> I've changed `gdb-mi.el` to append `--frame` and `--thread` options to
> every command it sends to GDB. This is is the recommended way to use
> GDB/MI, because we can put all frame/thread selection logic to
> frontend-land completely, without relying on internal state of GDB.
> That's the way `gdb-mi.el` works now ? select frame/thread on frontend
> side and append --thread/--frame appropriately. `gdb-thread-number` and
> `gdb-frame-number` variables reflect current thread (probably
> buffer-local) and frame selected by Emacs.
The problem here, though, is that when the user command _changes_ the
frame, e.g., "up", the frame number should change to 1 but Emacs sends
the command
"-stack-info-frame --thread 1 --frame 0"
^^^
since it doesn't realise that the frame has changed. It parses the output
and thinks that the frame is still 0. If it sent:
"-stack-info-frame --thread 1"
it would get the details of the newly selected frame and realise it had
changed.
>
> It's pity that these patches didn't make it to GDB upstream :( I see now
> that current `=thread-selected` notification implementation in GDB uses
> a different and perhaps less elegant approach. I've posted a patch to
> GDB mailing list which adds =frame-selected notification following the
> current approach. I hope that GDB upstream accepts the patch or
> reevaluates the one you'd sent before.
The `=thread-selected` implementation is indeed somewhat different to what I
proposed. With regard to the frame-changed notification, I realise now Daniel
Jacobowitz pointed out that it would fire too often:
http://sourceware.org/ml/gdb-patches/2008-05/msg00024.html
I think that's when I added a handler for "-stack-info-frame" referred to
above.
--
Nick http://www.inet.net.nz/~nickrob
- other weird gdb-mi problems, Miles Bader, 2009/08/26
- Re: other weird gdb-mi problems, Eli Zaretskii, 2009/08/26
- Re: other weird gdb-mi problems, Nick Roberts, 2009/08/26
- Re: other weird gdb-mi problems, Miles Bader, 2009/08/26
- Re: other weird gdb-mi problems, Miles Bader, 2009/08/26
- Re: other weird gdb-mi problems, Nick Roberts, 2009/08/27
- Re: other weird gdb-mi problems, Miles Bader, 2009/08/27
- Re: other weird gdb-mi problems, Nick Roberts, 2009/08/27
- Re: other weird gdb-mi problems, Dmitry Dzhus, 2009/08/27
- Re: other weird gdb-mi problems,
Nick Roberts <=