[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Executing Emacs commands when a gdb breakpoint is hit
From: |
Eli Zaretskii |
Subject: |
Re: Executing Emacs commands when a gdb breakpoint is hit |
Date: |
Thu, 23 Jan 2020 16:45:41 +0200 |
> 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 ;-)
- Executing Emacs commands when a gdb breakpoint is hit, Skip Montanaro, 2020/01/21
- Re: Executing Emacs commands when a gdb breakpoint is hit, Eli Zaretskii, 2020/01/21
- Re: Executing Emacs commands when a gdb breakpoint is hit, Skip Montanaro, 2020/01/22
- Re: Executing Emacs commands when a gdb breakpoint is hit, Eli Zaretskii, 2020/01/22
- Re: Executing Emacs commands when a gdb breakpoint is hit, otadmor ., 2020/01/22
- Re: Executing Emacs commands when a gdb breakpoint is hit, Skip Montanaro, 2020/01/22
- Re: Executing Emacs commands when a gdb breakpoint is hit,
Eli Zaretskii <=
- Re: Executing Emacs commands when a gdb breakpoint is hit, Skip Montanaro, 2020/01/23
- Re: Executing Emacs commands when a gdb breakpoint is hit, Eli Zaretskii, 2020/01/24