public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to create new mi commands via python / get current interpreter in python
@ 2021-11-02 16:40 Simon Sobisch
  2021-11-02 16:56 ` Jan Vrany
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Sobisch @ 2021-11-02 16:40 UTC (permalink / raw)
  To: gdb

It is possible to send `interpreter-exec mi "command"` from a python 
extension, but how can we check the _current_ interpreter a python 
create gdb command was executed in?

The reason: depending on the interpreter the return value should be 
different

interpreter-exec console "break"
--> returns user output (which may be parsed)

vs.
interpreter-exec mi "-break-insert"
--> returns interpreter output intended to be parsed


Additional to this question: is there an option to create new MI 
commands from python (instead of "console commands"), or python helper 
functions which provide better ways to return mi-messages than plain 
"print" with self-formatting?

Thanks for any insights,
Simon

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

end of thread, other threads:[~2021-11-26 13:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 16:40 How to create new mi commands via python / get current interpreter in python Simon Sobisch
2021-11-02 16:56 ` Jan Vrany
2021-11-02 19:11   ` Simon Sobisch
2021-11-03  9:06     ` Jan Vrany
2021-11-05 18:51       ` Jan Vrany
2021-11-05 21:18         ` feature branch for creating MI commands with python (was: How to create new mi commands via python / get current interpreter in python) Simon Sobisch
2021-11-23 12:29           ` Jan Vrany
2021-11-23 12:48             ` Lancelot SIX
2021-11-23 16:28               ` Jan Vrany
2021-11-03 16:31   ` How to get the full source location of a frame via python Simon Sobisch
2021-11-03 20:07     ` Jan Vrany
2021-11-03 20:35       ` Simon Sobisch
2021-11-03 20:50   ` UnicodeDecodeError on gdb.execute Simon Sobisch
2021-11-03 21:55   ` Is "forward-search" also possible case insensitive? Simon Sobisch
2021-11-05  9:14   ` Is there a way to know about current "until"/"advance" execution? Simon Sobisch
2021-11-22 14:54   ` Is there a way to get a function's end address other than `disassemble`? Simon Sobisch
2021-11-22 15:14     ` Andreas Schwab
2021-11-22 15:17       ` Simon Sobisch
2021-11-25 19:28   ` Broken source view with Pygments and non-UTF-8 encoded source Simon Sobisch
2021-11-26 11:16     ` Andrew Burgess
2021-11-26 13:39       ` Andrew Burgess

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