This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Handle multiple breakpoint hits in Python interface


>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:

Kevin> following the discussion on
Kevin> http://sourceware.org/ml/gdb/2011-04/msg00131.html, here is a patch
Kevin> which allows Python scripts to know that several breakpoints (with the
Kevin> same PC) where hit during the "stop" event callback.
Kevin> What do you think about it ?

It seems like a reasonable idea.

I think we can't just replace the "breakpoint" attribute with
"breakpoints", since this is going to ship in 7.3, and we don't want to
break backward compatibility.

IIRC, you don't yet have your paperwork in place, so this can't go in
too quickly.

This still needs a doc review.

Kevin> +@defivar BreakpointEvent breakpoints
Kevin> +A tuple containing references to the breakpoints (type

Not technically a tuple, the code makes a list.  Saying "sequence" would
be ok.

Kevin> + /*Add any breakpoint set at this location to the list. */

Space after the first "*".

Kevin> +ÂÂÂÂÂÂÂÂÂ if (list == NULL)
Kevin> +ÂÂÂÂÂÂÂÂÂÂÂ list = PyList_New (0);

You must check for failure here.

Kevin> +ÂÂÂÂÂÂÂÂÂ if (PyList_Append (list, (PyObject *)
current_bs-> breakpoint_at->py_bp_object))
Kevin> +ÂÂÂÂÂÂÂÂÂÂÂ goto fail;

In the fail case, nothing frees 'list'.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]