From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id B00253858D32; Mon, 27 Feb 2023 19:14:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B00253858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677525266; bh=GDkTt4ZjNaUylmuSc/ljkAvHXFUgixXqyXS55kSXEks=; h=From:To:Subject:Date:From; b=DyRSQ3W1kR8H+1Zzu4qPeaaGOkkzJzTbnbxwrS7btbyoWNpMykdQ2Hbt+xW4mNklt Wvv2yX98OLR2YFnLN1kJIYc841zJFAllHOGL6Qn26q4lP6CRuL2NwOGDeV8DfbiZL9 Y1HMgSljD0GMR0KAtReXaytTcABF6tdjSH3iY5EQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Tweak "Using the running image of ..." output X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 13ee5410707d0487fbd97c91b83280d169b5a654 X-Git-Newrev: fb6d30e013edc16cc830447a7115c0a5189f753f Message-Id: <20230227191426.B00253858D32@sourceware.org> Date: Mon, 27 Feb 2023 19:14:26 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfb6d30e013ed= c16cc830447a7115c0a5189f753f commit fb6d30e013edc16cc830447a7115c0a5189f753f Author: Pedro Alves Date: Sat Dec 3 16:20:51 2022 +0000 Tweak "Using the running image of ..." output =20 Currently, "info files" and "info program" on a few native targets show: =20 (gdb) info files Symbols from "/home/pedro/gdb/tests/threads". Native process: Using the running image of child Thread 0x7ffff7d89740 (LWP 10= 97968). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^ ... =20 (gdb) info program Using the running image of child Thread 0x7ffff7d89740 (LWP 10= 97968). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^ Program stopped at 0x555555555278. ... =20 =20 This patch changes them to: =20 (gdb) info files Symbols from "/home/pedro/gdb/tests/threads". Native process: Using the running image of child process 1097968. ^^^^^^^^^^^^^^^ ... =20 (gdb) info program Using the running image of child process 1097968. ^^^^^^^^^^^^^^^ Program stopped at 0x555555555278. ... =20 =20 ... which I think makes a lot more sense in this context. The "info program" manual entry even says: =20 "Display information about the status of your program: whether it is running or not, what process it is, and why it stopped." ^^^^^^^^^^^^^ =20 This change affects ptrace targets, procfs targets, and Windows. =20 Approved-By: Simon Marchi Change-Id: I6aab061ff494a84ba3398cf98fd49efd7a6ec1ca Diff: --- 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 a3351658705..ececf0e9498 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -522,7 +522,7 @@ inf_ptrace_target::files_info () =20 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 ()); } =20 std::string diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index ffe11c69abf..8e40efa31fc 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -658,7 +658,7 @@ nto_procfs_target::files_info () =20 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 !=3D NULL) ? nodestr : "local node"); } =20 diff --git a/gdb/procfs.c b/gdb/procfs.c index 2c009c3e320..741e62a2402 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2533,7 +2533,7 @@ procfs_target::files_info () =20 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 ()); } =20 /* 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 a8ce05393b9..26ad04b27be 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2123,7 +2123,7 @@ windows_nat_target::files_info () =20 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 ()); } =20 /* Modify CreateProcess parameters for use of a new separate console.