public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jan Vrany <jan@vrany.io>
To: Paul Koning <paulkoning@comcast.net>, gdb@sourceware.org
Subject: Re: Executing a CLI command from Python
Date: Wed, 15 Feb 2023 22:25:37 +0000	[thread overview]
Message-ID: <744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io> (raw)
In-Reply-To: <EC5C6352-E2A7-4C8C-8F6C-4998C3001411@comcast.net>

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 (addresses etc.) then issue an "add-symbol-file" command using parameters constructed 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#Basic-Python

HTH, Jan

> 	paul
>



  reply	other threads:[~2023-02-15 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 21:50 Paul Koning
2023-02-15 22:25 ` Jan Vrany [this message]
2023-02-16  0:29   ` Paul Koning
2023-03-03  9:01 ` anix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io \
    --to=jan@vrany.io \
    --cc=gdb@sourceware.org \
    --cc=paulkoning@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).