This is the mail archive of the gdb@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: [RFC] Setting breakpoint commands from the Python API


>>>>> "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


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