From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB7A43858D1E; Thu, 13 Jul 2023 17:43:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB7A43858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689270221; bh=gvhwJ+VQ7NLNBFkQQM1XQFbEIccC8wlp2VW/VcqyjPc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tw9KmnbGpAYuaPpnYmmSSKk5BeWq6MRihXmUGdy7lpRFB0tdxNXAoPWiFCjstqnHs HleoSi1SYPjixc3EcUnL8KvsjZkOPXUuEkSTPXZRwTHT2iGd6gOCd1VnaKr2Fdzked UH3eVPKf7mbIVP7lAZp3Pxi2YA6EdQvKCP9BHvA8= From: "pedro at palves dot net" To: gdb-prs@sourceware.org Subject: [Bug gdb/30541] Add target valgrind Date: Thu, 13 Jul 2023 17:43:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30541 --- Comment #32 from Pedro Alves --- > We prefer vgdb being launched from within gdb (target extended-remote | v= gdb --multi)=20 > and get the environment/cwd inherited that way. > But currently that means vgdb will communicate through stdin/out with gdb= , so=20 > stdin/out aren't available for the inferior. This is being worked on by S= asha for=20 > https://sourceware.org/bugzilla/show_bug.cgi?id=3D28916 at=20 > https://git.sr.ht/~sasshka/binutils-gdb/log/split_fd but we aren't there = yet=20 > (switching the file descriptors used for communication seems to work, but= the whole=20 > terminal handling is a little complex). Not sure if I fully understood that approach. But, wouldn't it be simpler to teach GDB an alternative to "target extended-remote | CMD". Like: target extended-remote -server-cmd "vgdb --multi :9999" :9999 "-server-cmd CMD" would spawn CMD, and GDB would wait/reap it like it does = for "target extended-remote | CMD". You could replace ":9999" with a unix domain socket, created by the "target valgrind" command, for example. That would leave stdin/stdout/stderr to be used by gdbserver as normal. Terminal handling, for getting input into the inferior, yeah, that is a lit= tle complex. You have to put vgdb in the foreground whenever gdb wants to give = the terminal to the inferior. --=20 You are receiving this mail because: You are on the CC list for the bug.=