From: Kevin Pouget <kevin.pouget@gmail.com>
To: pmuldoon@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add bp_location to Python interface
Date: Thu, 08 Dec 2011 14:28:00 -0000 [thread overview]
Message-ID: <CAPftXUKOiemyFrc5NG0FTBTMbsFvNQOMnz=DGOQBRKrjSzXV5w@mail.gmail.com> (raw)
In-Reply-To: <m3pqfz9pnq.fsf@redhat.com>
On Thu, Dec 8, 2011 at 2:08 PM, Phil Muldoon <pmuldoon@redhat.com> wrote:
> Kevin Pouget <kevin.pouget@gmail.com> writes:
>
>> Hello,
>>
>> I would like to discuss this patch which introduces a new Python class
>> gdb.BpLocation, mapped from breakpoint.h::struct bp_location.
>
> Thanks.
>
>> I noticed that the Python interface doesn't offer so many details
>> about breakpoint location, just gdb.Breakpoint.location, the string
>> used to set the breakpoint (its linespec?)
>
> Because we use gdb.Breakpoints for watchpoints as well, it also
> represents the expression used to set the watchpoint.
I didn't consider watchpoints at all during this work, I'll add it to
the testsuite to ensure it's handling correctly
>> So this new class, which is currently strictly read-only and not
>> instantiatable, exports the address and inferior in which the
>> breakpoint was set (and an enabled flag, and a link to its owner
>> breakpoint).
>
> I think it should only ever be read-only.
yes, certainly. My original idea was to allow Python to add new
BpLocations, but that's the way GDB was designed to work! Anyway, I
think that Tom's patch has solved the problem by correctly spreading
breakpoints to new inferiors.
>> BpLocation object are available through the gdb.Breakpoint.locations method.
>
> If a user expected a string for a location, delivering an object here
> would break API?
I'm not sure to get you right, but I didn't change the original API
behavior. There are now two ... method/atribute, `Breakpoint.location`
which returns a string (bp->addr_string) and
`Breakpoint.location_s_(self)' which returns a tuple of gdb.BpLocation
objects.
The name "locations" might be confusing, but I've got no other wording
for it so far, and I think it's too late to rename "location" to
"spec",
(there is a missing Py_DECREF(list) in bppy_locations, I'll fix it for
the next patch)
>> I think that this class would also help Python users to better
>> control/understand where their breakpoints are set with Tom's recent
>> changes about ambiguous linespec
>
> Yes I think so too.
another advantage is to allow the detection of pending breakpoints:
if len(bp.locations()) == 0, the breakpoint is pending
(and we'll have to find a way to find a way to keep GDB quite when a
pending breakpoint is created (I'll post a bug report for that):
> (gdb) py gdb.Breakpoint("pending")
> Function "pending" not defined.
> Breakpoint 2 (pending) pending.
Cordially,
Kevin
next prev parent reply other threads:[~2011-12-08 13:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 10:17 Kevin Pouget
2011-12-08 13:39 ` Phil Muldoon
2011-12-08 14:28 ` Kevin Pouget [this message]
2011-12-08 14:56 ` Phil Muldoon
2011-12-09 13:49 ` Kevin Pouget
2011-12-09 14:15 ` Phil Muldoon
2011-12-13 15:55 ` Kevin Pouget
2012-01-09 11:47 ` Kevin Pouget
2012-01-09 17:23 ` Eli Zaretskii
2012-01-10 15:09 ` Kevin Pouget
2012-01-10 16:03 ` Kevin Pouget
2012-01-10 17:25 ` Eli Zaretskii
2012-01-11 10:16 ` Kevin Pouget
2012-01-11 10:27 ` Eli Zaretskii
2012-01-10 22:24 ` Doug Evans
2012-01-11 9:05 ` Kevin Pouget
2012-01-11 19:45 ` Doug Evans
2012-01-27 13:04 ` Kevin Pouget
2012-03-30 19:51 ` Tom Tromey
2012-04-03 10:35 ` Kevin Pouget
2012-04-03 12:15 ` Phil Muldoon
2012-04-03 14:43 ` Paul_Koning
2012-04-04 8:36 ` Kevin Pouget
2012-05-09 7:18 ` Kevin Pouget
2012-04-05 16:27 ` Eli Zaretskii
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='CAPftXUKOiemyFrc5NG0FTBTMbsFvNQOMnz=DGOQBRKrjSzXV5w@mail.gmail.com' \
--to=kevin.pouget@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@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