gdb/python: implement support for sending custom MI async notifications

This commit adds a new Python function, gdb.notify_mi, that can be used
to emit custom async notification to MI channel.  This can be used, among
other things, to implement notifications about events MI does not support,
such as remote connection closed or register change.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
Jan Vrany
2023-10-10 11:22:56 +01:00
parent 80a3485f81
commit 4825fd2d35
6 changed files with 204 additions and 0 deletions

View File

@@ -2669,6 +2669,10 @@ Return the name of the currently selected language." },
"print_options () -> dict\n\
Return the current print options." },
{ "notify_mi", (PyCFunction) gdbpy_notify_mi,
METH_VARARGS | METH_KEYWORDS,
"notify_mi (name, data) -> None\n\
Output async record to MI channels if any." },
{NULL, NULL, 0, NULL}
};