Re: [RFC] Setting breakpoint commands from the Python API

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
>>>>> "Martin" == Martin Galvan <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.