From patchwork Sat Dec 3 21:13:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 61455 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 D84C43858291 for ; Sat, 3 Dec 2022 21:14:10 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id 0F5E73858D39 for ; Sat, 3 Dec 2022 21:13:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F5E73858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id ay8-20020a05600c1e0800b003d0808d2826so3939762wmb.1 for ; Sat, 03 Dec 2022 13:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3/XM98hopY1uti+3dEYPcS9TeeducasKhp1aIvfPqaA=; b=Zl5Z9IjEDdC0KhMoUDSFoXIYALPfPXiFjhUlT4C4IxPWfkcb3tA93UWyFnViIHRpq8 7YieCR2jBAVTSViuMVbzL8joLGs0uocy7glou16Gc4/15DpNhv5M09ixN3mQEvxoID8Y 0/Iat7Gu/HhNSl3Oqpbeqpw2rg6ZHxaUDncewmkgkaygbriQdfbYwOUmEoXG52ikcrv9 2IJ6qvR3eeI0sD0m9Bx7M5H8huKpbBSeH7v29dnM59bVPl+1ZgkWgr+xeT5EpU/u7WtW hnx90NbjQ1K8T9OLK4bfgyKEExWIEKj7H7PfZZc3aAOloyHIa47RgStVzzURFxxJY9Ws wSRA== X-Gm-Message-State: ANoB5plmAYzR/t31P0aPaANN6lWey9HhdB+s+nCs+7OwirTrOgl478sx rnzp9vyk5/a+twSQAI8rjBCcQ/IXNkkykQ== X-Google-Smtp-Source: AA0mqf4VNuOB02zroE3A2+A1ZIE37FTWpXacOxiK3RM0z3YxtEIeqsDdv+AnpLjQwO9e4Wsdy28JXQ== X-Received: by 2002:a05:600c:1d23:b0:3d0:8193:c1c with SMTP id l35-20020a05600c1d2300b003d081930c1cmr7562015wms.143.1670102022774; Sat, 03 Dec 2022 13:13:42 -0800 (PST) Received: from localhost ([2001:8a0:f912:6700:afd9:8b6d:223f:6170]) by smtp.gmail.com with ESMTPSA id i10-20020a1c540a000000b003cfc02ab8basm15774332wmb.33.2022.12.03.13.13.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Dec 2022 13:13:42 -0800 (PST) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/6] Tweak "Using the running image of ..." output Date: Sat, 3 Dec 2022 21:13:33 +0000 Message-Id: <20221203211338.2264994-2-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20221203211338.2264994-1-pedro@palves.net> References: <20221203211338.2264994-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-9.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_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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.29 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 Sender: "Gdb-patches" Currently, "info files" and "info program" on a few native targets show: (gdb) info files Symbols from "/home/pedro/gdb/tests/threads". Native process: Using the running image of child Thread 0x7ffff7d89740 (LWP 1097968). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... (gdb) info program Using the running image of child Thread 0x7ffff7d89740 (LWP 1097968). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Program stopped at 0x555555555278. ... This patch changes them to: (gdb) info files Symbols from "/home/pedro/gdb/tests/threads". Native process: Using the running image of child process 1097968. ^^^^^^^^^^^^^^^ ... (gdb) info program Using the running image of child process 1097968. ^^^^^^^^^^^^^^^ Program stopped at 0x555555555278. ... ... which I think makes a lot more sense in this context. The "info program" manual entry even says: "Display information about the status of your program: whether it is running or not, what process it is, and why it stopped." ^^^^^^^^^^^^^ This change affects ptrace targets, procfs targets, and Windows. Change-Id: I6aab061ff494a84ba3398cf98fd49efd7a6ec1ca --- gdb/inf-ptrace.c | 2 +- gdb/nto-procfs.c | 2 +- gdb/procfs.c | 2 +- gdb/windows-nat.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index ab669a7acc2..ade07f41ef4 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -522,7 +522,7 @@ inf_ptrace_target::files_info () gdb_printf (_("\tUsing the running image of %s %s.\n"), inf->attach_flag ? "attached" : "child", - target_pid_to_str (inferior_ptid).c_str ()); + target_pid_to_str (ptid_t (inf->pid)).c_str ()); } std::string diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 4a2968ea179..fe9aa8dabfa 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -658,7 +658,7 @@ nto_procfs_target::files_info () gdb_printf ("\tUsing the running image of %s %s via %s.\n", inf->attach_flag ? "attached" : "child", - target_pid_to_str (inferior_ptid).c_str (), + target_pid_to_str (ptid_t (inf->pid)).c_str (), (nodestr != NULL) ? nodestr : "local node"); } diff --git a/gdb/procfs.c b/gdb/procfs.c index ac3d60ebf1c..ffc26c8fb9e 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2533,7 +2533,7 @@ procfs_target::files_info () gdb_printf (_("\tUsing the running image of %s %s via /proc.\n"), inf->attach_flag? "attached": "child", - target_pid_to_str (inferior_ptid).c_str ()); + target_pid_to_str (ptid_t (inf->pid)).c_str ()); } /* Make it die. Wait for it to die. Clean up after it. Note: this diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index b3329cd1a0d..ee4e78bdabf 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2157,7 +2157,7 @@ windows_nat_target::files_info () gdb_printf ("\tUsing the running image of %s %s.\n", inf->attach_flag ? "attached" : "child", - target_pid_to_str (inferior_ptid).c_str ()); + target_pid_to_str (ptid_t (inf->pid)).c_str ()); } /* Modify CreateProcess parameters for use of a new separate console.