From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Hannes Domani <ssbssa@yahoo.de>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] Don't compare types of enum fields
Date: Fri, 18 Dec 2020 17:14:51 -0500 [thread overview]
Message-ID: <1d5438e7-d6ed-8e1f-4687-6319440c6a2e@polymtl.ca> (raw)
In-Reply-To: <300236003.3696621.1608328818697@mail.yahoo.com>
On 2020-12-18 5:00 p.m., Hannes Domani wrote:
> Am Freitag, 18. Dezember 2020, 22:28:06 MEZ hat Simon Marchi <simon.marchi@polymtl.ca> Folgendes geschrieben:
>
>> On 2020-12-17 2:29 p.m., Hannes Domani via Gdb-patches wrote:
>>> +
>>> +if { [skip_python_tests] } { continue }
>>
>> I suppose this can go earlier, to avoid compiling the program and starting GDB if
>> the test is going to be skipped anyway.
>
> It fails spectacularly when I try this:
>
> ERROR: tcl error sourcing /c/src/repos/gdb-testsuite/gdb/testsuite/gdb.base/compare-enum-type.exp.
> ERROR: can't read "use_gdb_stub": no such variable
> while executing
> "if {$use_gdb_stub
> && [regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} $command]} {
> error "gdbserver does not support $command wi..."
> (procedure "gdb_test_multiple" line 47)
> invoked from within
> "gdb_test_multiple "python print ('test')" "verify python support" -prompt "$prompt_regexp" {
> -re "not supported.*$prompt_regexp" {
> unsupported..."
> (procedure "skip_python_tests_prompt" line 4)
> invoked from within
> "skip_python_tests_prompt "$gdb_prompt $""
> (procedure "skip_python_tests" line 3)
> invoked from within
> "skip_python_tests"
> (file "/c/src/repos/gdb-testsuite/gdb/testsuite/gdb.base/compare-enum-type.exp" line 18)
> invoked from within
> "source /c/src/repos/gdb-testsuite/gdb/testsuite/gdb.base/compare-enum-type.exp"
> ("uplevel" body line 1)
> invoked from within
> "uplevel #0 source /c/src/repos/gdb-testsuite/gdb/testsuite/gdb.base/compare-enum-type.exp"
> invoked from within
> "catch "uplevel #0 source $test_file_name""
> testcase /c/src/repos/gdb-testsuite/gdb/testsuite/gdb.base/compare-enum-type.exp completed in 0 seconds
Ok, so skip_python_tests requires a started GDB. That's fine as it is then.
>>> +
>>> +gdb_test "py print(gdb.parse_and_eval('e1').type == gdb.parse_and_eval('e2').type)" "True"
>>
>>
>> I think it would make sense to move this test to the gdb.python directory.
>
> I wasn't sure about that, because even though I use python to test it, it's
> actually testing check_types_equal (a gdb base function).
Well, it doesn't really matter. Technically, you are testing the comparison
of two types using the Python interface, not check_types_equal. The Python
bindings could change how testing equality between two types is implemented
such that it doesn't use check_types_equal anymore, and your test would still
test the Python interface's behavior.
Anyway, I find the separation in different directories very blurry. If I write
a test case that uses two threads, should I automatically put it in gdb.threads
instead of gdb.base?
Simon
prev parent reply other threads:[~2020-12-18 22:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201217192912.1981-1-ssbssa.ref@yahoo.de>
2020-12-17 19:29 ` Hannes Domani via Gdb-patches
2020-12-18 20:30 ` Tom Tromey
2020-12-18 21:27 ` Simon Marchi via Gdb-patches
2020-12-18 22:00 ` Hannes Domani via Gdb-patches
2020-12-18 22:14 ` Simon Marchi via Gdb-patches [this message]
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=1d5438e7-d6ed-8e1f-4687-6319440c6a2e@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=ssbssa@yahoo.de \
/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