From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75608 invoked by alias); 30 Jul 2019 01:50:43 -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 75584 invoked by uid 89); 30 Jul 2019 01:50:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:sk:2019073 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Jul 2019 01:50:41 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 4DBB11E05A; Mon, 29 Jul 2019 21:50:40 -0400 (EDT) Subject: Re: [PATCH v3] [PR/24474] Add gdb.lookup_static_symbol to the python API To: Christian Biesinger , gdb-patches@sourceware.org References: <896673e7-8b71-c161-f62f-4cc8fc87cb27@simark.ca> <20190730013502.194120-1-cbiesinger@google.com> From: Simon Marchi Message-ID: <767ee122-a024-9615-e78a-1fa05b416daf@simark.ca> Date: Tue, 30 Jul 2019 01:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190730013502.194120-1-cbiesinger@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-07/txt/msg00648.txt.bz2 > diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp > index 5b8a2be7c4..ab72a4cb9d 100644 > --- a/gdb/testsuite/gdb.python/py-symbol.exp > +++ b/gdb/testsuite/gdb.python/py-symbol.exp > @@ -48,6 +48,25 @@ gdb_test "python print (gdb.lookup_global_symbol('qq').needs_frame)" \ > "False" \ > "print whether qq needs a frame" > > +set rr_line [gdb_get_line_number "line of rr"] > +gdb_test "python print (gdb.lookup_global_symbol ('rr') is None)" "True" \ > + "lookup_global_symbol for static var" > + > +gdb_test "python print (gdb.lookup_static_symbol ('rr').line)" "$rr_line" \ > + "print line number of rr" > + > +gdb_test "python print (gdb.lookup_static_symbol ('rr').value ())" "42" \ > + "print value of rr" > + > +gdb_test "python print (gdb.lookup_static_symbol ('rr').needs_frame)" \ > + "False" \ > + "print whether rr needs a frame" > + > +gdb_test "python print (gdb.lookup_static_symbol ('nonexistant') is None)" \ > + "True" "lookup_static_symbol for nonexistant var" Ah, just noticed this, "nonexistant" -> "nonexistent". The patch LGTM with that fixed. Thanks, Simon