[v3,0/2] gdb/python: implement support for sending custom MI async

Message ID 20231006151106.315633-1-jan.vrany@labware.com
Headers
Series gdb/python: implement support for sending custom MI async |

Message

Jan Vrany Oct. 6, 2023, 3:11 p.m. UTC
  I hope I addressed all comments raised by Andrew for V2 series

Changes since V2:

* Fixed formatting errors in patch 1 of this series
* Fixed formatting errors in patch 2 of this series
* Added report name of incorrect data type into error message
  as suggested.
* Moved target_terminal::ours_for_output () right after the
  check if UI is an MI UI as suggested.
* Fixed tests.

Changes since V1:

* Moved serialize_mi_result and helpers to py-mi.c as suggested.
  Also, renamed serialize_mi_result to serialize_mi_results
  instead of serialize_mi_data and do not rename serialize_mi_result_1.

  The reason for this is that GDB documentation,
  section GDB/MI Output Syntax, describes "result" being single 'variable = value'
  pair and "result-record" and "async-output" contains zero or more of these "result"s,
  so calling top-level serialization function serialize_mi_results seems
  a better name than serialize_mi_data (used in previous version).

* Made gdb.notify_mi DATA parameter optional as suggested.

* Validate gdb.notify_mi NAME parameter as suggested.

* Updated documentation:
  * example formatted as black tool would do it,
  * rephrase some sentences as suggested,
  * document that DATA parameter is optional,
  * document restrictions on NAME parameter and
  * document that users should prefix user-defined notification
    with hyphen to avoid possible conflicts.

Jan Vrany (2):
  gdb/python: generalize serialize_mi_result()
  gdb/python: implement support for sending custom MI async
    notifications

 gdb/NEWS                                  |   3 +
 gdb/doc/python.texi                       |  45 +++++
 gdb/python/py-mi.c                        | 233 ++++++++++++++++++++++
 gdb/python/py-micmd.c                     | 185 +----------------
 gdb/python/python-internal.h              |  18 ++
 gdb/python/python.c                       |   4 +
 gdb/testsuite/gdb.python/py-mi-notify.exp |  71 +++++++
 7 files changed, 383 insertions(+), 176 deletions(-)
 create mode 100644 gdb/testsuite/gdb.python/py-mi-notify.exp