This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 4/9] Explicit locations v2 - Add address locations
- From: Doug Evans <dje at google dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Sat, 2 Aug 2014 12:16:38 -0700
- Subject: Re: [RFA 4/9] Explicit locations v2 - Add address locations
- Authentication-results: sourceware.org; auth=none
- References: <536BC678 dot 1010309 at redhat dot com> <5388CB81 dot 4030409 at redhat dot com> <CADPb22S5sRGR49Lbt8o+-SsMzh5ESV7pnqWW-HNCbPDA89mGqA at mail dot gmail dot com> <5395F91D dot 1030905 at redhat dot com>
On Mon, Jun 9, 2014 at 11:12 AM, Keith Seitz <keiths@redhat.com> wrote:
> On 06/08/2014 02:58 PM, Doug Evans wrote:
>
>> I've given the series another read through.
>> Not as detailed a read through as I want to, but that'll have to wait for
>> a bit.
>>
>
> I really appreciate your efforts here. I owe you a beverage of your choice
> should we ever meet in person again!
Got Guinness? :-)
>> @@ -291,10 +290,8 @@ bpfinishpy_init (PyObject *self, PyObject *args,
>> PyObject *kwargs)
>> struct event_location location;
>>
>> /* Set a breakpoint on the return address. */
>> - initialize_event_location (&location, LINESPEC_LOCATION);
>> - finish_pc = get_frame_pc (prev_frame);
>> - xsnprintf (small_buf, sizeof (small_buf), "*%s", hex_string
>> (finish_pc));
>> - EVENT_LOCATION_LINESPEC (&location) = small_buf;
>> + initialize_event_location (&location, ADDRESS_LOCATION);
>> + EVENT_LOCATION_ADDRESS (&location) = get_frame_pc (prev_frame);
>> create_breakpoint (python_gdbarch,
>> &location, NULL, thread, NULL,
>> 0
>> I can think of two solutions. Maybe there's another even better one.
>>
>> 1) Have a "placement new"-like constructor akin to the existing
>> new_foo_location constructors we have that takes a pointer to the
>> object to initialize.
>> 2) Always use the existing new_foo_location constructors and free the
>> object when done.
>
>
> My purpose on this was efficiency. I haven't a clue how often a python
> script could call this, so I opted to handle memory allocations a little
> more tightly. I have no real objections to either solution, but I guess I
> would opt for #2 since that both exists and is already widely used.
>
> Do you want me to submit an update to the series for this, or shall I wait
> for more feedback?
When we last left our story I was about to leave for holidays, was
gone for most of June and half of July. Vacation time is over, alas,
back to work ... :-)
No need to submit an updated series until I get any remaining comments
out for this series.
Thanks!