![]() ![]() |
||
![]() |
![]() |
|
![]() |
[wingide-users] non python mainloopMarkus Oberrauter MarkusO@wingssimulations.deFri, 27 Jul 2001 10:42:52 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0049_01C11688.E362C970"
------=_NextPart_001_0049_01C11688.E362C970
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
We have some problems with my non-python mainloop:
1. We load and execute the script "Debug.py"
-We create a module <<PyImport_AddModule()>>
-We get the namespace <<PyModule_GetDict()>>
-We set __file__,__name__ ...
-We execute the script (our extension modules get imported ...)
-_wingshooks is loaded, connect to debugger
-the script ends
-At this point "_CB_Quit" is called
-connection to debugger dropped
C++ Code for initialising the script:
void CScript::Init()
{
// make a module=20
ModuleObject =3D PyImport_AddModule(ModuleName);
CHECK_PY_OBJ(ModuleObject);
modNamespace =3D PyModule_GetDict(ModuleObject);
_SCRERR(!modNamespace,"cann't get the module dictionary for %s", =
ModuleName);
// insert __builtin__ into the script namespace=20
PyObject *BuiltinModule =3D PyImport_ImportModule("__builtin__");
_SCRERR( BuiltinModule =3D=3D NULL ||
PyDict_SetItemString(modNamespace, "__builtins__", =
BuiltinModule) !=3D 0,
"can't add __builtins__ to %s", ModuleName);
Py_DECREF(BuiltinModule);
PyObject *m, *d, *v;
v =3D PyString_FromString(FileName);
if (PyDict_SetItemString(modNamespace, "__file__", v) !=3D 0)
_WCHECK(TRUE,"Error");
v =3D PyString_FromString(ModuleName);
if (PyDict_SetItemString(modNamespace, "__name__", v) !=3D 0)
_WCHECK(TRUE,"Error");
=20
// insert the default module namespace into the script namespace
PY_EXEC("from default import *");
PyRun_String(scriptText, Py_file_input, modNamespace, modNamespace );
}
2. From our C++ Mainloop we execute the "Run()" function every frame (We =
use PyRun_String("Run()")
while(!wlGlobal.quit)
{
mainScript->ExecPythonString("Run()");
...Rendering ....
}
To debug our functions we have to attach again to our application =
(Attach to process).=20
When we "Pause" the application we will stop at the 2nd or 3rd =
StackFrame. We can set breakpoints in the 1st Frame, but the program =
crashes in "__SetupStackPosition" (see log for details) if we set the =
breakpoint to the Line with "def run():" or if we try to StepOut to =
StackFrame 1 (We can open the sourcefile and set breakpoints using the =
debugger).
One change we had to made to our scriptsystem was to set __file__ and =
__name__. Without this information the 1st Stackframe was not shown in =
the debugger.
1st question: Is it possible to keep the connection to the debugger =
after loading and execution of the script, or do we have to change the =
way we are using python? I thought that if we were using python in a non =
C++ mainloop it would be ok to execute a python function and then jump =
back to C++.
2nd question: Some ideas why it crashes ? Is it possible that this =
problem is gone when we could keep the connection to the debugger?
I have attached some files to this email=20
-log.txt: Log of crash (my debug infos look like "MARKUS xxxxx")
-debugc.py: Our main python module
-textout.py, textout2.py: used to test callstack (debugc -> textout -> =
textout2)
_wingshooks.py
TIA
Markus Oberrauter
PS: I=B4m not in the office for the next 2 weeks, and I=B4m not able to =
reply before that time.
------=_NextPart_001_0049_01C11688.E362C970
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>We have some problems with my =
non-python=20
mainloop:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>1. We load and execute the script=20
"Debug.py"<BR> -We create a module=20
<<PyImport_AddModule()>><BR> -We get the =
namespace=20
<<PyModule_GetDict()>><BR> -We set =
__file__,__name__=20
...<BR> -We execute the script (our extension modules get =
imported=20
...)<BR> -_wingshooks is loaded, connect to=20
debugger<BR> -the script ends<BR> =
-At this=20
point "_CB_Quit" is called<BR> -connection to =
debugger=20
dropped</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV><FONT face=3DArial =
size=3D2>
<DIV><BR>C++ Code for initialising the script:</DIV>
<DIV> </DIV>
<DIV>void CScript::Init()<BR>{<BR> // make a module <BR> =20
ModuleObject =3D PyImport_AddModule(ModuleName);<BR> =20
CHECK_PY_OBJ(ModuleObject);</DIV>
<DIV> </DIV>
<DIV> modNamespace =3D PyModule_GetDict(ModuleObject);<BR> =20
_SCRERR(!modNamespace,"cann't get the module dictionary for %s",=20
ModuleName);</DIV>
<DIV> </DIV>
<DIV> // insert __builtin__ into the script namespace <BR> =
PyObject=20
*BuiltinModule =3D PyImport_ImportModule("__builtin__");<BR> =
_SCRERR(=20
BuiltinModule =3D=3D NULL =
||<BR> =20
PyDict_SetItemString(modNamespace, "__builtins__", BuiltinModule) !=3D=20
0,<BR> "can't add __builtins__ to %s",=20
ModuleName);<BR> Py_DECREF(BuiltinModule);</DIV>
<DIV> </DIV>
<DIV> PyObject *m, *d, *v;<BR> v =3D=20
PyString_FromString(FileName);<BR> if =
(PyDict_SetItemString(modNamespace,=20
"__file__", v) !=3D 0)<BR> =
_WCHECK(TRUE,"Error");</DIV>
<DIV> </DIV>
<DIV> v =3D PyString_FromString(ModuleName);<BR> if=20
(PyDict_SetItemString(modNamespace, "__name__", v) !=3D =
0)<BR> =20
_WCHECK(TRUE,"Error");</DIV>
<DIV> </DIV>
<DIV> <BR> // insert the default module namespace into the =
script=20
namespace<BR> PY_EXEC("from default import *");</DIV>
<DIV> </DIV>
<DIV> PyRun_String(scriptText, Py_file_input, modNamespace, =
modNamespace=20
);<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>2. From our C++ Mainloop we execute the "Run()" function every =
frame=20
(We use PyRun_String("Run()")</DIV>
<DIV> </DIV>
<DIV> while(!wlGlobal.quit)<BR> {<BR> =20
mainScript->ExecPythonString("Run()");<BR> &nbs=
p; =20
...Rendering ....<BR> }</DIV>
<DIV> </DIV>
<DIV><BR>To debug our functions we have to attach again to our =
application=20
(Attach to process). <BR>When we "Pause" the application we will stop at =
the 2nd=20
or 3rd StackFrame. We can set breakpoints in the 1st Frame, but the =
program=20
crashes in "__SetupStackPosition" (see log for details) if we set the =
breakpoint=20
to the Line with "def run():" or if we try to StepOut to StackFrame 1 =
(We can=20
open the sourcefile and set breakpoints using the debugger).</DIV>
<DIV> </DIV>
<DIV>One change we had to made to our scriptsystem was to set __file__ =
and=20
__name__. Without this information the 1st Stackframe was not shown in =
the=20
debugger.</DIV>
<DIV> </DIV>
<DIV>1st question: Is it possible to keep the connection to the debugger =
after=20
loading and execution of the script, or do we have to change the way we =
are=20
using python? I thought that if we were using python in a non C++ =
mainloop it=20
would be ok to execute a python function and then jump back to =
C++.</DIV>
<DIV> </DIV>
<DIV>2nd question: Some ideas why it crashes ? Is it possible that this =
problem=20
is gone when we could keep the connection to the debugger?</DIV>
<DIV> </DIV>
<DIV>I have attached some files to this email </DIV>
<DIV>-log.txt: Log of crash (my debug infos look like "MARKUS=20
xxxxx")<BR>-debugc.py: Our main python module<BR>-textout.py, =
textout2.py: used=20
to test callstack (debugc -> textout -> textout2)</DIV>
<DIV>_wingshooks.py</DIV>
<DIV><BR>TIA<BR> Markus Oberrauter</DIV>
<DIV> </DIV>
<DIV>PS: I=B4m not in the office for the next 2 weeks, and I=B4m not =
able to reply=20
before that time.<BR></FONT></DIV></BODY></HTML>
------=_NextPart_001_0049_01C11688.E362C970--
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: text/plain;
name="textout2.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="textout2.py"
c=14
def text(a):
print a
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: text/plain;
name="debugc.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="debugc.py"
import time
import TextOut
import _wingshooks
import wingdbstub
import select
a=12
def Init(Name):
return 0
def Run():
# if _wingshooks.Socket!=None:
# if select.select([_wingshooks.Socket.fileno()], [], [], None):
if callable(_wingshooks.CallbackFunction):
_wingshooks.CallbackFunction()
time.sleep(1)
TextOut.Text("Run")
return 1
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: text/plain;
name="Log.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Log.txt"
Fatal error occurred.=20
******************** START DEBUG ************************
ABOUT TO INIT
SET UP C CORE
Connected to client
netserver executing 0x30001 ([],)
SERVER SIDE SET BREAKS []
netserver sending back 0x1003 ([],)
netserver executing 0x12004 ({'use-members-attrib': 0, 'stop-timeout': =
3.0},)
netserver executing 0x12001 (2,)
netserver executing 0x12005 (('function', 'builtin_function_or_method', =
'class', 'instance method', 'type', 'module', 'ufunc'), ())
netserver executing 0x12006 (55, 2000, 64000)
netserver executing 0x11004 None
netserver sending back 0x1016 ('192.168.101.20', 50015, 900, =
'(unavailable)', None)
netserver executing 0x11002 None
####### BASEDIR: E:\Workspace
ALREADY LOADED 65 MODULES
M os
M schannel.struct
M os.path
M exceptions
M time
M _wxhooks
M schannel.time
M _wingshooks
MARKUS _wingshooks, RegisterSocket
0
MARKUS _wingshooks, RegisterSocket
M whrandom
M dbgtracer20
M Test_SGP
M signal
M default
M WingsDebugHook
M socket
M _qthooks
M netserver
M md5
M types
M Physics
M _extensions
M cPickle
M BVGenerator
M schannel.cPickle
M debugc
M site
M sys
M rsc
M stat
M CollisionChecker
M UserDict
M string
M struct
M Simulation
M _gtkhooks
M schannel.whrandom
M nt
M _zopehooks
M schannel.rotor
M ntpath
M TextOut
M findtracer
M imp
M WingsInput
M schannel.securechannel
M _socket
M schannel.sys
M schannel
M strop
M select
M textout2
M rotor
M schannel.socket
M _tkinterhooks
M constants
M schannel.select
M __main__
M wingdbstub
M schannel.md5
M __builtin__
M Wings2D
M abstract
M sgp
M MsgSys
M DI
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
1
MARKUS ******************** PROGRAM QUIT ************************
netserver CLOSECHANNEL
MARKUS _wingshooks, UnregisterSocket
################ Deregistered socket with Qt: <socket._socketobject =
instance at 04CD7ACC>
Run
Run
Run
Run
CHECK FOR CONNECTION
SELECT RESULT [] [] []
Run
Run
Run
Run
Run
CHECK FOR CONNECTION
SELECT RESULT [<socket._socketobject instance at 04CB2D1C>] [] []
DATA ON LISTENER SOCKET
SUCCESSFUL ATTACH REQUEST
READ HOST/PORT 192.168.101.20 50005
CONNECTING TO CLIENT AFTER CONNECT REQUEST
Connected to client
netserver executing 0x30001 ([],)
SERVER SIDE SET BREAKS []
netserver sending back 0x1003 ([],)
netserver executing 0x12004 ({'use-members-attrib': 0, 'stop-timeout': =
3.0},)
netserver executing 0x12001 (2,)
netserver executing 0x12005 (('function', 'builtin_function_or_method', =
'class', 'instance method', 'type', 'module', 'ufunc'), ())
netserver executing 0x12006 (55, 2000, 64000)
netserver executing 0x11004 None
netserver sending back 0x1016 ('192.168.101.20', 50015, 900, =
'(unavailable)', None)
netserver executing 0x11002 None
MARKUS _wingshooks, RegisterSocket
Run
Run
recursive call to WaitForCommand
Run
netserver executing 0x20006 None
__BlockUntilReadyToRun
__BlockUntilReadyToRun
__BlockUntilReadyToRun
__BlockUntilReadyToRun
__BlockUntilReadyToRun
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
1
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
1
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 5, 'Text', ('a',)), 5)]
FRAMEIDX 1
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 5, 'Text', ('a',)), =
5)] 1 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (1,)
netserver sending back 0x1011 ((1, None, 1, '0x4cd7a54', None, 2, =
'dict', 1, {'a': (1, 1, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (1,)
netserver sending back 0x1012 ((1, None, 2, '0x4bad7e4', None, 2, =
'dict', 1, {'__doc__': (1, 2, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'b': (1, 2, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 2, None, '0x4bad8c8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\TextOut.pyc', ()), =
'__name__': (1, 2, None, '0x4ba7c60', None, 1, 'string', 1, 'TextOut', =
()), '__builtins__': (1, 2, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (1,)
netserver executing 0x20002 None
EXITING TO RUN
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
1
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
1
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), 6)]
FRAMEIDX 1
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), =
6)] 1 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (1,)
netserver sending back 0x1011 ((1, None, 1, '0x4cd7a54', None, 2, =
'dict', 1, {'a': (1, 1, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (1,)
netserver sending back 0x1012 ((1, None, 2, '0x4bad7e4', None, 2, =
'dict', 1, {'__doc__': (1, 2, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'b': (1, 2, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 2, None, '0x4bad8c8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\TextOut.pyc', ()), =
'__name__': (1, 2, None, '0x4ba7c60', None, 1, 'string', 1, 'TextOut', =
()), '__builtins__': (1, 2, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (1,)
netserver executing 0x20002 None
EXITING TO RUN
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
1
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
2
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), 6), =
(('E:\\Workspace\\Data\\Scripts\\textout2.py', 3, 'text', ('a',)), 3)]
FRAMEIDX 2
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), =
6), (('E:\\Workspace\\Data\\Scripts\\textout2.py', 3, 'text', ('a',)), =
3)] 2 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (2,)
netserver sending back 0x1011 ((1, None, 4, '0x4cdb0b4', None, 2, =
'dict', 1, {'a': (1, 4, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (2,)
netserver sending back 0x1012 ((1, None, 5, '0x4badf8c', None, 2, =
'dict', 1, {'__doc__': (1, 5, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'c': (1, 5, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 5, None, '0x4ba69a8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\textout2.pyc', ()), =
'__name__': (1, 5, None, '0x4badf18', None, 1, 'string', 1, 'textout2', =
()), '__builtins__': (1, 5, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (2,)
netserver executing 0x20002 None
EXITING TO RUN
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
2
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
2
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), 6), =
(('E:\\Workspace\\Data\\Scripts\\textout2.py', 4, 'text', ('a',)), 4)]
FRAMEIDX 2
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), =
6), (('E:\\Workspace\\Data\\Scripts\\textout2.py', 4, 'text', ('a',)), =
4)] 2 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (2,)
netserver sending back 0x1011 ((1, None, 4, '0x4cdb0b4', None, 2, =
'dict', 1, {'a': (1, 4, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (2,)
netserver sending back 0x1012 ((1, None, 5, '0x4badf8c', None, 2, =
'dict', 1, {'__doc__': (1, 5, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'c': (1, 5, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 5, None, '0x4ba69a8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\textout2.pyc', ()), =
'__name__': (1, 5, None, '0x4badf18', None, 1, 'string', 1, 'textout2', =
()), '__builtins__': (1, 5, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (2,)
netserver executing 0x20002 None
EXITING TO RUN
Run
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
2
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
2
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), 6), =
(('E:\\Workspace\\Data\\Scripts\\textout2.py', 4, 'text', ('a',)), 4)]
FRAMEIDX 2
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), =
6), (('E:\\Workspace\\Data\\Scripts\\textout2.py', 4, 'text', ('a',)), =
4)] 2 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (2,)
netserver sending back 0x1011 ((1, None, 4, '0x4cdb0b4', None, 2, =
'dict', 1, {'a': (1, 4, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (2,)
netserver sending back 0x1012 ((1, None, 5, '0x4badf8c', None, 2, =
'dict', 1, {'__doc__': (1, 5, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'c': (1, 5, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 5, None, '0x4ba69a8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\textout2.pyc', ()), =
'__name__': (1, 5, None, '0x4badf18', None, 1, 'string', 1, 'textout2', =
()), '__builtins__': (1, 5, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (2,)
netserver executing 0x20003 None
EXITING TO RUN
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
2
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
1
SENDING NORMAL PROGRAM STOPPED <netserver.CNetworkServer instance at =
04C3104C>
NETSERVER PROGRAM STOPPED
QUIT=3DFALSE
STACK [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), 18), =
(('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), 6)]
FRAMEIDX 1
Packing 1 [(('E:\\Workspace\\Data\\Scripts\\debugc.py', 18, 'Run', ()), =
18), (('E:\\Workspace\\Data\\Scripts\\TextOut.py', 6, 'Text', ('a',)), =
6)] 1 0 None [] []
Sending packet
Exiting ProgramStopped
netserver executing 0x70001 (1,)
netserver sending back 0x1011 ((1, None, 1, '0x4cd7a54', None, 2, =
'dict', 1, {'a': (1, 1, None, '0x4ba6598', None, 1, 'string', 1, 'Run', =
())}, None),)
netserver executing 0x70002 (1,)
netserver sending back 0x1012 ((1, None, 2, '0x4bad7e4', None, 2, =
'dict', 1, {'__doc__': (1, 2, None, '0x1e1e9288', None, 1, "<type =
'None'>", 1, 'None', ()), 'b': (1, 2, None, '0x8b8110', None, 1, "<type =
'int'>", 1, '14', ()), '__file__': (1, 2, None, '0x4bad8c8', None, 1, =
'string', 1, 'E:\\Workspace\\Data\\Scripts\\TextOut.pyc', ()), =
'__name__': (1, 2, None, '0x4ba7c60', None, 1, 'string', 1, 'TextOut', =
()), '__builtins__': (1, 2, 3, '0x8b45ac', None, 2, 'dict', 0, None, =
())}, None),)
netserver executing 0x40003 (1,)
netserver executing 0x20003 None
EXITING TO RUN
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
1
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
__BlockUntilReadyToRun
MARKUS SetupStackPosition __fCurIndex before ForgetStackPosition
0
MARKUS SetupStackPosition __fCurIndex after ForgetStackPosition
0
Traceback (most recent call last):
File "E:\Workspace\Data\Scripts\dbgserver.py", line 2275, in =
_CB_Return
self.__BlockUntilReadyToRun(frame, None, changed_bps)
File "E:\Workspace\Data\Scripts\dbgserver.py", line 2633, in =
__BlockUntilReadyToRun
pruned =3D self.__SetupStackPosition(frame, new_exc_info)
File "E:\Workspace\Data\Scripts\dbgserver.py", line 2601, in =
__SetupStackPosition
self.__fCurFrame =3D self.__fStack[self.__fCurIndex][0]
IndexError: list index out of range
Continue (Cancel to debug) ?
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: text/plain;
name="TextOut.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="TextOut.py"
import textout2
b=14
def Text(a):
textout2.text(a)
------=_NextPart_000_0048_01C11688.E362C970
Content-Type: text/plain;
name="_wingshooks.py"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="_wingshooks.py"
#########################################################################=
""" _qthooks.py -- Qt socket management hooks for the Wing IDE debugger
Copyright (c) 1999-2001, Archaeopteryx Software, Inc. All rights =
reserved.
Written by Stephan R.A. Deibel and John P. Ehresman
"""
#########################################################################=
import _extensions
# The name of the module to watch for that indicates presence of this
# supported mainloop environment
kIndicatorModuleName =3D '_wingshooks'
Socket=3DNone
CallbackFunction=3DNone
#########################################################################=
# Qt-specific support for managing the debug server sockets
#########################################################################=
class _SocketHook(_extensions._SocketHook):
=20
""" Class for managing the debug server sockets: This is used only
when Qt is detected as being present in the debuggee's code. """
=
#----------------------------------------------------------------------
def __init__(self, err):
""" Constructor """
_extensions._SocketHook.__init__(self, err)
=20
=
#-----------------------------------------------------------------------
def _Setup(self, mod, s, cb_fct):
""" Attempt to set up socket registration with the given module
reference : This should be a reference to the indicator module
for the supported environment. The first socket is registered=20
with given action callback via _RegisterSocket(). Returns the
socket if succeeded or None if fails (e.g. because the module is=20
not yet fully loaded and we cannot yet use it to start registering=20
sockets. Note that the returned socket may be different than the
socket passed in because some environments require a wrapper: The
returned socket is then used in place of the original in the
debug server code. """
=20
# Check if we can pull this off now (if not, we keep trying)
# Try to register the first socket
new_sock =3D self._RegisterSocket(s, cb_fct)
return new_sock
=20
=
#----------------------------------------------------------------------
def _RegisterSocket(self, s, cb_fct):
""" Function to register a socket with a mainloop: Subsequently the =
given
callback function is called whenever there is data to be read on the
socket. Returns the socket if succeeded; None if fails. As in =
_Setup(),
the returned socket may differ from the one passed in, in which case
the debug server will substitute the socket that is used in its =
code."""
=20
# Try to use given module to register the socket: This fails if
# qt is in the process of being imported outside of this
# call but doesn't yet have all its attribs
try:
#MarkusDebug Info
self.fErr.out('MARKUS _wingshooks, RegisterSocket')
=09
global Socket
global CallbackFunction
=20
Socket=3Ds
CallbackFunction=3Dcb_fct
=20
return s
# Failed but keep checking
except:
self.fErr.out("################## 'qt' module not fully loaded")
return None
=20
=
#----------------------------------------------------------------------
def _UnregisterSocket(self, s):
""" Function to unregister a socket with the supported environment.
The socket passed in should be the one returned from _Setup() or
_RegisterSocket(). """ =20
#MarkusDebug Info
self.fErr.out('MARKUS _wingshooks, UnregisterSocket')
=20
global Socket
global CallbackFunction
=20
Socket=3DNone
CallbackFunction=3DNone
=20
self.fErr.out("################ Deregistered socket with Qt: ", s)
pass # Unimplemented [SRAD]
------=_NextPart_000_0048_01C11688.E362C970--
Run by Mailman v 2.0.8 |
|
|
Copyright (c) 2000-2002, Archaeopteryx Software, Inc. Legal Statements | ||