[RFC] Setting breakpoint commands from the Python API
Tom Tromey
tom@tromey.com
Mon Dec 19 19:08:00 GMT 2016
>>>>> "Martin" == Martin Galvan <omgalvan.86@gmail.com> writes:
Martin> Doing gdb.execute('commands 2 3 4\necho "Hello World"\nend')
Martin> doesn't work either.
Yes, IIRC multi-line commands can't be evaluated with gdb.execute.
It would be nice to lift this restriction.
Martin> In view of this I'm thinking of adding a new 'set_commands' method to
Martin> gdb.Breakpoint. For the implementation I was looking at
Martin> do_map_commands_command, which is called when issuing 'commands' from
Martin> the gdb CLI, but can also take an already parsed command (when
info-> control != NULL). However, before I went any further I wanted to
Martin> ask you guys if there's another way to do this that I'm missing, or if
Martin> there are any suggestions.
How about just allowing assignment of the .commands attribute? I think
that would be more in keeping with the other attributes of
gdb.Breakpoint.
thanks,
Tom
More information about the Gdb
mailing list