aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.h
diff options
context:
space:
mode:
authorFelix Willgerodt <felix.willgerodt@intel.com>2018-05-15 15:42:24 +0200
committerFelix Willgerodt <felix.willgerodt@intel.com>2024-08-14 11:20:57 +0200
commit6be9971c93f3bbcd4b779e5591697748da6b093e (patch)
tree317dfc692743480d284331fa92b9088bdafa25cf /gdb/btrace.h
parent77a33bb02413975ccac5ccca315edc72dd6fe25b (diff)
downloadfsf-binutils-gdb-6be9971c93f3bbcd4b779e5591697748da6b093e.zip
fsf-binutils-gdb-6be9971c93f3bbcd4b779e5591697748da6b093e.tar.gz
fsf-binutils-gdb-6be9971c93f3bbcd4b779e5591697748da6b093e.tar.bz2
btrace, python: Enable ptwrite filter registration.
By default GDB will be printing the hex payload of the ptwrite package as auxiliary information. To customize this, the user can register a ptwrite filter function in python, that takes the payload and the PC as arguments and returns a string which will be printed instead. Registering the filter function is done using a factory pattern to make per-thread filtering easier. Approved-By: Markus Metzger <markus.t.metzger@intel.com>
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r--gdb/btrace.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h
index 0f93173..34f8d2b 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -35,6 +35,7 @@
#endif
#include <vector>
+#include <string>
struct thread_info;
struct btrace_function;
@@ -352,6 +353,16 @@ struct btrace_thread_info
displaying or stepping through the execution history. */
std::vector<std::string> aux_data;
+ /* Function pointer to the ptwrite callback. Returns the string returned
+ by the ptwrite filter function. */
+ std::optional<std::string> (*ptw_callback_fun) (const uint64_t payload,
+ const uint64_t ip,
+ const void *ptw_context)
+ = nullptr;
+
+ /* Context for the ptw_callback_fun. */
+ void *ptw_context = nullptr;
+
/* The function level offset. When added to each function's LEVEL,
this normalizes the function levels such that the smallest level
becomes zero. */