Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org, tromey@redhat.com
Subject: Re: [patch] [python] Implement stop_p for gdb.Breakpoint
Date: Thu, 24 Feb 2011 09:50:00 -0000	[thread overview]
Message-ID: <m3tyftold4.fsf@redhat.com> (raw)
In-Reply-To: <AANLkTinCVWSay5D-2OEoMxxqJDv=yQgw90oU-PuXWw2z@mail.gmail.com>	(Doug Evans's message of "Wed, 23 Feb 2011 21:29:05 -0800")

Doug Evans <dje@google.com> writes:

>> I believe I have implemented all of the requests from the previous patch
>> discussion.  I eventually renamed eval to stop_p.  Also, recently, Tom
>> wrote a log_printf Python command that uses this feature. I've included
>> it here, along with a few alterations Tom had to make to Breakpoint
>> initialization to make that work.
>>
>> Here it is. What do you think?
>
> Hi.
> Some nits and comments:
>
> - "consistency is good", so if we go with _p for stop_p we need to go
> with _p for all predicates
>   - are we prepared for that?
>   - are there any existing predicates that don't have _p?
>   - does python have an existing convention?
>   [I used stop_p at the time for clarity's sake.  But I think these
> questions need to be asked.]

There are two instances that I can think of where we allow the user
to implement methods that we supply the interface for.  One is the
pretty-printer string, children and hint methods.  The other is the
patch I sent last week for the redesign of parameters.  None of those
use the _p for predicate style.  As far as I can tell (with the express
disclaimer I am don't hack on actual Python code that much), there does
not seem to be a convention.  I'll defer to real Python hackers
here. For my part, I don't have much of an opinion what we call it, or
if we should have a convention; I'll rely on the maintainers being
directive here ;)

> - I didn't see any tests for log-printf
>
> - log.py feels misnamed but since the name isn't exported to the user
> it's not important enough to find a better name
>
> - can printf get an error (e.g. bad memory access) and would one
> necessarily want execution to halt when that happens?
>   - I can imagine wanting to just see an error message and have
> execution continue
>   - OTOH while testing a log-printf I would want execution to stop if
> I misspelled something
>   - we don't have to add the functionality now, but IWBN to at least
> think about if/how we'd provide it
>
> - we probably should document log-printf in the manual

When I edited the original message, I guess I edited out a paragraph I
wanted to leave in! Anyway, I'm not sure we should include log-printf
in the original FSF inclusion, I added it here for a "real world"
case. Just illustrative. I think if we want to include it that is fine,
or Tom can submit it as a separate patch.  I should have probably asked
Tom first ;)  Anyway apologies for the confusion!

> - is the logic for deciding whether to stop correct?
>   E.g. if stop_p says "don't stop" and a condition says "stop" will
> execution continue?  It looks like it, but maybe I'm misunderstanding
> something.

The case of the user having an old-style GDB condition, and an
implementation of a "stop_p" is an odd one. I was inclined to disallow
it, but eventually decided against it.  There will be conflict if stop_p
and condition disagree.  My first thoughts are "stop" should always
trump "don't stop". What do you think?

Cheers

Phil


  reply	other threads:[~2011-02-24  9:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 16:33 Phil Muldoon
2011-02-23 18:05 ` Eli Zaretskii
2011-02-24  7:02 ` Doug Evans
2011-02-24  9:50   ` Phil Muldoon [this message]
     [not found]     ` <AANLkTikXyH+zYkFRoUmihmDYj_nxU5648UnF5T9G-Wte@mail.gmail.com>
2011-02-28 21:19       ` Doug Evans
2011-03-07 16:43         ` Phil Muldoon
2011-03-07 20:52   ` Tom Tromey
2011-03-10  6:47     ` Doug Evans
2011-03-11  1:55       ` Tom Tromey
2011-03-11 11:59         ` Phil Muldoon
2011-03-11 18:27           ` Tom Tromey
2011-03-11 20:59             ` Doug Evans
2011-03-13 22:28               ` Phil Muldoon
2011-03-14 14:49                 ` Tom Tromey
2011-03-14 17:56                   ` Phil Muldoon
2011-03-14 20:01                     ` Tom Tromey
2011-03-14 21:27                     ` Eli Zaretskii
2011-03-11 18:36           ` Tom Tromey
2011-03-07 22:01 ` 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=m3tyftold4.fsf@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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