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] |
On 2017-02-09 10:46, Matt Rice wrote:
There is a good example of a command which outputs both in the documentation (in the example below "The -break-insert command") interpreter-exec mi -break-insert main interpreter-exec mi -break-insert -t foo interpreter-exec mi -break-listin the output of the -break-list command there is a list of results of the form:body=[bkpt=... , bkpt=...] https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html#g_t_002dbreak_002dinsertI picked that one specifically because it shows the duplicate "bkpt" keys. inside those bkpt={... thread-groups=["i1"] ... } should be a list of values.interpreter-exec mi -list-thread-groups is a slightly easier to read one that returns a list of values (tuples) ^done,groups=[tuple, ...] Additionally of note is: https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Output-Syntax.html#GDB_002fMI-Output-Syntax * New gdb/mi commands should only output lists containing values. So, i suppose result_list should be some variation on compat_only_result_list or some such...
I like the idea of enforcing proper MI output through code. One situation I know GDB outputs broken MI is with multiple locations breakpoints. See:
https://sourceware.org/bugzilla/show_bug.cgi?id=14733 It'd be nice if the MI building API didn't even let us do that.
it'd be nice to migrate this to something like:result_list, value_list, deprecated_unspecified_list, It would be niceto know if/when you guys think it would be a convenient time to introduce such a change so I could get back up to speed...
Yes that would be great. I would say that the most convenient time is when you have time to contribute to the project :).
About the naming, I think that "result_list" and "value_list" is confusing, since a list containing results is exactly what is deprecated. What about just "tuple" and "list"? According to the syntax and the note you mentioned, a tuple ({...}) will only accept results (foo=bar) and a list ([...]) will only accept values. And we'd have deprecated_result_list to build lists containing results.
Simon
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |