From patchwork Sat Mar 23 20:27:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 87596 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F18123858C66 for ; Sat, 23 Mar 2024 20:32:01 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E5F35385840A for ; Sat, 23 Mar 2024 20:31:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5F35385840A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E5F35385840A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711225895; cv=none; b=qvigEFmJBQBfF3cY3ad+xNRFO57RbcYilpyxve28JSqXqkxRJfdkDeL61Obyp3WIBQYs6mrbbh6EgKKhqLg14wcJvramGRYiykDKr78U0UyoJHXqLLBmUOn5YEP4QRreQ6B1qmtmgqFENvVCQ+JPywdut4FXtp2Mr8lhtE7gQao= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711225895; c=relaxed/simple; bh=OP+Jx+0WjmXHCRMfTcDs4pDY/zD7faBzLZ9I93NkYUA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GqLc9VtdbS6QscOASwFEcWMlh88bl+RO3b7GQWjcMymc3DQSt2b+47IaJtxzjUKlAQV/jya3KBuOMfZQ+CCHjO+JLf2WfGCSDca0OEdPOFdn5SZXtVSeszvpi3Qe+N3D6qOjPhRBQbvME26okU+Ucm40/TkyhFQEgGIITujjH5I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711225889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pwOTDZfQ1OnTayyQcTQ98ezLAUsRHI/H0pWzU/F/rhg=; b=CeXK3cFTNqzXdIkwjMfjDzb6YWAmlKqraUwFy4t7SzZXH/YFpe5mel/4Ie+n6L+DcFCjbE bKzLcneJMVFtKugMkXe9LxSD8SeLWTH5U+ozKGjBHarIBLmYXbCIfcZbazPk//F5ovV6qK XDPiw/vSSbZ69H1FuP2hdJ01fBq+6nA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-550-vCaPSRK7OKeSv8p6F-tJkQ-1; Sat, 23 Mar 2024 16:31:27 -0400 X-MC-Unique: vCaPSRK7OKeSv8p6F-tJkQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4EDD18D26F9 for ; Sat, 23 Mar 2024 20:31:27 +0000 (UTC) Received: from f39-1.lan (unknown [10.22.10.134]) by smtp.corp.redhat.com (Postfix) with ESMTP id E50501C060A6; Sat, 23 Mar 2024 20:31:26 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH 2/2] Make thread_db_target::pid_to_str checkpoint-aware Date: Sat, 23 Mar 2024 13:27:41 -0700 Message-ID: <20240323203056.1793487-3-kevinb@redhat.com> In-Reply-To: <20240323203056.1793487-1-kevinb@redhat.com> References: <20240323203056.1793487-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.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 prevents thread_db_target::pid_to_str from considering a checkpoint as a thread. The reason for doing this is that pids associated with checkpoints can never be a thread due to the fact that checkpoints (which are implemented by forking a process) can only work with single-threaded processes. Without this commit, many of the "info checkpoints" commands in gdb.multi/checkpoint-multi.exp will incorrectly show some of the checkpoints as threads. E.g... * 4 Thread 0x7ffff7cd3740 (LWP 134952) (main process) at 0x401199, file hello.c, line 51 10 process 134965 at 0x401199, file hello.c, line 51 11 process 134966 at 0x401199, file hello.c, line 51 1 process 134957 (main process) at 0x401258, file goodbye.c, line 62 + 6 Thread 0x7ffff7cd3740 (LWP 134961) at 0x401258, file goodbye.c, line 62 + 7 Thread 0x7ffff7cd3740 (LWP 134962) (main process) at 0x40115c, file hangout.c, line 31 9 process 134964 at 0x40115c, file hangout.c, line 31 With this commit in place, the output looks like this instead: * 4 process 136679 (main process) at 0x401199, file hello.c, line 51 10 process 136692 at 0x401199, file hello.c, line 51 11 process 136693 at 0x401199, file hello.c, line 51 1 process 136683 (main process) at 0x401258, file goodbye.c, line 62 + 6 process 136688 at 0x401258, file goodbye.c, line 62 + 7 process 136689 (main process) at 0x40115c, file hangout.c, line 31 9 process 136691 at 0x40115c, file hangout.c, line 31 (For brevity, I've removed the directory elements in each of the paths above.) The testcase, gdb.multi/checkpoint-multi.exp, has been updated to reflect the fact that only "process" should now appear in output from "info checkpoints". --- gdb/linux-thread-db.c | 4 +- gdb/testsuite/gdb.multi/checkpoint-multi.exp | 334 +++++++++---------- 2 files changed, 170 insertions(+), 168 deletions(-) diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 34a39899eeb..ea2eeeda198 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -49,6 +49,7 @@ #include "gdbsupport/pathstuff.h" #include "valprint.h" #include "cli/cli-style.h" +#include "linux-fork.h" /* GNU/Linux libthread_db support. @@ -1658,7 +1659,8 @@ thread_db_target::pid_to_str (ptid_t ptid) { thread_info *thread_info = current_inferior ()->find_thread (ptid); - if (thread_info != NULL && thread_info->priv != NULL) + if (thread_info != NULL && thread_info->priv != NULL + && !forks_exist_p (current_inferior ())) { thread_db_thread_info *priv = get_thread_db_thread_info (thread_info); diff --git a/gdb/testsuite/gdb.multi/checkpoint-multi.exp b/gdb/testsuite/gdb.multi/checkpoint-multi.exp index 98f6e0ae933..52a2f870c3c 100644 --- a/gdb/testsuite/gdb.multi/checkpoint-multi.exp +++ b/gdb/testsuite/gdb.multi/checkpoint-multi.exp @@ -168,7 +168,7 @@ with_test_prefix "check continue to exit on non-checkpointed inferior" { gdb_test "continue" "Inferior 1.*? exited normally.*" } -set thr_or_proc "(?:process $::decimal|Thread $::hex \\(LWP $::decimal\\))" +set proc_re "(?:process $::decimal)" set main_proc "\\(main process\\)" set hello_c "hello\\.c" set goodbye_c "goodbye\\.c" @@ -178,29 +178,29 @@ with_test_prefix "two inferiors with checkpoints" { start_2_inferiors_catchpoint_on_inf_2 gdb_test "info checkpoints" \ [multi_line \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 1" gdb_test "checkpoint" "checkpoint 3: fork returned pid $::decimal.*" \ "checkpoint in inferior 1" gdb_test "info checkpoints" \ [multi_line \ - "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\* 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 2" gdb_test "restart 0" \ "\\\[Switching to inferior 2.*?mailand.*?glob = 46;.*" gdb_test "next" "\}" - gdb_test "restart 1" "^Switching to $thr_or_proc.*?#0 main \\(\\) at.*?$goodbye_c.*mailand\\(\\);" + gdb_test "restart 1" "^Switching to $proc_re.*?#0 main \\(\\) at.*?$goodbye_c.*mailand\\(\\);" gdb_test "info checkpoints" \ [multi_line \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 3" # Doing "info_checkpoints" twice in a row might seem pointless, @@ -209,23 +209,23 @@ with_test_prefix "two inferiors with checkpoints" { # produce the same output. gdb_test "info checkpoints" \ [multi_line \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 4" # Switch back to checkpoint 0; again, there should be no # "Switching to inferior" message. - gdb_test "restart 0" "^Switching to $thr_or_proc.*?#0 mailand \\(\\) at.*?$goodbye_c.*\}" \ + gdb_test "restart 0" "^Switching to $proc_re.*?#0 mailand \\(\\) at.*?$goodbye_c.*\}" \ "restart 0 #2" gdb_test "info checkpoints" \ [multi_line \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\* 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 5" # Switch to checkpoint 3; this time, we should see a "Switching to @@ -235,10 +235,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\* 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 6" gdb_test "restart 1" \ @@ -247,10 +247,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 7" gdb_test "checkpoint" "checkpoint 4: fork returned pid $::decimal.*" \ @@ -258,11 +258,11 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 4 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 8" gdb_test "checkpoint" "checkpoint 5: fork returned pid $::decimal.*" \ @@ -270,25 +270,25 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 4 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 5 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 9" gdb_test "continue" \ - "Inferior 2 \\(process $decimal\\) exited normally.*?Switching to $thr_or_proc.*?" \ + "Inferior 2 \\(process $decimal\\) exited normally.*?Switching to $proc_re.*?" \ "continue to exit in checkpoint 1" gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 5 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 4 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 5 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 10" gdb_test "continue" \ @@ -297,10 +297,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 4 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 11" gdb_test "continue" \ @@ -309,8 +309,8 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" ] \ "info checkpoints 12" gdb_test "checkpoint" "checkpoint 7: fork returned pid $::decimal.*" \ @@ -321,11 +321,11 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 6 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 7 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 8 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\* 6 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 7 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 8 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 13" gdb_test "delete checkpoint 6" \ @@ -340,10 +340,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 8 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\* 7 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 8 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 14" gdb_test "delete checkpoint 8" \ @@ -351,8 +351,8 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" ] \ "info checkpoints 15" gdb_test "checkpoint" "checkpoint 10: fork returned pid $::decimal.*" \ @@ -360,10 +360,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\* 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 16" gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \ @@ -371,10 +371,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - " 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - "\\* 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + " 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + "\\* 3 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 17" gdb_test "kill" "\\\[Inferior 1 \\(process $::decimal\\) killed\\\]" \ @@ -383,8 +383,8 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 18" gdb_test "checkpoint" "The program is not being run\\." \ @@ -394,8 +394,8 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 19" gdb_test "checkpoint" "checkpoint 12: fork returned pid $::decimal.*" \ @@ -403,10 +403,10 @@ with_test_prefix "two inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\* 11 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 12 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\* 11 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 12 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 20" } @@ -415,8 +415,8 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \ "info checkpoints 1" # Add a third inferior and exec into it. @@ -445,10 +445,10 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 2" gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \ @@ -459,12 +459,12 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 3" gdb_test "restart 1" \ @@ -473,12 +473,12 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 4" gdb_test "next" "foo\\(glob\\);" @@ -488,13 +488,13 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 5" gdb_test "inferior 3" "Switching to inferior 3.*?alarm \\(30\\);" \ @@ -502,13 +502,13 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 6" gdb_test "kill" "\\\[Inferior 3 \\(process $::decimal\\) killed\\\]" \ @@ -517,11 +517,11 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - " 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + " 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 7" gdb_test "delete checkpoint 0" \ @@ -529,10 +529,10 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - "\\+ 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - " 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + "\\+ 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + " 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 8" gdb_test "restart 6" \ @@ -540,10 +540,10 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\* 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 9" gdb_test "inferior 3" "\\\[Switching to inferior 3 \\\[\\\] \\(.*?$::exec3\\)\\\]" \ @@ -551,10 +551,10 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \ "info checkpoints 10" gdb_test "start" "Starting program.*?hangout.*?alarm \\(30\\);" @@ -567,13 +567,13 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 8 $thr_or_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 8 $proc_re at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 11" gdb_test "delete checkpoint 8" \ @@ -581,12 +581,12 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 12" # Switch to inferior 1, add another checkpoint - so that there are @@ -608,13 +608,13 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 5 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 10 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 13" # Check that deleting active checkpoints in other (non-current) @@ -629,12 +629,12 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 10 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 14" gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \ @@ -642,12 +642,12 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 10 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 15" gdb_test "checkpoint" "checkpoint 11: fork returned pid $::decimal.*" \ @@ -655,13 +655,13 @@ with_test_prefix "three inferiors with checkpoints" { gdb_test "info checkpoints" \ [multi_line \ - "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \ - " 10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 11 $thr_or_proc at $::hex, file.*?$hello_c.*?" \ - " 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \ - "\\+ 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \ - " 9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \ + "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \ + " 10 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 11 $proc_re at $::hex, file.*?$hello_c.*?" \ + " 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \ + "\\+ 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \ + " 9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \ "info checkpoints 16" gdb_test "x/i \$pc" "=> $::hex