This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 03/10] btrace: Enable auxiliary instructions in record function-call-history.
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: "Willgerodt, Felix" <felix dot willgerodt at intel dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 4 Jun 2019 12:35:35 +0000
- Subject: RE: [PATCH 03/10] btrace: Enable auxiliary instructions in record function-call-history.
- References: <1559119673-30516-1-git-send-email-felix.willgerodt@intel.com> <1559119673-30516-4-git-send-email-felix.willgerodt@intel.com>
Hello Felix,
> Print the auxiliary data when a btrace_insn of type BTRACE_INSN_AUX
> is encountered in the function-call-history. Printing is
> active by default, it can be silenced with the /s modifier.
The /s modifier is used in 'record instruction-history' to mean 'interleave sources'. I guess
we'd want this behavior there, as well. And we'd also want the same modifier for both
commands.
> +static void
> +btrace_print_aux_insn (struct ui_out *uiout,
> + const struct btrace_function *bfun,
> + const struct btrace_thread_info *btinfo)
> +{
> + for (const auto &i : bfun->insn)
> + {
> + if (i.iclass == BTRACE_INSN_AUX)
> + {
> + uiout->text ("\t\t[");
We print the number and a single tab for gaps. I'd do the same here.
> + uiout->field_fmt ("aux-insn", "%s",
Should this be spelled "aux-data" to align with the naming of the field?
> + btinfo->aux_data[i.aux_data_index].c_str ());
> + uiout->text ("]\n");
> + }
> + }
> +}
> +
> /* Disassemble a section of the recorded function trace. */
>
> static void
> @@ -1214,6 +1231,10 @@ btrace_call_history (struct ui_out *uiout,
> }
>
> uiout->text ("\n");
> +
> + if (((flags & RECORD_DONT_PRINT_AUX) == 0)
> + && ((bfun->flags & BFUN_AUX_DECODED) != 0))
> + btrace_print_aux_insn(uiout, bfun, btinfo);
This ignores the 'record function-call-history-size' setting.
> }
> }
Thanks,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928