public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Executing a CLI command from Python
@ 2023-02-15 21:50 Paul Koning
  2023-02-15 22:25 ` Jan Vrany
  2023-03-03  9:01 ` anix
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Koning @ 2023-02-15 21:50 UTC (permalink / raw)
  To: gdb

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.

	paul


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Executing a CLI command from Python
  2023-02-15 21:50 Executing a CLI command from Python Paul Koning
@ 2023-02-15 22:25 ` Jan Vrany
  2023-02-16  0:29   ` Paul Koning
  2023-03-03  9:01 ` anix
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Vrany @ 2023-02-15 22:25 UTC (permalink / raw)
  To: Paul Koning, 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 (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
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Executing a CLI command from Python
  2023-02-15 22:25 ` Jan Vrany
@ 2023-02-16  0:29   ` Paul Koning
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Koning @ 2023-02-16  0:29 UTC (permalink / raw)
  To: Jan Vrany; +Cc: gdb



> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Executing a CLI command from Python
  2023-02-15 21:50 Executing a CLI command from Python Paul Koning
  2023-02-15 22:25 ` Jan Vrany
@ 2023-03-03  9:01 ` anix
  1 sibling, 0 replies; 4+ messages in thread
From: anix @ 2023-03-03  9:01 UTC (permalink / raw)
  To: Paul Koning, gdb

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

dear:


now, i see that problem for half-precision floating-point value.
for intel&nbsp; IA-32, there are not its instructin.


&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;niu wensheng
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mar, 3, 2023



---Original---
From: "Paul Koning via Gdb"<gdb@sourceware.org&gt;
Date: Thu, Feb 16, 2023 05:50 AM
To: "gdb"<gdb@sourceware.org&gt;;
Subject: Executing a CLI command from Python


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.

paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-03  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 21:50 Executing a CLI command from Python Paul Koning
2023-02-15 22:25 ` Jan Vrany
2023-02-16  0:29   ` Paul Koning
2023-03-03  9:01 ` anix

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).