From patchwork Mon May 25 19:18:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 135631 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4B9F4B9DB71 for ; Mon, 25 May 2026 19:19:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4B9F4B9DB71 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by sourceware.org (Postfix) with ESMTPS id D41964BA900A for ; Mon, 25 May 2026 19:18:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D41964BA900A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D41964BA900A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779736733; cv=none; b=jRv3yzSbRz8blPYJCWac/sFrRGmkQUAHXZ/qRK9o3fY2LTu2EONpMmGfzJUrQlOwGdlq2s6hH4pQ58KmgHNy0369eXwQMBsMk2gRpeglvjxfvsVGhklmux5i0u0NZTcCRFx5CfiY97ATGFEMEJ8IzZOdsc0a/mLRd+XRG9cdPZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779736733; c=relaxed/simple; bh=JTQ24kH1MQAdrkIwlpJiSHTaN2z/juU5J1q+TgCrhjk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Ck/rFGcdgghl7Q5yWpTkqRiV6EQ8wa6gCvtzT439ubtdzEsVXKw+u9yGc0+CZ4dmpHtpRm2/Y8H+2zuxTYmho5moYWLtcbJqZyPklBvi1tGt+Svx3lZMpILhJoug7IZlEQhbazthwMYdMj2V8LaCIMpicYw4bGODX+nZeVczARM= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D41964BA900A Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4905529b933so15569545e9.0 for ; Mon, 25 May 2026 12:18:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779736732; x=1780341532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9HY628vdKYQ8UfNtqGT0JYZTL+BURuIZKygkNhbbF+k=; b=Xvnc9EnJqPqrY/gcesRMY8qDvjxTWiBF3EAtVR55fJ64+NiZ5NwcHdnQkG9h6h+ob4 UzkqutAe8J+qtTFLpM3R30uSwKM2UMgccdWZFG/biaUmHEka9j/2OGIiXbhJz+tTIj1j wOHcHdXHUHehPH/+ZHI0iXcDcTCeMEV7h1B1yjD3prAfbZ7/yWUawhef7Tv8oUlBcrJ1 sja3yXdROozOVMl9J7hEEZaryApflqBQZyXeoSCx+rUTrUsIFh8L33f1RxopKZX1NmvK lOPha4VEEtOUHrss++7/9QSoT+6y2YIRVagK8gOUGMsBhWt+uEVFy8xIx9Mjjd7DAAXo DS9w== X-Gm-Message-State: AOJu0Yx/enWgHQ5tSwK5URps1IhRVMMhZpqn7McC4Wfp5so7REGap+t1 KEF3o2Ix1AwkTGiCZtV3Pv1rHX3fDtwAOXKZLRS0MrzRNaCE3eIqDJPutnkjGg== X-Gm-Gg: Acq92OFGOrlpY29Ykp/eR0HPRJ+kv5iQz+qpD1fR0bpGjEvnV4932s4WX62MecSvLOu 8XUtydgR91OrFWqy6YQqRokDAjkYAG4RajqI309gU2PP73XT/lLZsczNd6Z7H/BRdzkIogQxd4I eRGaaicYRkyxJ3KK0wsHS1R2pcLgMLejHiGnIW+wXMJ+BKn76jd0Vwobv0wZQ8zN8DrpngITYMt zYu35SLeyUJ+YaU4fzqsul863VFdIsSBChbBBau7Pjm6b7oJdb7eDG1E7WWepNP5bi4pGpAAFXV FqKNEdoThIDkXU+vfkGJ74Yk+S+HWZO8/5KKcwhZ00AUxDG+2y4SUmCug0QjRaCa7bBWRhDt5P6 97pDLCKsdHbhHuhEv0NmRqsd+Tl3W+BqVps45QGgbvBJIQPvsH0KsjBXzvdqmXx3kKIJSVitg6k lZmvK0xcVnkzSsE5Zi256JB3uRcBx4M20C X-Received: by 2002:a05:600c:4510:b0:48a:53ea:140b with SMTP id 5b1f17b1804b1-490428ddf15mr242600255e9.28.1779736731606; Mon, 25 May 2026 12:18:51 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:2600:dc16:ec0f:632c:5ba7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49045282201sm295842825e9.8.2026.05.25.12.18.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 May 2026 12:18:51 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 09/11] Adjust gdb.python/py-events.exp for Cygwin/MinGW, thread IDs Date: Mon, 25 May 2026 20:18:27 +0100 Message-ID: <20260525191829.984105-10-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260525191829.984105-1-pedro@palves.net> References: <20260525191829.984105-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org This commit fixes a couple issues in gdb.python/py-events.exp for Cygwin and MinGW: 1) - GDB prints Windows thread IDs in hex: (gdb) thread [Current thread is 1 (Thread 9528.0xa9c)] The current code assumes decimal, so we only (incorrectly) extract the "0" after the dot. 2) - Thread and process ID number spaces are different. The current code assumes that the extracted thread ID is the same number as the extracted process ID, which is not true on Windows. Also tested on x86_64-unknown-linux-gnu. Change-Id: Iebcc07c3ad0845b548334c0d5177b3ab9e9350cf commit-id: 8009478e --- gdb/testsuite/gdb.python/py-events.exp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp index 16a290c31c2..b07eb2ec9b0 100644 --- a/gdb/testsuite/gdb.python/py-events.exp +++ b/gdb/testsuite/gdb.python/py-events.exp @@ -76,17 +76,23 @@ delete_breakpoints # Test inferior call events set process_id "invalid" +set thread_id "invalid" gdb_test_multiple "thread" "get current thread" { -re -wrap "process ($decimal).*" { set process_id $expect_out(1,string) + set thread_id $process_id pass $gdb_test_name } -re -wrap "Thread $hex \\(LWP ($decimal)\\).*" { set process_id $expect_out(1,string) + set thread_id $process_id pass $gdb_test_name } - -re -wrap "Thread $decimal\.($decimal).*" { + -re -wrap "Thread ($decimal)\.($hex|$decimal).*" { set process_id $expect_out(1,string) + set thread_id $expect_out(2,string) + # Convert from hex to decimal. + set thread_id [expr {$thread_id}] pass $gdb_test_name } } @@ -99,9 +105,9 @@ gdb_test_multiple "print do_nothing" "get address of do_nothing" { } set expected [list "event type: pre-call"] -lappend expected "ptid: \\($process_id, $process_id, 0\\)" "address: $addr" +lappend expected "ptid: \\($process_id, $thread_id, 0\\)" "address: $addr" lappend expected "event type: post-call" -lappend expected "ptid: \\($process_id, $process_id, 0\\)" "address: $addr" +lappend expected "ptid: \\($process_id, $thread_id, 0\\)" "address: $addr" gdb_test_sequence "call do_nothing()" "" $expected # Test register changed event