From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nickrob@snap.net.nz (Nick Roberts) Newsgroups: gmane.emacs.devel Subject: Re: other weird gdb-mi problems Date: Fri, 28 Aug 2009 11:36:12 +1200 Message-ID: <19095.6252.325983.101816@totara.tehura.co.nz> References: <83vdkacx2k.fsf@gnu.org> <19093.50389.972379.110708@totara.tehura.co.nz> <87hbvt9x5n.fsf@sphinx.net.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=unknown Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1251416590 5071 80.91.229.12 (27 Aug 2009 23:43:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2009 23:43:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Dzhus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 28 01:43:02 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MgocP-0001Kq-9O for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 01:43:01 +0200 Original-Received: from localhost ([127.0.0.1]:52684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgocO-0002Vp-JL for ged-emacs-devel@m.gmane.org; Thu, 27 Aug 2009 19:43:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgocJ-0002Vh-5z for emacs-devel@gnu.org; Thu, 27 Aug 2009 19:42:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgocD-0002VU-WB for emacs-devel@gnu.org; Thu, 27 Aug 2009 19:42:54 -0400 Original-Received: from [199.232.76.173] (port=58566 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgocD-0002VR-Sr for emacs-devel@gnu.org; Thu, 27 Aug 2009 19:42:49 -0400 Original-Received: from viper.snap.net.nz ([202.37.101.25]:34079) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgoVr-0000bc-RW for emacs-devel@gnu.org; Thu, 27 Aug 2009 19:36:16 -0400 Original-Received: from totara (unknown [123.255.29.59]) by viper.snap.net.nz (Postfix) with ESMTP id 828723DAB03; Fri, 28 Aug 2009 11:36:13 +1200 (NZST) Original-Received: by totara (Postfix, from userid 1000) id 5AA54C164; Fri, 28 Aug 2009 11:36:12 +1200 (NZST) In-Reply-To: <87hbvt9x5n.fsf@sphinx.net.ru> X-Mailer: VM 7.19 under Emacs 22.2.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114709 Archived-At: 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