unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Executing Emacs commands when a gdb breakpoint is hit
Date: Thu, 23 Jan 2020 16:45:41 +0200	[thread overview]
Message-ID: <83d0batene.fsf@gnu.org> (raw)
In-Reply-To: <CANc-5UzZiWsivRC02pekaSNH_sJHkq488vnbgB2gCyrowmwZow@mail.gmail.com> (message from Skip Montanaro on Wed, 22 Jan 2020 15:07:57 -0600)

> From: Skip Montanaro <skip.montanaro@gmail.com>
> Date: Wed, 22 Jan 2020 15:07:57 -0600
> Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
> 
> The problem I encounter is that the underlying gdb process doesn't
> seem to be ready to receive input when my stop function is executed.
> It appears to have been stopped, but the (gdb) prompt isn't visible in
> the *gud-python* buffer. I want to print the desired expression with
> (comint-send-input), then read the result. Perhaps I should just set a
> gdb-level command to print the desired expressions instead. My ELisp
> code would only then need to read the values from *gud-python*. The
> advantage of doing everything from within my ELisp stop function is
> that everything relevant to this display lives in one place. I don't
> have to synchronize my ELisp with user-level gdb commands.
> 
> Perhaps there is a comint function which will update the *gud-python*
> buffer so the (gdb) prompt is visible and the underlying gdb process
> is truly ready for (comint-send-input)?

You could define a timer that runs your function after some small
delay, maybe it could work.

But in general, I must admit I find this design somewhat strange.  GDB
offers you 3 extension languages: the CLI scripting, Python, and Guile
Scheme.  Why not use one of these to do what you want? this is how the
GDB developers intended for you to extend the debugger for doing these
kinds of jobs.  If you use Guile, you could even write code that is
almost Emacs Lisp ;-)




  reply	other threads:[~2020-01-23 14:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 18:02 Executing Emacs commands when a gdb breakpoint is hit Skip Montanaro
2020-01-21 18:39 ` Eli Zaretskii
2020-01-22 13:48   ` Skip Montanaro
2020-01-22 17:04     ` Eli Zaretskii
2020-01-22 19:55       ` otadmor .
2020-01-22 21:07       ` Skip Montanaro
2020-01-23 14:45         ` Eli Zaretskii [this message]
2020-01-23 21:00           ` Skip Montanaro
2020-01-24  8:01             ` Eli Zaretskii
2020-04-07 20:21               ` otadmor .

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=83d0batene.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.
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).