Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: FYI: [python/Ada] gdb.lookup_type fails to looking primitive type
Date: Tue, 13 Jan 2015 20:57:00 -0000	[thread overview]
Message-ID: <CADPb22T8FM7a0GDVqig79OhfG_9juhWZ9L1wu3XO-HF++SDZDg@mail.gmail.com> (raw)
In-Reply-To: <20150113094426.GE8167@adacore.com>

On Tue, Jan 13, 2015 at 1:44 AM, Joel Brobecker <brobecker@adacore.com> 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.


  reply	other threads:[~2015-01-13 20:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 17:26 Joel Brobecker
2015-01-12 17:59 ` Doug Evans
2015-01-13  9:44   ` Joel Brobecker
2015-01-13 20:57     ` Doug Evans [this message]
2015-01-14  5:01       ` Joel Brobecker
2015-01-21  9:44         ` Joel Brobecker
2015-01-21 17:52           ` Doug Evans
2015-01-26 10:51             ` pushed: " Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADPb22T8FM7a0GDVqig79OhfG_9juhWZ9L1wu3XO-HF++SDZDg@mail.gmail.com \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox