From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xOCcJuQp3V9/AQAAWB0awg (envelope-from ) for ; Fri, 18 Dec 2020 17:15:00 -0500 Received: by simark.ca (Postfix, from userid 112) id 8C80A1F0AA; Fri, 18 Dec 2020 17:15:00 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3C2301E552 for ; Fri, 18 Dec 2020 17:15:00 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C18423857C70; Fri, 18 Dec 2020 22:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C18423857C70 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608329699; bh=ZFC9byWJV75YgTMA/5oXzUStj3QmeA6d1OmAXAfOY+w=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nr8vJ5feVTHjUiwbNhxjdFkqpJ7NPt6xU1z3ZX+z9F3MXdd9QiPIOXrDZyrdAjZXS id8DldNQUrRL5c9pa+s+yPEK+c7c+EuJoI1UmTsaykuoqDI1yMlh1BJt2du8xNm5oj xOtfqV1H0cmIFmuA82YrZj/mpdhnW0Jh6Zcns5Pg= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id F01C63857C70 for ; Fri, 18 Dec 2020 22:14:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F01C63857C70 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0BIMEpbK013107 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Dec 2020 17:14:56 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BIMEpbK013107 Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 517471E552; Fri, 18 Dec 2020 17:14:51 -0500 (EST) Subject: Re: [PATCH v2] Don't compare types of enum fields To: Hannes Domani , "gdb-patches@sourceware.org" References: <20201217192912.1981-1-ssbssa.ref@yahoo.de> <20201217192912.1981-1-ssbssa@yahoo.de> <300236003.3696621.1608328818697@mail.yahoo.com> Message-ID: <1d5438e7-d6ed-8e1f-4687-6319440c6a2e@polymtl.ca> Date: Fri, 18 Dec 2020 17:14:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <300236003.3696621.1608328818697@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 18 Dec 2020 22:14:51 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-12-18 5:00 p.m., Hannes Domani wrote: > Am Freitag, 18. Dezember 2020, 22:28:06 MEZ hat Simon Marchi 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