From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Dzhus Newsgroups: gmane.emacs.devel Subject: Re: other weird gdb-mi problems Date: Thu, 27 Aug 2009 17:57:56 +0400 Message-ID: <87hbvt9x5n.fsf@sphinx.net.ru> References: <83vdkacx2k.fsf@gnu.org> <19093.50389.972379.110708@totara.tehura.co.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1251381848 26405 80.91.229.12 (27 Aug 2009 14:04:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2009 14:04:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 27 16:04:00 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 1Mgfa1-00048k-2f for ged-emacs-devel@m.gmane.org; Thu, 27 Aug 2009 16:03:58 +0200 Original-Received: from localhost ([127.0.0.1]:46262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgfa0-0003K0-FZ for ged-emacs-devel@m.gmane.org; Thu, 27 Aug 2009 10:03:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgfZv-0003Jg-Ps for emacs-devel@gnu.org; Thu, 27 Aug 2009 10:03:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgfZr-0003HZ-JN for emacs-devel@gnu.org; Thu, 27 Aug 2009 10:03:51 -0400 Original-Received: from [199.232.76.173] (port=38241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgfZr-0003HW-GG for emacs-devel@gnu.org; Thu, 27 Aug 2009 10:03:47 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47612) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgfZq-0003X2-Tz for emacs-devel@gnu.org; Thu, 27 Aug 2009 10:03:47 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MgfZm-00043o-38 for emacs-devel@gnu.org; Thu, 27 Aug 2009 16:03:42 +0200 Original-Received: from 95-24-218-197.broadband.corbina.ru ([95.24.218.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2009 16:03:42 +0200 Original-Received: from dima by 95-24-218-197.broadband.corbina.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2009 16:03:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 95-24-218-197.broadband.corbina.ru User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:d5c2H0JhBnFanXza1BCli0lAHs8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:114689 Archived-At: 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. When we type `thread N` in GUD console, GDB emits `=thread-selected,id=N` notification. Emacs reads this and changes `gdb-thread-number`. No such notification is provided when we type `frame M`, `up` or `down`. As the result, Emacs can't notice the change of current frame. Previously `gdb-mi.el` deducted current frame from internal state of GDB. I can revert changes to follow this behaviour again, but the real fix would involve implementing `=frame-selected` notification in GDB. > http://sourceware.org/ml/gdb-patches/2008-04/msg00377.html but there hasn't > been much interest. 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. -- Happy Hacking. http://sphinx.net.ru む