From: Matt Rice <ratmice@gmail.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Tom Tromey <tom@tromey.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] PR python/13598 - add before_prompt event
Date: Fri, 22 Jul 2016 10:22:00 -0000 [thread overview]
Message-ID: <CACTLOFqA-ZFfik=umzqsKy49bQr_OMzYjj6-m3o_MeqFzmd4Cg@mail.gmail.com> (raw)
In-Reply-To: <CAH=s-PN=rQG=nxyB=YUPoDU4mSN6shAUskBUw8UmeJfm2UcLTw@mail.gmail.com>
On Fri, Jul 22, 2016 at 3:01 AM, Yao Qi <qiyaoltc@gmail.com> wrote:
> Hi Tom,
>
> On Sat, May 21, 2016 at 6:00 AM, Tom Tromey <tom@tromey.com> wrote:
>> This adds an event that is emitted just before GDB presents a prompt
>> to the user. This provides Python code a way to react to whatever
>> changes might have been made by the previous command. For example, in
>> my GUI I use this to track changes to the selected frame and reflect
>> them in the UI.
>
> I read this patch multiple times, but don't know the motivation of adding this
> event. In PR python/13598, you mentioned you want to get event when
> something is changed. If so, why don't you add the python event for the changes
> you are interested in? What is your use case of using python code in GDB?
FWIW, I have long used or more precisely abused the prompt_hook
function for controlling vi by vi --remote to have an editor that
tracks the current file/line which gdb is stopped at, a mechanism for
this which doesn't abuse the actual prompt string formatting functions
by producing some side-effect before returning the prompt string.
such as that proposed by Tom would be nice.
in particular abusing the prompt_hook in this fashion inhibits the
ability to use the python extended-prompt stuff for controlling the
prompt, because the extended-prompt stuff uses the prompt_hook itself!
In particular it's just a nice time to take a snapshot of some
otherwise obtainable property from gdb right before control is handed
back to the user.
next prev parent reply other threads:[~2016-07-22 10:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-21 5:01 Tom Tromey
2016-05-21 6:54 ` Eli Zaretskii
2016-07-22 9:34 ` Phil Muldoon
2016-07-22 10:01 ` Yao Qi
2016-07-22 10:22 ` Matt Rice [this message]
2016-07-23 5:00 ` Tom Tromey
2016-08-03 8:33 ` Yao Qi
2016-08-03 16:08 ` Tom Tromey
2016-08-03 16:16 ` Pedro Alves
2016-08-04 20:34 ` Tom Tromey
2016-08-05 17:30 ` Pedro Alves
2016-10-09 17:23 ` Tom Tromey
2016-07-22 13:28 ` Phil Muldoon
2017-02-11 15:33 ` Tom Tromey
2017-02-12 23:02 ` Yao Qi
2017-02-14 18:03 ` Tom Tromey
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACTLOFqA-ZFfik=umzqsKy49bQr_OMzYjj6-m3o_MeqFzmd4Cg@mail.gmail.com' \
--to=ratmice@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
--cc=tom@tromey.com \
/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