From patchwork Sun Sep 16 05:17:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 29404 Received: (qmail 98246 invoked by alias); 16 Sep 2018 05:17:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 98072 invoked by uid 89); 16 Sep 2018 05:17:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Tests X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Sep 2018 05:17:13 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D69C630820D4 for ; Sun, 16 Sep 2018 05:17:11 +0000 (UTC) Received: from pinnacle.lan (ovpn-117-176.phx2.redhat.com [10.3.117.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B67F060C60 for ; Sun, 16 Sep 2018 05:17:11 +0000 (UTC) Date: Sat, 15 Sep 2018 22:17:10 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [PATCH 3/4] Tests for gdb.InfThread.thread_handle Message-ID: <20180915221710.786b60a0@pinnacle.lan> In-Reply-To: <20180915220836.7dda4a63@pinnacle.lan> References: <20180915220836.7dda4a63@pinnacle.lan> MIME-Version: 1.0 X-IsSubscribed: yes gdb/testsuite/ChangeLog: * gdb.python/py-thrhandle.exp: Add tests for gdb.InfThread.thread_handle. --- gdb/testsuite/gdb.python/py-thrhandle.exp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gdb/testsuite/gdb.python/py-thrhandle.exp b/gdb/testsuite/gdb.python/py-thrhandle.exp index 49aa97c..b3caaf5 100644 --- a/gdb/testsuite/gdb.python/py-thrhandle.exp +++ b/gdb/testsuite/gdb.python/py-thrhandle.exp @@ -104,3 +104,17 @@ gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.par gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('\"S\"')))" \ ".*Thread handle size mismatch.*" \ "Pass too small of an object to thread_from_thread_handle" + +# Test the thread_handle method + +gdb_test "python h=gdb.parse_and_eval('thrs\[0\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \ + "True" \ + "Check operation of thread_handle method for thrs\[0\]" + +gdb_test "python h=gdb.parse_and_eval('thrs\[1\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \ + "True" \ + "Check operation of thread_handle method for thrs\[1\]" + +gdb_test "python h=gdb.parse_and_eval('thrs\[2\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \ + "True" \ + "Check operation of thread_handle method for thrs\[2\]"