C++ debugger for python/scintilla?

Jussi Jumppanen jussij at zeusedit.com
Wed Nov 28 01:30:28 CET 2001


Ken Seehof wrote:

> Any know how I might go about implementing a C/C++ debugger in 
> python for debugging python extensions?  Is such a project being 
> worked on?

As thinks happens I have just completed adding this feature to 
the Zeus editor due for release next year :)

> Is anyone using PyGDB?  Is it what I'm looking for?  At first 
> glance, it appears to be inside-out compared to what I want. PyGDB
> apparently is a python script that uses gdb to debug python code,
> rather than a python module that debugs extensions (in other words,
> PyGDB set breakpoints in python code, but I want to set breakpoints in
> C++ code inside extensions). Perhaps I can use gdb.py directly as a
> module?

All I did was execute the script using a command line like this: 

  python.exe c:/python/lib/pdb.py example.py

then manage the running executable on behalf of the user via 
editor commands.
 
> It should run on Windoze, Lunux, and popular Unix platforms 
> (anywhere wxPython runs).

I can only talk for Windows systems. For me this approach seems 
to work fine on all versions of Windows. 

The one problem I found was that for any of the Windows MS-DOS 
based system (ie Win 95,98,Me etc) I had to add this method to 
the pdb.py before any debug output was displayed.

  # Added new method to flush buffers so Zeus can capture output
  def postcmd(self, stop, line):
     # flush the output buffers
     sys.stdout.flush()
     sys.stderr.flush()
     return stop

> Once the functionality is in place, I'd want to wrap it into 
> Scintilla to add python extension debugging capabilities to a 
> custom IDE.
>
> I'm only likely to do this project if it turns out ot be 
> relatively easy

This turns out to be pretty easy todo (for Windows anyway). One
place suggest you start is Vide. The Vide IDE has debug suppport 
for the GDB debugger and as it turns out running the python 
debugger is very similar to running the GDB debugger.

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, Emacs, etc) FTP Text Editor
"The C/C++, Java, HTML, Pascal, Cobol, Fortran programmer's text editor"
Home Page: http://www.zeusedit.com




More information about the Python-list mailing list