From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8d6AFPpJMWoSOQoAWB0awg (envelope-from ) for ; Tue, 16 Jun 2026 09:04:58 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AGeYVSnI; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4F7AA1E024; Tue, 16 Jun 2026 09:04:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 97D701E024 for ; Tue, 16 Jun 2026 09:04:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A027248F66C7 for ; Tue, 16 Jun 2026 13:04:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A027248F66C7 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AGeYVSnI Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by sourceware.org (Postfix) with ESMTPS id 3260B48F8E2C for ; Tue, 16 Jun 2026 13:04:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3260B48F8E2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3260B48F8E2C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781615072; cv=none; b=XgXRs5hhOBznXV3QArPpJ1WkflGmcJh87Fa4PIpO7x3SVLSgOQcXn/jSkiTNw5OTxouVyKB2uAokU429k7lMgkwZ5L9hdVrp0qi/YjHJtJe9j77A+SsmXbcyB4+FR+G24ezx3Lx8QNLOrg9eYwkb88C5krKbuW5bhM6FFdzXYfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781615072; c=relaxed/simple; bh=j3UWEMPQxb+igUzW4D7/ms0B/C53QgNTPazW8mnZbFM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tevMsmCpmXfPWh9MyCeSVWzo7V7YN8ZS8cxzaTsvf7nTGHpwkU3i655Dl0w0TjKOn7GZd1W/jDbuZqAdpUWq77MX1wzRJVSnnzQKdxeqlKmze4RwR+Cza5NAVSZw94scoCMpNsKtOoPs7ip6rOzX9ACFWOs68mKB+PDxJwBoHBg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AGeYVSnI DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3260B48F8E2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781615072; x=1813151072; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=j3UWEMPQxb+igUzW4D7/ms0B/C53QgNTPazW8mnZbFM=; b=AGeYVSnI7BwEWTJhTJApg10CpOhB+frD4mvT6WtnohZB15ds4/+cjzAH ky8trJLL2Xu4NGyYl0ccF+70elf9q3HXm20Jf4C+6st+1TySblhMhETNz mWDi/hh4buvQv7McssZXyyfh02nXt/xC+djgWkW6lHlSZpnub0t9HO3SX D+BTK1VDeLxM+vqgHvjaTyR4lHOhCgL2x+D7W3Uq56OH/t6WTHCQ7dnV+ hTT+zMCaNCcIA/UJAcG2lKRq6Cs2e601iAq/a4RTQV2tJVnWxrkny3BJO HInAlwdQSnZBopQlFYLKeYmmIM0VUwUqOevFKHoZxirlNLB+tK04ywk0M w==; X-CSE-ConnectionGUID: CQxL2zNhS0+ujYOAcSls7Q== X-CSE-MsgGUID: /jHytKxiRm+8nxGcrLGalg== X-IronPort-AV: E=McAfee;i="6800,10657,11818"; a="93760026" X-IronPort-AV: E=Sophos;i="6.24,208,1774335600"; d="scan'208";a="93760026" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2026 06:04:31 -0700 X-CSE-ConnectionGUID: 6kflg6mzTHOErzPqLEAPmw== X-CSE-MsgGUID: F1VxFGZTRqWF/F9b4Jdx3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,208,1774335600"; d="scan'208";a="271487018" Received: from dut1049pvc.igk.intel.com (HELO localhost) ([10.211.177.244]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2026 06:04:30 -0700 From: Stephan Rohr To: gdb-patches@sourceware.org Subject: [PATCH 1/1] gdb, testsuite: unify 'Switching to thread' message Date: Tue, 16 Jun 2026 13:04:19 +0000 Message-ID: <20260616130419.121388-1-stephan.rohr@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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~public-inbox=simark.ca@sourceware.org From: "Rohr, Stephan" The 'normal_stop ()' function in infrun prints [Switching to Thread 0x155554dff6c0 (LWP 77976)] on thread switch. The 'print_selected_thread_frame ()' function in thread.c prints [Switching to thread 2 (Thread 0x155554dff6c0 (LWP 96643))] Ensure consistent output by updating the thread switch message in 'normal_stop ()'. --- gdb/infrun.c | 3 ++- gdb/testsuite/gdb.replay/missing-thread.exp | 2 +- .../gdb.threads/infcall-from-bp-cond-other-thread-event.exp | 2 +- gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp | 2 +- gdb/testsuite/gdb.threads/manythreads.exp | 2 +- gdb/testsuite/gdb.threads/stepi-over-clone.exp | 5 +++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 22a05608486..f17c9758918 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -9762,7 +9762,8 @@ normal_stop () SWITCH_THRU_ALL_UIS () { target_terminal::ours_for_output (); - gdb_printf (_("[Switching to %s]\n"), + gdb_printf (_("[Switching to thread %s (%s)]\n"), + print_thread_id (inferior_thread ()), target_pid_to_str (inferior_ptid).c_str ()); annotate_thread_changed (); } diff --git a/gdb/testsuite/gdb.replay/missing-thread.exp b/gdb/testsuite/gdb.replay/missing-thread.exp index 6a4eaaaafcc..e3844c82453 100644 --- a/gdb/testsuite/gdb.replay/missing-thread.exp +++ b/gdb/testsuite/gdb.replay/missing-thread.exp @@ -162,7 +162,7 @@ proc_with_prefix replay_with_log { remote_log expect_error non_stop } { "warning: command aborted, Thread \[^\r\n\]+ unexpectedly exited after signal stop event"] if { !$non_stop } { - lappend expected_output "\\\[Switching to Thread \[^\r\n\]+\\\]" + lappend expected_output "\\\[Switching to thread \[^\r\n\]+\\\]" } gdb_test "continue" [multi_line {*}$expected_output] diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp index 530f231d49c..fa13a61e746 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp @@ -132,7 +132,7 @@ proc run_condition_test { stop_at_cond other_thread_signal \ "Continuing\\." \ ".*" \ "Thread ${::decimal} \"\[^\"\r\n\]+\" received signal SIGSEGV, Segmentation fault\\." \ - "\\\[Switching to Thread \[^\r\n\]+\\\]" \ + "\\\[Switching to thread \[^\r\n\]+\\\]" \ "${::hex} in worker_func \[^\r\n\]+:${::signal_line}" \ "${::decimal}\\s+\[^\r\n\]+Signal here\[^\r\n\]+"] \ "received signal in other thread" diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp index 56c2d60f163..041bf2076c4 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp @@ -155,7 +155,7 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp unwind } { "Continuing\\." \ ".*" \ "Thread ${::decimal} \"infcall-from-bp\" received signal SIGSEGV, Segmentation fault\\." \ - "\\\[Switching to Thread \[^\r\n\]+\\\]" \ + "\\\[Switching to thread \[^\r\n\]+\\\]" \ "${::hex} in do_segfault \\(\\) at \[^\r\n\]+:${::segfault_line}" \ "${::decimal}\\s+\[^\r\n\]+Segfault here\[^\r\n\]+"] \ "hit the segfault" diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp index aabbb24b4d9..ba665df24ae 100644 --- a/gdb/testsuite/gdb.threads/manythreads.exp +++ b/gdb/testsuite/gdb.threads/manythreads.exp @@ -84,7 +84,7 @@ proc interrupt_and_wait { message } { # [New Thread NNN] # [New Thread NNN] # ... pages of new threads output ... - # [Switching to Thread NNN] + # [Switching to thread NNN] # foo () at foo.c:31 # 31 bar (); # diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp index 7a887d7d184..af2fa6d10bb 100644 --- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp @@ -173,9 +173,10 @@ proc test {non_stop displaced third_thread} { incr stepi_new_thread_count exp_continue } - -re "^\\\[Switching to Thread\[^\r\n\]+\\\]\r\n" { + -re "^\\\[Switching to thread\[^\r\n\]+\\\]\r\n" { + puts "XXX: Consume switching to thread line" verbose -log "XXX: Consume switching to thread line" - exp_continue + fail $gdb_test_name } -re "^\\s*\r\n" { verbose -log "XXX: Consume blank line" -- 2.43.0 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928