From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 3/3] btrace: Remove ui_out cleanups
Date: Mon, 05 Mar 2018 12:39:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B236964FA2C@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <20180304205605.13037-3-simon.marchi@polymtl.ca>
Hello Simon,
> This patch replaces the cleanups that close the list and tuple of the
> btrace instruction history output with ui_out_emit_tuple and
> ui_out_emit_list.
>
> This allows removing make_cleanup_ui_out_tuple_begin_end and
> make_cleanup_ui_out_list_begin_end.
>
> This patch (along with the previous ones in the series) was regtested on
> the buildbot.
> diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
> index 15ce760f5a..ddd15c4781 100644
> --- a/gdb/record-btrace.c
> +++ b/gdb/record-btrace.c
> @@ -620,26 +620,25 @@ btrace_find_line_range (CORE_ADDR pc)
>
> static void
> btrace_print_lines (struct btrace_line_range lines, struct ui_out *uiout,
> - struct cleanup **ui_item_chain, int flags)
> + gdb::optional<ui_out_emit_tuple> *src_and_asm_tuple,
> + gdb::optional<ui_out_emit_list> *asm_list,
Reference instead of pointer?
> - for (line = lines.begin; line < lines.end; ++line)
> + for (int line = lines.begin; line < lines.end; ++line)
> {
> - if (*ui_item_chain != NULL)
> - do_cleanups (*ui_item_chain);
> + asm_list->reset ();
> + src_and_asm_tuple->reset ();
The SRC_AND_ASM_TUPLE reset () shouldn't be necessary; it is reset () in emplace ().
> - *ui_item_chain
> - = make_cleanup_ui_out_tuple_begin_end (uiout, "src_and_asm_line");
> + src_and_asm_tuple->emplace (uiout, "src_and_asm_line");
>
> print_source_lines (lines.symtab, line, line + 1, psl_flags);
>
> - make_cleanup_ui_out_list_begin_end (uiout, "line_asm_insn");
> + asm_list->emplace (uiout, "line_asm_insn");
> }
> }
Looks good to me, otherwise.
I have not tested it, though. Did you run the gdb.btrace test suite? You said
you ran buildbot but that might skip gdb.btrace when run on VMs or on old
hardware.
Please let me know if you want me to run the gdb.btrace tests for you. A user
branch would be nice in that case.
Regards,
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, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2018-03-05 12:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-04 20:56 [PATCH 1/3] btrace: Remove btrace disable cleanup Simon Marchi
2018-03-04 20:56 ` [PATCH 2/3] btrace: Remove VEC cleanups Simon Marchi
2018-03-05 12:39 ` Metzger, Markus T
2018-03-04 20:56 ` [PATCH 3/3] btrace: Remove ui_out cleanups Simon Marchi
2018-03-05 12:39 ` Metzger, Markus T [this message]
2018-03-05 22:16 ` Simon Marchi
2018-03-06 7:30 ` Metzger, Markus T
2018-03-06 14:40 ` Simon Marchi
2018-03-05 12:39 ` [PATCH 1/3] btrace: Remove btrace disable cleanup Metzger, Markus T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A78C989F6D9628469189715575E55B236964FA2C@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox