Launching Python debugger from embedded Python

Mark Hammond mhammond at skippinet.com.au
Wed Nov 24 04:46:48 EST 1999


[Posted and mailed]

I would guess the problem is to do with those infernal thread states.  In a
nutshell, unless your code that call back into Python is doing the "right
thing" with the thread-lock, you end up with a NULL thread state.

Its not trivial to explain, but here is my attempt at the short version:

* All of your extension module and object methods must have a
Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS pair around the actual call
into your C libraries.

* Any code that calls back into Python must create a CEnterLeavePython class
before doing any Python work.

Mail me for more details...

Mark.

Stidolph, David wrote in message
<11A17AA2B9EAD111BCEA00A0C9B41793034AAF19 at molach.origin.ea.com>...
>I'm getting my company to register for PyWin so we can get the debug
>versions of PyWin, but in the meantime I made a release version of our app
>to test it out.  I have the following code that is called from a Menu
>operation in our own ui:
>
>  def OnMenuDebug(self,x,y,flags):
>    print 'OnMenuDebug'
>    import pywin.debugger
>    try:
>      a = 1 / 0
>    except:
>      pywin.debugger.post_mortem()
>
>In the Output Debug Window of MSDev, I can see that the win32ui.pyd is
>loading, and it loads other DLL's, but it crashes.  I'm going to do another
>release build with all the debug info turned on, but wanted to get this
>question out to see if anyone has ideas to get the debugger working.
>
>OnMenuDebug
>Loaded 'C:\Program Files\Python\Pythonwin\win32ui.pyd', no matching
symbolic
>information found.
>Loaded 'C:\WINNT\system32\PyWinTypes15.dll', no matching symbolic
>information found.
>Loaded 'C:\WINNT\system32\ole32.dll', no matching symbolic information
>found.
>Loaded 'C:\WINNT\system32\oleaut32.dll', no matching symbolic information
>found.
>Loaded 'C:\WINNT\system32\mfc42.dll', no matching symbolic information
>found.
>Loaded 'C:\WINNT\system32\winspool.drv', no matching symbolic information
>found.
>Loaded 'C:\WINNT\system32\shell32.dll', no matching symbolic information
>found.
>Loaded 'C:\WINNT\system32\shlwapi.dll', no matching symbolic information
>found.
>First-chance exception in uo2client.exe (PYTHON15.DLL): 0xC0000005: Access
>Violation.
>The program 'C:\UO2\build-win32\uo2client\Release\uo2client.exe' has exited
>with code 0 (0x0).
>
>
>
>






More information about the Python-list mailing list