Re: GDB Python API: stop/continue after breakpoint

Phil Muldoon
2011-03-21T14:39:14Z

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

> cool, that's working perfectly now !
>
> just one thing:
>
>> <python breakpoint outputs>
>>
>> [Switching to Thread 0x7ffff7de1700 (LWP 2417)]
>>
>> Breakpoint -9, rdb_notify_event () at replay_db.c:11
>> 11 void rdb_notify_event() {}
>
> is there any way / woudn't it be nice to have the ability to disable
> the breakpoint hit outputs? at least for the 'internal' breakpoints,
> which shouldn't be visible to the user ?

You can set the breakpoint to silent:

(gdb) python b = gdb.Breakpoint("hello.c:5", internal=True)
(gdb) run
Breakpoint -1, main () at /home/pmuldoon/hello.c:5
5 printf("Hello world!\n");
(gdb) py b.silent = True
(gdb) run
(gdb) list
(gdb) where
#0 main () at /home/pmuldoon/hello.c:5

There might be a case for setting the breakpoint to 'silent' in the
breakpoint constructor:

python b = gdb.Breakpoint("hello.c:5", internal=True, silent=True)

or just making internal breakpoints silent by default.

I'll implement either. What do you think?

Cheers,

Phil