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] Add visible flag to breakpoints.


On Friday 08 October 2010 13:50:34, Phil Muldoon wrote:
> The @var{internal} argument has no effect with watchpoints.

Should it be an error instead (or made to work)?


The non-python bits looked fine.  I'd prefer Tom or someone
else to look and approve those.  I did notice:

>  #define BPPY_REQUIRE_VALID(Breakpoint)                                 \
>      do {                                                               \
> -      if (! bpnum_is_valid ((Breakpoint)->number))                     \
> +      if (Breakpoint == NULL)                                          \
>         return PyErr_Format (PyExc_RuntimeError, _("Breakpoint %d is invalid."), \
>                              (Breakpoint)->number);                     \

'(Breakpoint)->number' when Breakpoint is NULL is not going to work.
Also, missing ()s:

     if ((Breakpoint) == NULL)

I would also suggest using a VEC for the breakpoints instead
of a linked list.

(Also, the old code appeared to have been designed for O(1) access to
the python breakpoint objects given a breakpoing number: I have no
clue it if that matters but you could preserve that easily with two
VECs or bppy_breakpoints arrays.)

-- 
Pedro Alves


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