public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jan Vrany <jan.vrany@fit.cvut.cz>
To: Simon Sobisch <simonsobisch@gnu.org>, gdb@sourceware.org
Subject: Re: How to create new mi commands via python / get current interpreter in python
Date: Wed, 03 Nov 2021 09:06:40 +0000	[thread overview]
Message-ID: <b69315ab1d68d77c87daa6e2426ae5e52fd2b074.camel@fit.cvut.cz> (raw)
In-Reply-To: <253b903c-b5e3-86bd-2681-c904fb2c5d53@gnu.org>

On Tue, 2021-11-02 at 20:11 +0100, Simon Sobisch via Gdb wrote:
> That's exactly I was looking for, so sad that this isn't available in
> GDB 11 :-(

I know...

> In any case that looks quite promising, would be nice to see it at
> least 
> in a feature-branch in the official gdb repo until it is ready to be
> merged.

Good idea, I can do that. I'll post here when done.

> 
> For the "hack without a patched GDB version": do you know of a good
> way 
> to create the mi-expected message with different parameters in plain 
> python and/or a way to know which interpreter is active in the
> current 
> context of a gdb.Command?
> 

I'm not sure I 100% understand what you want to achieve, but I'm afraid
one cannot tell which interprerer was active (as of now). 
But, if inside python you do "intepreter-exec mi <some custom py
command>" you may pass down to the command option - say - `--mi` no?

HTH

> Simon
> 
> Am 02.11.2021 um 17:56 schrieb Jan Vrany:
> > Hi,
> > 
> > On Tue, 2021-11-02 at 17:40 +0100, Simon Sobisch via Gdb wrote:
> > > Additional to this question: is there an option to create new MI
> > > commands from python (instead of "console commands")
> > 
> > Sort of. This has been started by Didier Nadeau and then continued
> > by
> > me but sadly, I got carried away and have not done the last bits so
> > it
> > can be pushed.
> > 
> > However, I'm using this feature heavily and keep more-or-less
> > up-to-date GDB with this support (and some other hacks/fixes
> > waiting
> > to be polished and submitted, see
> > 
> > https://github.com/janvrany/binutils-gdb/tree/users/jv%2Fvdb
> > 
> > Here you may find example how I use it:
> > 
> >  
> > https://swing.fit.cvut.cz/hg/jv-vdb/file/tip/python/vdb/__init__.py#l329
> > 
> > Let me know if you have any questions, let me know.
> > 
> > I'd like to take the opportunity and apologise to all reviewers
> > for not finishing it yet - hopefuly I'll find long-enough period of
> > quiter time to finish this.
> > 
> > Jan
> > 
> > 



  reply	other threads:[~2021-11-03 12:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 16:40 Simon Sobisch
2021-11-02 16:56 ` Jan Vrany
2021-11-02 19:11   ` Simon Sobisch
2021-11-03  9:06     ` Jan Vrany [this message]
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

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=b69315ab1d68d77c87daa6e2426ae5e52fd2b074.camel@fit.cvut.cz \
    --to=jan.vrany@fit.cvut.cz \
    --cc=gdb@sourceware.org \
    --cc=simonsobisch@gnu.org \
    /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).