From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Extend gdb to filter registers Date: Sun, 19 Jan 2020 12:33:44 -0500 Message-ID: <997C9AD2-D8DD-45DC-9195-28FEC907B2C4@gmail.com> References: <878spmuerf.fsf@mail.linkov.net> <83wod3bx8i.fsf@gnu.org> <9f5ddaa5-0234-a17b-bdd7-81d70a0a50d6@gmx.at> <83FFF194-64CD-409E-8B7A-5A9DF91E79DE@gmail.com> <83v9pb314t.fsf@gnu.org> <838sm510d6.fsf@gnu.org> <83muakzoy5.fsf@gnu.org> <71042c9f-478b-47c8-f27e-1348e9f4536d@gmx.at> <83iml8zkbm.fsf@gnu.org> <6ad85759-7408-f177-38f6-45a72c2f5a9e@gmx.at> <83eevwzi79.fsf@gnu.org> <68ef651e-9319-b392-af1c-4564d5db9112@gmx.at> <831rrvzc81.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_DC4CC6BF-8F35-4CCA-8659-F17C58735300" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="66640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , emacs-devel@gnu.org, monnier@iro.umontreal.ca, john@yates-sheets.org, Juri Linkov To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 19 18:34:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1itET3-000HGz-FV for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Jan 2020 18:34:33 +0100 Original-Received: from localhost ([::1]:52096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itET2-0004e0-9s for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Jan 2020 12:34:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55350) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itESO-0003mp-1X for emacs-devel@gnu.org; Sun, 19 Jan 2020 12:33:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itESN-00021E-1b for emacs-devel@gnu.org; Sun, 19 Jan 2020 12:33:51 -0500 Original-Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:34003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itESI-00020G-Lk; Sun, 19 Jan 2020 12:33:46 -0500 Original-Received: by mail-qt1-x834.google.com with SMTP id 5so25922685qtz.1; Sun, 19 Jan 2020 09:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=zhLhqXia4N07XU425YO6TRbmxe2a7AlpG2s62LlmyMI=; b=FR1hlcMvbx/XBHTGM2Qlj2cQ0Qbzy2eLDVkCiASb7S7sRJKB3Jyt7+5mUWrAOC/RCg DEbnoaApABpd43n6iQgcN1sWSK0Vyv+At2OliZAM/qht4YI8lIINDSL/YUkLYX364Qrq upYkMZD+PPtytpjj6bsQlDJn/1TaYBuCDKZF0XDWgcxvf/YJ/5O8gj3fWObZ8Dm6wsfn 8/a4bl0jR317/EH/Ix4AmhHL6cH75I8aCR/5k38jcdeZEwkJsAbUGwUxmh7NFtbzZgcT ZGoGcaXHFnnvOASNB6xJGCqLQIFkIrW/jwH4Z4MKN9ibw7a1HPeHjOg1lwYtc3FHe0IY +SxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=zhLhqXia4N07XU425YO6TRbmxe2a7AlpG2s62LlmyMI=; b=IEs1d4UDA7chBWEBTLwTzJPOm/TLMUzbI0haU1pDr18JYku+l8SrDHdeCsACptNncO GXeGVBwmo9Pm3o8XRVU+LzN3y/j6ixzVANjF5FeoshWwBszhyTFCy9agzVXGZjIGMAwy yHsKEX7XRXeawTMo15r0534iJhloc7a83A/9qM3V/lrW3PGOHL3xeg4f621H5JvLLjrH esG6vk8RgRRHjtTHg+RXH127sPoPhqynyminOcwBdqjalRKEWLqxrePU3hkaKVvfIDAX aVNsDDrMHvTYDfx4eiqAjSRDWdtVIDLTgr0oSGlcGr1uUONtZ0zl21a4kadUCQzBdEtt jp+A== X-Gm-Message-State: APjAAAU7B0TDiU+xELAjTyjF4PzZzk/OR3C0T9QBAx0y3N8FmJB+FDDk 9IJdoUBhILD0MufBY6WBrtUHr4WtIwEXFNSn X-Google-Smtp-Source: APXvYqyOh6oQs2K1pWBcZwMhKbDkOZOK1wnNjcNNDKxKbh1zQCeDqdT6qNffMNt1qWwBukvkohYqEA== X-Received: by 2002:ac8:4709:: with SMTP id f9mr16502226qtp.87.1579455225802; Sun, 19 Jan 2020 09:33:45 -0800 (PST) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id o33sm16910580qta.27.2020.01.19.09.33.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jan 2020 09:33:45 -0800 (PST) In-Reply-To: <831rrvzc81.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.40.2.2.4) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::834 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244383 Archived-At: --Apple-Mail=_DC4CC6BF-8F35-4CCA-8659-F17C58735300 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > So you are saying that calling gdb-display-source-buffer instead of > display-buffer will not by itself help here, because display-buffer is > called under the hood anyway, and might decide to create a new window > instead of reusing an existing one? `gdb-goto-breakpoint` first calls `gdb-display-source-buffer` which will = look for the right window to display. If `gdb-display-source-buffer` = can=E2=80=99t find the right window, it will return nil. In that case = `gdb-goto-breakpoint` will use `display-buffer` to show the buffer. So, = if there _is_ a right window, gdb-mi will do the right thing, and = `display-buffer` is not used. > If so, what would be the correct solution of this issue? As for the issue where gbd-mi creates new window when it doesn=E2=80=99t = need to, my fix is to make `gud-display-line` behaves like = `gdb-goto-breakpoint`: try `gdb-display-source-buffer` first (when = gdb-mi is enabled), then try `display-buffer`; instead of simply using = `display-buffer`. Yuan= --Apple-Mail=_DC4CC6BF-8F35-4CCA-8659-F17C58735300 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
So you are saying that calling gdb-display-source-buffer = instead of
display-buffer will not by itself help here, because = display-buffer is
called under the hood anyway, and might decide to create a = new window
instead of reusing an existing one?

`gdb-goto-breakpoint` first calls = `gdb-display-source-buffer` which will look for the right window to = display. If `gdb-display-source-buffer` can=E2=80=99t find the right = window, it will return nil. In that case `gdb-goto-breakpoint` will use = `display-buffer` to show the buffer. So, if there _is_ a right window, = gdb-mi will do the right thing, and `display-buffer` is not used.

If so, what would be the correct solution of this = issue?

As = for the issue where gbd-mi creates new window when it doesn=E2=80=99t = need to, my fix is to make `gud-display-line` behaves like = `gdb-goto-breakpoint`: try `gdb-display-source-buffer` first (when = gdb-mi is enabled), then try `display-buffer`; instead of simply using = `display-buffer`.

Yuan
= --Apple-Mail=_DC4CC6BF-8F35-4CCA-8659-F17C58735300--