From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34369 invoked by alias); 5 Mar 2018 12:39:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 34354 invoked by uid 89); 5 Mar 2018 12:39:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=vms X-HELO: mga04.intel.com Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Mar 2018 12:39:31 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 04:39:29 -0800 X-ExtLoop1: 1 Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga008.jf.intel.com with ESMTP; 05 Mar 2018 04:39:28 -0800 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX151.ger.corp.intel.com (163.33.192.59) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 12:39:28 +0000 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.101]) by irsmsx111.ger.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0319.002; Mon, 5 Mar 2018 12:39:27 +0000 From: "Metzger, Markus T" To: Simon Marchi , "gdb-patches@sourceware.org" Subject: RE: [PATCH 3/3] btrace: Remove ui_out cleanups Date: Mon, 05 Mar 2018 12:39:00 -0000 Message-ID: References: <20180304205605.13037-1-simon.marchi@polymtl.ca> <20180304205605.13037-3-simon.marchi@polymtl.ca> In-Reply-To: <20180304205605.13037-3-simon.marchi@polymtl.ca> x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGRhMzc5YTYtNDNkMS00ZjgyLTgwOTUtNzFiMzkyZTMxNjRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI0UzlMMWptbHM2ZjAxb0ZsWUo1UGdrdnNhVitOeUE1SmZTNXVhbDFMZjdvUFo1Q2JQaTlnU2gyUVE3OUFZMkN2In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00115.txt.bz2 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. >=20 > This allows removing make_cleanup_ui_out_tuple_begin_end and > make_cleanup_ui_out_list_begin_end. >=20 > 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) >=20 > static void > btrace_print_lines (struct btrace_line_range lines, struct ui_out *uiout, > - struct cleanup **ui_item_chain, int flags) > + gdb::optional *src_and_asm_tuple, > + gdb::optional *asm_list, Reference instead of pointer? =20 > - for (line =3D lines.begin; line < lines.end; ++line) > + for (int line =3D lines.begin; line < lines.end; ++line) > { > - if (*ui_item_chain !=3D 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 em= place (). > - *ui_item_chain > - =3D make_cleanup_ui_out_tuple_begin_end (uiout, "src_and_asm_line"); > + src_and_asm_tuple->emplace (uiout, "src_and_asm_line"); >=20 > print_source_lines (lines.symtab, line, line + 1, psl_flags); >=20 > - 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 u= ser 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