diff options
author | Felix Willgerodt <felix.willgerodt@intel.com> | 2023-06-26 16:54:25 +0200 |
---|---|---|
committer | Felix Willgerodt <felix.willgerodt@intel.com> | 2024-09-24 14:22:28 +0200 |
commit | cdd65168f30913731047b86b5a3ef0082d18a90e (patch) | |
tree | 097a1a35a10d78bd746d527f875c0850bbac1eca /gdb/python | |
parent | 13b3a89bc272ded10242e3359bc0871e99338e6c (diff) | |
download | binutils-cdd65168f30913731047b86b5a3ef0082d18a90e.zip binutils-cdd65168f30913731047b86b5a3ef0082d18a90e.tar.gz binutils-cdd65168f30913731047b86b5a3ef0082d18a90e.tar.bz2 |
btrace: Add support for interrupt events.
Newer Intel CPUs support recording asynchronous events in the PT trace.
Libipt also recently added support for decoding these.
This patch adds support for interrupt events, based on the existing aux
infrastructure. GDB can now display such events during the record
instruction-history and function-call-history commands.
Subsequent patches will add the rest of the events currently supported.
Approved-By: Markus Metzger <markus.t.metzger@intel.com>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-record-btrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c index e4f0fd1..bdfebf1 100644 --- a/gdb/python/py-record-btrace.c +++ b/gdb/python/py-record-btrace.c @@ -810,7 +810,7 @@ recpy_bt_function_call_history (PyObject *self, void *closure) /* Helper function that calls PTW_FILTER with PAYLOAD and IP as arguments. Returns the string that will be printed, if there is a filter to call. */ static std::optional<std::string> -recpy_call_filter (const uint64_t payload, const uint64_t ip, +recpy_call_filter (const uint64_t payload, std::optional<uint64_t> ip, const void *ptw_filter) { std::optional<std::string> result; @@ -824,10 +824,10 @@ recpy_call_filter (const uint64_t payload, const uint64_t ip, gdbpy_ref<> py_payload = gdb_py_object_from_ulongest (payload); gdbpy_ref<> py_ip; - if (ip == 0) + if (!ip.has_value ()) py_ip = gdbpy_ref<>::new_reference (Py_None); else - py_ip = gdb_py_object_from_ulongest (ip); + py_ip = gdb_py_object_from_ulongest (*ip); gdbpy_ref<> py_result (PyObject_CallFunctionObjArgs ((PyObject *) ptw_filter, py_payload.get (), |