From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F13F93856944; Thu, 15 Jun 2023 17:04:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F13F93856944 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686848666; bh=4+gG/3/ScQ47gezhK9SzoO3848z1lfc9uLlqPBZIdYE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sRbxflc2JyoiD2fw5st84FDGSPnQ7uYzn8xl+sUax9XqGTWuI6/Uievr0pq5BUVfx w4s+qPCfCEFaNrknusEleTmxV0KAcOXjN+Av1Yxu7Wq2EIRqGSUbXVdOpqacPA5mIK 4q0x+tKb/BhmYF3CWjbP90f+83da0cC/FvRLnJQ8= From: "pedro at palves dot net" To: gdb-prs@sourceware.org Subject: [Bug gdb/30541] Add target valgrind Date: Thu, 15 Jun 2023 17:04:26 +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 #8 from Pedro Alves --- > user-defined commands don't have a $@ or $* like shells as far as I know Yeah. There's $argc, and then $arg0..$argN, though. So you can loop over = the arguments and build the valgrind command that way. You'd probably use Pyth= on to actually concatenate the strings. > I guess this would be easier in Python but I'm a bit useless at scripting. I guess you'd start with something like this: $ cat target-valgrind.py import gdb class TargetValgrind(gdb.Command): def __init__(self): super(TargetValgrind, self).__init__("target valgrind", gdb.COMMAND_USER) def invoke(self, arg, from_tty): gdb.execute("target extended-remote | vgdb --multi " + " ".join(arg.split())) TargetValgrind() Source that in gdb, and then enter "(gdb) target valgrind foo bar" --=20 You are receiving this mail because: You are on the CC list for the bug.=