From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vDjtDBZc7WPvcDQAWB0awg (envelope-from ) for ; Wed, 15 Feb 2023 17:26:30 -0500 Received: by simark.ca (Postfix, from userid 112) id 298261E221; Wed, 15 Feb 2023 17:26:30 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=alzRIchI; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A49471E110 for ; Wed, 15 Feb 2023 17:26:29 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E54EA3858033 for ; Wed, 15 Feb 2023 22:26:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E54EA3858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676499987; bh=Cs6LNUd1yGxGwLu3PhjNCAP1Zf41ySVoqr+P8WoQUgg=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=alzRIchI8j4dmpgsJag44rpfQA0lot/5Dpo8SoZ8c0zWhXjoTggFTdg4/8ScOO87T cUc/R8cIme5XUqKhQO4Tas3pq2cp/gZVA5aZy4JoISrodvwgT7TqnbQrVBZZxErbOU kyouCMHlZUCyRTJhQ9dUxW3wQn1z8c8LuNTcBAnU= Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by sourceware.org (Postfix) with ESMTPS id 6FC6A3858D33 for ; Wed, 15 Feb 2023 22:25:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FC6A3858D33 Date: Wed, 15 Feb 2023 22:25:37 +0000 To: Paul Koning , gdb@sourceware.org Subject: Re: Executing a CLI command from Python Message-ID: <744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io> In-Reply-To: References: Feedback-ID: 40767693:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jan Vrany via Gdb Reply-To: Jan Vrany Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" 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? > > For example, I want to look up information about a kernel module (address= es etc.) then issue an "add-symbol-file" command using parameters construct= ed from what was looked up. > I think this can be done with gdb.execute (): https://sourceware.org/gdb/current/onlinedocs/gdb.html/Basic-Python.html#Ba= sic-Python HTH, Jan > =09paul >