From: Joel Brobecker <brobecker@adacore.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: FYI: [python/Ada] gdb.lookup_type fails to looking primitive type
Date: Wed, 21 Jan 2015 09:44:00 -0000 [thread overview]
Message-ID: <20150121094440.GA24515@adacore.com> (raw)
In-Reply-To: <20150114050051.GH8167@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]
> > 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.
>
> The only issue I have with that is that I'd like to do something
> whose behavior is defined. Looking at the GDB manual, I can't see
> anything said about what to expect when converting a gdb.Type to
> a string... If we clarify that, I have no problem adding the extra
> "print" in the test.
I tried looking into the code as to what the semantics of printing
the gdb.Type object should be, and couldn't figure it out. It seems
to be printing the type name, but I'm not sure why. So, instead of
waiting for a clarification that may never come, I propose the
following.
gdb/ChangeLog:
* gdb.python/py-lookup-type.exp (test_lookup_type): Change
the second test to print the name attribute of value
returned by the call to gdb.lookup_type, and adjust
the expected output accordingly.
Tested on x86_64-linux.
Does this change answer your concerns?
--
Joel
[-- Attachment #2: 0001-check-gdb.lookup_type-return-value-in-gdb.python-py-.patch --]
[-- Type: text/x-diff, Size: 1303 bytes --]
From eea862a6a45741d97bca981b7c8356782e02c0a3 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Wed, 21 Jan 2015 10:29:09 +0100
Subject: [PATCH] check gdb.lookup_type return value in
gdb.python/py-lookup-type.exp
This further improves this testcase to check the output of
our calls to gdb.lookup_type.
gdb/ChangeLog:
* gdb.python/py-lookup-type.exp (test_lookup_type): Change
the second test to print the name attribute of value
returned by the call to gdb.lookup_type, and adjust
the expected output accordingly.
---
gdb/testsuite/gdb.python/py-lookup-type.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.python/py-lookup-type.exp b/gdb/testsuite/gdb.python/py-lookup-type.exp
index d8fb9e7..46d6fc6 100644
--- a/gdb/testsuite/gdb.python/py-lookup-type.exp
+++ b/gdb/testsuite/gdb.python/py-lookup-type.exp
@@ -32,7 +32,8 @@ if { [skip_python_tests] } { continue }
proc test_lookup_type { lang type_name } {
gdb_test_no_output "set language ${lang}"
- gdb_test_no_output "python gdb.lookup_type('${type_name}')" \
+ gdb_test "python print(gdb.lookup_type('${type_name}').name)" \
+ "${type_name}" \
"lookup type ${type_name} using language ${lang}"
}
--
1.9.1
next prev parent reply other threads:[~2015-01-21 9:44 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
2015-01-14 5:01 ` Joel Brobecker
2015-01-21 9:44 ` Joel Brobecker [this message]
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=20150121094440.GA24515@adacore.com \
--to=brobecker@adacore.com \
--cc=dje@google.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