From: nickrob@snap.net.nz (Nick Roberts)
To: Dmitry Dzhus <dima@sphinx.net.ru>
Cc: emacs-devel@gnu.org
Subject: Re: other weird gdb-mi problems
Date: Fri, 28 Aug 2009 11:36:12 +1200 [thread overview]
Message-ID: <19095.6252.325983.101816@totara.tehura.co.nz> (raw)
In-Reply-To: <87hbvt9x5n.fsf@sphinx.net.ru>
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
prev parent reply other threads:[~2009-08-27 23:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-26 7:49 other weird gdb-mi problems Miles Bader
2009-08-26 17:19 ` Eli Zaretskii
2009-08-26 23:27 ` Nick Roberts
2009-08-27 1:49 ` Miles Bader
2009-08-27 1:50 ` Miles Bader
2009-08-27 4:52 ` Nick Roberts
2009-08-27 9:42 ` Miles Bader
2009-08-28 3:05 ` Nick Roberts
2009-08-27 13:57 ` Dmitry Dzhus
2009-08-27 23:36 ` Nick Roberts [this message]
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=19095.6252.325983.101816@totara.tehura.co.nz \
--to=nickrob@snap.net.nz \
--cc=dima@sphinx.net.ru \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.