-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Add debugging tips? #1690
Comments
I'd like to know how to debug the C++ code that are invoked by Python code in a similar fashion to pdb. Is there any canonical way of doing this? |
Would love to see some examples as well. Currently I'm running some C++ code through |
Low-speed follow-up, but I added some basic stuff in our fork here: Will PR some of it here, but not sure where exactly to put the docs. |
Here's an idea. Why not put the debugging tips in the community-editable github wiki? |
I've turned the Wiki on just now, let's see if people find it useful. |
Hm... Concern about the Wiki is it's kinda unclear when to add to docs vs. Wiki; but yeah, I'll do a first pass on Wiki! |
Made a first low-effort pass 😅 |
Doing a quick search of "debugging" doesn't bring up too much in the
pybind11
docs.For the repo that I work on, we've found it useful to document some debugging tips that are relevant to Python C extensions:
https://drake.mit.edu/python_bindings.html#debugging-with-the-python-bindings
Perhaps some mention of using
trace
, perhaps a small example with GDB would go a long ways?For GDB, it'd be nice to show (a) debugging a module and (b) debugging a C++ binary with an embedded interpreter.
I find that for hacking directly on
pybind11
(in things like #1325 and #1146), it's uber useful to plop into Python via an embedded interpreter, rather than debugging through thepython
executable itsefl.The text was updated successfully, but these errors were encountered: