aboutsummaryrefslogtreecommitdiff
path: root/gdb/record-btrace.c
diff options
context:
space:
mode:
authorFelix Willgerodt <felix.willgerodt@intel.com>2018-06-06 14:27:21 +0200
committerFelix Willgerodt <felix.willgerodt@intel.com>2024-08-14 11:20:55 +0200
commit72bb34e65534f5f89b5b8f440ee83021a26c0058 (patch)
tree6b0ebb346f888eedd2e8c65c1df1a5980f99881f /gdb/record-btrace.c
parentd894edfcc40e63be9b6efa0950c1752f249f16e5 (diff)
downloadbinutils-72bb34e65534f5f89b5b8f440ee83021a26c0058.zip
binutils-72bb34e65534f5f89b5b8f440ee83021a26c0058.tar.gz
binutils-72bb34e65534f5f89b5b8f440ee83021a26c0058.tar.bz2
btrace: Enable auxiliary instructions in record instruction-history.
Print the auxiliary data when a btrace_insn of type BTRACE_INSN_AUX is encountered in the instruction-history. Printing is active by default, it can be silenced with the /a modifier. This patch is in preparation for the new ptwrite feature, which is based on auxiliary instructions. Approved-By: Markus Metzger <markus.t.metzger@intel.com> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/record-btrace.c')
-rw-r--r--gdb/record-btrace.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 9fec611..54c761d 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -827,6 +827,22 @@ btrace_insn_history (struct ui_out *uiout,
btrace_ui_out_decode_error (uiout, btrace_insn_get_error (&it),
conf->format);
}
+ else if (insn->iclass == BTRACE_INSN_AUX)
+ {
+ if ((flags & DISASSEMBLY_OMIT_AUX_INSN) != 0)
+ continue;
+
+ uiout->field_fmt ("insn-number", "%u", btrace_insn_number (&it));
+ uiout->text ("\t");
+ /* Add 3 spaces to match the instructions and 2 to indent the aux
+ string to make it more visible. */
+ uiout->spaces (5);
+ uiout->text ("[");
+ uiout->field_fmt ("aux-data", "%s",
+ it.btinfo->aux_data.at
+ (insn->aux_data_index).c_str ());
+ uiout->text ("]\n");
+ }
else
{
struct disasm_insn dinsn;