Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: gdb@sourceware.org
Subject: Python debugging in gdb
Date: Mon, 10 Sep 2012 09:50:00 -0000	[thread overview]
Message-ID: <CA++fsGFHEkO+qDTN6Q7c0uBxLOS9w2X+SYYuPfyLDuyEG-D75g@mail.gmail.com> (raw)
In-Reply-To: <CA++fsGETsLexTGaaV3skfKi4znnsWBqYo-h4sothrkuREFnCxw@mail.gmail.com>

I would like to write some glue functions that allow debugging python
code within gdb. We have an embedded environment that in the call
stack calls back and forth between C++ and python multiple times. It
would be great if it was possible to debug this system in a single
environment.

To do this, I would like to define the following gdb commands:

py-break : Create a break point at line in a python file.
py-step:  Step the next python statement.
py-next : Run the next python statement.
py-finish: Finish the current python function.

In a way this would create a relationship between python and C similar
to the current difference between step and stepi, where the former
steps in the compiled language and the latter in assembler language.
So for python I would like to have one higher abstraction layer.

(It would make sense to create a dispatcher that does `py-break` on a
python file and `break` on a C++ file so you can always use the same
command to create break points.)

Is this feasible? Can someone give me some ideas and pointers of how
to go about implementing this?

Regards,
Dov


       reply	other threads:[~2012-09-10  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA++fsGETsLexTGaaV3skfKi4znnsWBqYo-h4sothrkuREFnCxw@mail.gmail.com>
2012-09-10  9:50 ` Dov Grobgeld [this message]
2012-09-10 15:05   ` Tom Tromey
2012-09-10 15:09     ` Joel Brobecker

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=CA++fsGFHEkO+qDTN6Q7c0uBxLOS9w2X+SYYuPfyLDuyEG-D75g@mail.gmail.com \
    --to=dov.grobgeld@gmail.com \
    --cc=gdb@sourceware.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