From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98207 invoked by alias); 4 Jun 2019 12:36:19 -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 98198 invoked by uid 89); 4 Jun 2019 12:36:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Jun 2019 12:36:17 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 05:36:16 -0700 Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by fmsmga002.fm.intel.com with ESMTP; 04 Jun 2019 05:36:16 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.93]) by IRSMSX108.ger.corp.intel.com ([169.254.11.19]) with mapi id 14.03.0415.000; Tue, 4 Jun 2019 13:36:15 +0100 From: "Metzger, Markus T" To: "Willgerodt, Felix" , "gdb-patches@sourceware.org" Subject: RE: [PATCH 06/10] python: Add clear_trace() to gdb.Record. Date: Tue, 04 Jun 2019 12:36:00 -0000 Message-ID: References: <1559119673-30516-1-git-send-email-felix.willgerodt@intel.com> <1559119673-30516-7-git-send-email-felix.willgerodt@intel.com> In-Reply-To: <1559119673-30516-7-git-send-email-felix.willgerodt@intel.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00056.txt.bz2 Hello Felix, > diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c > index 81e43a00516..2a4af551146 100644 > --- a/gdb/python/py-record-btrace.c > +++ b/gdb/python/py-record-btrace.c > @@ -811,6 +811,19 @@ recpy_bt_goto (PyObject *self, PyObject *args) > Py_RETURN_NONE; > } >=20 > +/* Implementation of BtraceRecord.clear (self) -> None. */ This does not match the documentation, which uses 'clear_trace'. More instances below. Personally, I like 'clear' better since it is shorter and the context shoul= d be clear enough given that it is a Record method. > @@ -127,6 +127,19 @@ recpy_goto (PyObject *self, PyObject *value) > return PyErr_Format (PyExc_NotImplementedError, _("Not implemented.")); > } >=20 > +/* Implementation of record.clear_trace () -> None. */ > + > +static PyObject * > +recpy_clear (PyObject *self, PyObject *value) Comment and function name don't match. > diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp > b/gdb/testsuite/gdb.python/py-record-btrace.exp > index f6267d664a4..72bb69d5908 100644 > --- a/gdb/testsuite/gdb.python/py-record-btrace.exp > +++ b/gdb/testsuite/gdb.python/py-record-btrace.exp > @@ -90,7 +90,11 @@ with_test_prefix "instruction " { > } > gdb_test "python print(i.decoded)" ".*" > gdb_test "python print(i.size)" "$decimal" > - gdb_test "python print(i.is_speculative)" "False" > + gdb_test "python print(i.is_speculative)" "False" > + gdb_test_no_output "python gdb.current_recording().clear_trace()" Why are we not using 'r' as we do below? I wonder what would happen if we accessed 'i', 'c', 'insn', or 'call' here. > + gdb_test "python insn =3D r.instruction_history" > + gdb_test_no_output "python i =3D insn\[0\]" > + gdb_test "python print(i.size)" "$decimal" > } >=20 > with_test_prefix "function call" { > -- > 2.20.1 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