From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16191 invoked by alias); 13 Jan 2015 20:57:05 -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 16180 invoked by uid 89); 13 Jan 2015 20:57:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f47.google.com Received: from mail-oi0-f47.google.com (HELO mail-oi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 20:57:03 +0000 Received: by mail-oi0-f47.google.com with SMTP id z81so4305780oif.6 for ; Tue, 13 Jan 2015 12:57:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UcMBrt81yWyVA0wG+JKrHJ3bWsKdOtM/Bk4O6xOE5yw=; b=jeXQj9fCUu+Ci4cnsgPEnqGbC+YC1IZMqytm9E2D18OzzX0f2UQcGSh4S/mCaqXwPo TSwDaq2mKzYC333Q05Z1S9ghirTbrZdbCrorGQVFqY16GxyuQHMp8a+2eDqqiZxHi8DC JheLP7b9SXE6xe1iGfF0sSq0NHKjYebGkvCrirvCiP1CNQsC/K6Wlu08xeCtfOtp1axC suZlRZ0e8MK7GTfIxpl/JxdYtZcDSOPA/aMHZCdosJK86eEibFoiwnEcvR7kBo9MAam8 I3S2H2CkVJOJn6FblOU8sSgFJOQHiBpLJ/1fj4oMJ/6QT7w+VU3HJdUAp/B9mcakag5H updA== X-Gm-Message-State: ALoCoQnmTz16m09BRyNTgclsAtfUvaCFrvX/3h8UJkFapFfeSoLnUKZwqPXJlmSiLIa/l7b4vH69 MIME-Version: 1.0 X-Received: by 10.202.226.2 with SMTP id z2mr250234oig.64.1421182622037; Tue, 13 Jan 2015 12:57:02 -0800 (PST) Received: by 10.182.222.98 with HTTP; Tue, 13 Jan 2015 12:57:01 -0800 (PST) In-Reply-To: <20150113094426.GE8167@adacore.com> References: <1421083588-927-1-git-send-email-brobecker@adacore.com> <20150113094426.GE8167@adacore.com> Date: Tue, 13 Jan 2015 20:57:00 -0000 Message-ID: Subject: Re: FYI: [python/Ada] gdb.lookup_type fails to looking primitive type From: Doug Evans To: Joel Brobecker Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00356.txt.bz2 On Tue, Jan 13, 2015 at 1:44 AM, Joel Brobecker wrote: > ... >> > +proc test_lookup_type { lang type_name } { >> > + gdb_test_no_output "set language ${lang}" >> > + gdb_test_no_output "python gdb.lookup_type('${type_name}')" \ >> > + "lookup type ${type_name} using language ${lang}" >> > +} >> >> I wouldn't have expected gdb_test_no_output to work here >> for python.lookup_type, though I can see that it does. >> This is no different than "python 1+1": it doesn't print anything either. > > And I actually believe that this is the expected behavior of a python > "script", even if the "script" is passed on the command line. I am > guessing that you are thinking of the case where you are inside the > interactive interpreter, in which case, yes, we expect it to print > the returned value each time. But this is not a test where we use > the interactive interpreter here, hence I would not expect any output. > If I wanted some output, I'd have used "print". > > As a result, a "clarifying" comment would have actually confused > things more, IMO, and so I elected to not add one. Alas I was confused without it. :-) > Attached is what I ended up checking in: > > gdb/ChangeLog: > > * ada-lang.c (ada_lookup_symbol_nonlocal): If name not found > in static block, then try searching for primitive types. > > gdb/testsuite/ChangeLog: > > * gdb.python/py-lookup-type.exp: New file. Not that I'm expecting anyone to go back and change things, but maybe for future reference it'd be better to print the result and record the expected output, instead of expecting no output. Performing a lookup action, and then expecting no output, is just too confusing to me.