From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resdmta-a1p-077302.sys.comcast.net (resdmta-a1p-077302.sys.comcast.net [IPv6:2001:558:fd01:2bb4::c]) by sourceware.org (Postfix) with ESMTPS id E79613858D33 for ; Thu, 16 Feb 2023 01:06:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E79613858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=comcast.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=comcast.net Received: from resomta-a1p-076783.sys.comcast.net ([96.103.145.231]) by resdmta-a1p-077302.sys.comcast.net with ESMTP id SH50pawYYGoOySSj7paVND; Thu, 16 Feb 2023 01:06:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1676509581; bh=bg5CeDfA1xxLmvf6VBgy5oroLqYB4uTMXQuSEK1DYYM=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To:Xfinity-Spam-Result; b=VEX6unCQLQMcF+92x99iHYgooV2TdlAZO6YEZkiE6eV+TMGcqzqobx6Whjqc9v0z6 v1UhO/2SlE5AA6aG9kNGBb1D0OrY4WrcdLtQ+Mhlavlk8s+SJH1SPW4baJXUAS70Qj +PBLgW9exSHniWZFU8NQDwze7DlBKUyPwUgk1+lpj4keprIgnU4RywYS2tSeZ9jkcv EE+/UkVzObqEhEH6fgsauASUyDeT8NTGQBHxF1pOsAOhfMbufISvnzirLbWHoLrMp9 Ii9Ovt4dbF1jfcsmSm/Wbsi5rJ7SsppVjJ04TPB6fAwmtCOExssPvuYK3a9OXQZavm /Op2lpUiJ6g7w== Received: from smtpclient.apple ([73.60.223.101]) by resomta-a1p-076783.sys.comcast.net with ESMTPSA id SSiepxWVXbP5kSSikpaUfe; Thu, 16 Feb 2023 01:05:59 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedvhedrudeiiedgfedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedtudenucenucfjughrpegtggfuhfgjffevgffkfhfvofesthhqmhdthhdtvdenucfhrhhomheprfgruhhlucfmohhnihhnghcuoehprghulhhkohhnihhnghestghomhgtrghsthdrnhgvtheqnecuggftrfgrthhtvghrnheptdfhudegffekieeugeduudfhudfhhfelleejteeuiefgjeeitddtuddtveehgfeknecuffhomhgrihhnpehsohhurhgtvgifrghrvgdrohhrghenucfkphepjeefrdeitddrvddvfedruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehsmhhtphgtlhhivghnthdrrghpphhlvgdpihhnvghtpeejfedriedtrddvvdefrddutddupdhmrghilhhfrhhomhepphgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjhgrnhesvhhrrghnhidrihhopdhrtghpthhtohepghgusgesshhouhhrtggvfigrrhgvrdhorhhg X-Xfinity-VMeta: sc=0.00;st=legit Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Subject: Re: Executing a CLI command from Python From: Paul Koning In-Reply-To: <744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io> Date: Wed, 15 Feb 2023 19:29:33 -0500 Cc: gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io> To: Jan Vrany X-Mailer: Apple Mail (2.3696.120.41.1.2) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS,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 List-Id: > On Feb 15, 2023, at 5:25 PM, Jan Vrany via Gdb = wrote: >=20 > On Wed, 2023-02-15 at 16:50 -0500, Paul Koning via Gdb wrote: >> I looked through the Python GDB API documentation but didn't see = this: is there a way for Python code to ask GDB to execute a command? >>=20 >> For example, I want to look up information about a kernel module = (addresses etc.) then issue an "add-symbol-file" command using = parameters constructed from what was looked up. >>=20 > I think this can be done with gdb.execute (): >=20 > = https://sourceware.org/gdb/current/onlinedocs/gdb.html/Basic-Python.html#B= asic-Python Sure looks like it. Thanks Jan. I didn't think to look in "basic" for = that feature. paul