Embedded Python Debugger

Started by
2 comments, last by renega_666 11 years, 10 months ago
I'm having some difficulties with my current project and was hopeing that I could get a little feedback on the issue of Embedded Python Debugging for games.

My project is written in C++ with Ogre3D graphics engine. I have embedded Python in the project and have done some nice things like getting the program to break when there is an exception in python, printing out errors and callstacks etc, But I am getting to the stage where debugging by print statements is just getting too slow and laborious. I have tried intergrating winpdb (http://winpdb.org/ ) into my project, but I find it to be unuseable (I hate having to connect to the process every time I launch, and it doesn't catch exceptions).

So my question is this, has anybody else embedded python in a game with a useful graphical debugger with it? I basically want something along the lines of Lua Tilde for my project.

At the moment, I'm thinking that I might have to write my own GUI Python Debugger and change the structure of my program to read from sockets that it will connect to, but before I dive in the deep end I was hopeing that somebody had a better solution.

Thanks
Advertisement
I'm curious to know too.

As you, I haven't found any easy solution for debugging my embedded python code and as I didn't wanted to go into creating my own GUI debugger I've changed my way of doing: instead of embedding, I decided to go with extending python. This approach allow me to fully debug my python code (using Pycharm debugger) and lead to a better working environment (I can still debug the c++ code using "attach to process" with CodeBlocks or KDevelop or by supplying the python executable and the main script as the project host executable).

On the performances side, I didn't notice any major performances drop going from embedded to extended (using AMD CodeAnalyst, calls to python dll remains under 0.1% (more or less what I had when embedding)) but that will depend on your specific case.

Extending python is probably the easiest way to go: you write and test performance critical systems in c++ (renderer,scene management) and you write and debug top level object (game states, component/entity system) in python from python.
I hadn't thought about extending. But at the moment, to get either it extended or writing a debugger would probably take just as much effort, so I'm leaning towards writing a debugger (also, it sounds interesting as I haven't done anything like that before). But before I dive in, I want to just make sure I am not reinventing the wheel!

Judging from the fact that nobody has already mentioned an alternative, I'm guessing that there isn't must out there to use?

[background=rgb(250, 251, 252)]to get either it extended or writing a debugger would probably take just as much effort[/background]


[/quote]

Probably not. Extending is just a matter of entry point.
If you can translate your main entry point from c++ to python, you're done.

This topic is closed to new replies.

Advertisement