unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daimrod <daimrod@gmail.com>
To: 14597@debbugs.gnu.org
Subject: bug#14597: 24.3.50; Can't stop the program being debugged with gdb-mi
Date: Tue, 25 Jun 2013 18:53:23 +0200	[thread overview]
Message-ID: <87vc52qgho.fsf@tanger.home> (raw)
In-Reply-To: <87a9mvn4i8.fsf@tanger.home> ("Grégoire Jadi"'s message of "Wed, 12 Jun 2013 09:59:43 +0200")

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

daimrod@gmail.com (Grégoire Jadi) writes:

> `gdb-io-stop' fails to stop the program being debugged when using the
> GDB/MI interface (M-x gdb run gdb -i=mi). C-c C-z also fails to stop the
> program. However, no error is reported, it fails silently, without doing
> anything.
>
> Recipe:
>
> emacs -Q
> M-x cd RET path/to/emacs-sources/src RET
> M-x gdb RET (edit the minibuffer to use "gdb -i=mi ./emacs") RET
> gdb> run -Q
> [emacs starts]
> Now try C-c C-z in *gud-emacs* or M-x gdb-io-stop RET
>
> This bug is only present when using the GDB/MI interpreter. It doesn't
> happen using just the GUD interaction buffer interface (with M-x gud-gdb
> RET), C-c C-z and `gdb-io-stop' can be used to stop the program being
> debugged in *gud-emacs*.

Here a workaround, it sends a raw string with "C-z" instead of a signal.
There is probably a nicer solution but I don't know `gdb-mi.el' and the
GDB/MI interface enough.

With this, C-c C-z can be used in the gdb-inferior-io buffer to stop the
program being debugged.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-progmodes-gdb-mi.el-gdb-io-stop-Temporarily-wor.patch --]
[-- Type: text/x-diff, Size: 1085 bytes --]

From 30217881358cb685d8f1327dfb476f765a0d48a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.jadi@gmail.com>
Date: Tue, 25 Jun 2013 18:40:07 +0200
Subject: [PATCH] * lisp/progmodes/gdb-mi.el (gdb-io-stop): Temporarily
 workaround for bug #14597.

Send raw "C-z" via `gdb-inferior-io' buffer instead of sending a signal.
---
 lisp/progmodes/gdb-mi.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 0b52302..a597a32 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1646,8 +1646,9 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
 (defun gdb-io-stop ()
   "Stop the program being debugged."
   (interactive)
-  (stop-process
-   (get-buffer-process gud-comint-buffer) comint-ptyp))
+  (process-send-string (get-buffer-process
+                        (gdb-get-buffer-create 'gdb-inferior-io))
+                       (kbd "C-z")))
 
 (defun gdb-io-eof ()
   "Send end-of-file to the program being debugged."
-- 
1.8.0.2722.gc0242e5


[-- Attachment #3: Type: text/plain, Size: 19 bytes --]



-- 
Daimrod/Greg

  reply	other threads:[~2013-06-25 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12  7:59 bug#14597: 24.3.50; Can't stop the program being debugged with gdb-mi Grégoire Jadi
2013-06-25 16:53 ` Daimrod [this message]
2020-09-09 13:47   ` Lars Ingebrigtsen
2020-09-09 15:12     ` Eli Zaretskii
2020-09-10 13:43       ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vc52qgho.fsf@tanger.home \
    --to=daimrod@gmail.com \
    --cc=14597@debbugs.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).