From: Paul Koning <paulkoning@comcast.net>
To: Jan Vrany <jan@vrany.io>
Cc: gdb@sourceware.org
Subject: Re: Executing a CLI command from Python
Date: Wed, 15 Feb 2023 19:29:33 -0500 [thread overview]
Message-ID: <B2020401-3F9B-469F-9639-06A0F6F67BE9@comcast.net> (raw)
In-Reply-To: <744609d04637cc9f9057ba21b94b6bde0d931453.camel@vrany.io>
> On Feb 15, 2023, at 5:25 PM, Jan Vrany via Gdb <gdb@sourceware.org> wrote:
>
> 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
Sure looks like it. Thanks Jan. I didn't think to look in "basic" for that feature.
paul
next prev parent reply other threads:[~2023-02-16 1:06 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
2023-02-16 0:29 ` Paul Koning [this message]
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=B2020401-3F9B-469F-9639-06A0F6F67BE9@comcast.net \
--to=paulkoning@comcast.net \
--cc=gdb@sourceware.org \
--cc=jan@vrany.io \
/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).