From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130884 invoked by alias); 8 Jul 2016 07:14:20 -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 130861 invoked by uid 89); 8 Jul 2016 07:14:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=commercial, Tel, tel, office X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Jul 2016 07:14:06 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 08 Jul 2016 00:14:04 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 08 Jul 2016 00:13:59 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.117]) by IRSMSX101.ger.corp.intel.com ([169.254.1.155]) with mapi id 14.03.0248.002; Fri, 8 Jul 2016 08:13:58 +0100 From: "Metzger, Markus T" To: "gdb-patches@sourceware.org" CC: "keiths@redhat.com" , "yao.qi@arm.com" Subject: [ping] [PATCH] python: accept address and explicit locations in gdb.decode_line Date: Fri, 08 Jul 2016 07:14:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00110.txt.bz2 ping See also the previous discussion: https://sourceware.org/ml/gdb-patches/201= 6-06/msg00328.html. Thanks, Markus. > -----Original Message----- > From: Metzger, Markus T > Sent: Monday, June 20, 2016 4:33 PM > To: gdb-patches@sourceware.org > Cc: keiths@redhat.com > Subject: [PATCH] python: accept address and explicit locations in > gdb.decode_line >=20 > The gdb.decode_line python function is documented to support the same > location > expressions as the "break" command. It currently expects a linespec loca= tion. >=20 > Instead of creating a linespec location directly, create the location via > string_to_event_location_basic. >=20 > It's not clear to me whether I should use python_language or current_lang= uage, > though. Is there some comment that explains it? >=20 > 2016-06-20 Markus Metzger >=20 > gdb/ > * python/python.c (gdbpy_decode_line): Call > string_to_event_location_basic. >=20 > testsuite/ > * gdb.python/python.exp: Test decode_line("*0"). > --- > gdb/python/python.c | 2 +- > gdb/testsuite/gdb.python/python.exp | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/gdb/python/python.c b/gdb/python/python.c > index 1f1fece..7bee890 100644 > --- a/gdb/python/python.c > +++ b/gdb/python/python.c > @@ -738,7 +738,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) >=20 > if (arg !=3D NULL) > { > - location =3D new_linespec_location (&arg); > + location =3D string_to_event_location_basic (&arg, python_language= ); > make_cleanup_delete_event_location (location); > } >=20 > diff --git a/gdb/testsuite/gdb.python/python.exp > b/gdb/testsuite/gdb.python/python.exp > index 3f8c46f..4072fa3 100644 > --- a/gdb/testsuite/gdb.python/python.exp > +++ b/gdb/testsuite/gdb.python/python.exp > @@ -251,6 +251,13 @@ gdb_py_test_silent_cmd {python symtab =3D > gdb.decode_line ("func1,func2")} \ > "test decode_line func1,func2" 1 > gdb_test {python print (symtab[0])} ",func2" "stop at comma in linespec" >=20 > +gdb_py_test_silent_cmd "python symtab =3D gdb.decode_line(\"*0\")" "Test > decode_line *0" 1 > +gdb_test "python print (len(symtab))" "2" "Test decode_line *0 result le= ngth" > +gdb_test "python print (symtab\[0\])" "None" "Test decode_line *0 unpars= ed" > +gdb_test "python print (len(symtab\[1\]))" "1" "Test decode_line *0 loca= tions > length" > +gdb_test "python print (symtab\[1\]\[0\].symtab)" "None" "Test decode_li= ne > *0 filename" > +gdb_test "python print (symtab\[1\]\[0\].pc)" "0" "Test decode_line *0 p= c" > + > # gdb.write > gdb_test "python print (sys.stderr)" ".*gdb.GdbOutputErrorFile > (instance|object) at.*" "Test stderr location" > gdb_test "python print (sys.stdout)" ".*gdb.GdbOutputFile (instance|obje= ct) > at.*" "Test stdout location" > -- > 1.8.3.1 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