Bugs item #456738, was opened at 2001-08-29 19:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470 Category: Python Interpreter Core Group: Feature Request >Status: Closed >Resolution: Out of Date Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Support for smoother debugging of C exts Initial Comment: With every new Python release, the first thing that I do is modify Modules/main.c to add an empty function called void Py_DebugTrap(void) { return; } The purpose of this function is to give me a handy place to set a breakpoint so that I can debug my C/C++ extension modules. It occured to me that this handy trick might be more generally useful and worthy of inclusion in the standard distributions. Thoughts? -- Michael Aivazis (aivazis@caltech.edu) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2001-12-11 21:33 Message: Logged In: YES user_id=6380 Nothing happened in three months. Closing for lack of interest. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-05 23:59 Message: Logged In: YES user_id=21627 In a private conversation, Michael volunteered to contribute a patch for that, including documentation, wrapper macros, and whatever else he considers necessary. So I propose not to act on that report for a few weeks, to see whether we get a contribution of a fix. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 10:55 Message: Logged In: YES user_id=6380 I don't see why Barry should do this (he doesn't seem interested), so unassigning, on the theory that Jeremy randomly assigned it. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2001-09-04 02:44 Message: Logged In: YES user_id=45365 I think I would like this feature. Actually, I think it would even be nice to export it to Python (through sys?). There's something similar in MacPython (the MacOS DebugStr() routine) and I use it a lot. The advantage of a separate routine (as opposed to setting a breakpoint) is that you can put complex conditions in your code for when you want to call the routine. This could conceivably be done with conditional breakpoints too, but it tends to be much more of a hassle. Especially going from Python code to the C debugger at a specific point is pretty difficult. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2001-09-03 14:36 Message: Logged In: YES user_id=21627 I don't think this is universally useful. It seems that, at a minimum, you have to add calls to Py_DebugTrap into the module to make it useful, right? Then why can't you just set breakpoints on the lines that you want to call Py_DebugTrap? If the problem is that you cannot set a breakpoint on code that is not yet loaded, I can give you a number of alternatives: - any advanced debugger should offer to break when a shared library is loaded. gdb does. - you can set a breakpoint on Py_InitModule4 (or whatever your extension module calls) - you can set a breakpoint on dlsym (or whatever your shared library system uses to find the address of the init function) - you can statically link your extension module into the Python interpreter, and avoid DLL problems altogether. If these suggestions don't address your problem, please explain in more detail what your problem is. Otherwise, I propose to close this report as "won't fix". ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456738&group_id=5470
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4