Re: [Pyobjc-dev] Re: Subclassing NSCell?
Brought to you by:
ronaldoussoren
From: Mitch C. <mit...@ea...> - 2003-05-15 04:00:47
|
On Wednesday, May 14, 2003, at 12:55 PM, Ronald Oussoren wrote: > I usually look for the right process-id from the shell and then start > 'gdb /usr/local/bin/pyton THEPID' (THEPID being the process-id). > > Are you using the Project Builder templates? These use /usr/bin/python > unless you change the bin-python-main.m file. Well, thanks to the in-line documentation y'all wrote in bin-python-main.m, I wasn't having trouble figuring out which python executable to target with gdb, or which process ID to attach to. My problem turned out to be that I wasn't setting DYLD_FRAMEWORK_PATH properly, so gdb couldn't load the Python dynamic library. With DYLD_FRAMEWORK_PATH set to refer to the system frameworks directory, like so: DYLD_FRAMEWORK_PATH=/Library/Frameworks gdb was happy again. Now I'm stuck trying to learn why [methinfo getArgumentTypeAtIndex:i] (libffi_support.m, line 323) would return an invalid value for i == 3, when methinfo->_nargs == 4. It seems to be extracting a bogus id for the second argument to drawInteriorWithFrame_inView_, which is supposed to be the control view into which the NSCell subclass draws. The signature in methinfo matches that generated for my drawInteriorWithFrame_inView_ method, to wit: NSMethodSignature: types=v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}@ nargs=4 sizeOfParams=160 returnValueLength=0; or, as gdb puts it: (gdb) print *methinfo $14 = { isa = 0xa07ed538, _types = 0x46ec60 "v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}@\000"..., _nargs = 4, _sizeofParams = 160, _returnValueLength = 0, _parmInfoP = 0x46ec10, _fixup = 0x0, _reserved = 0x0 } The code is failing on the retobject assignment in the following code fragment (near line 673 in pythonify_c_value, in Modules/objc/objc_support.m). obj has the "out of bounds" value 0x3f800000, so I guess the problem starts before the attempt to invoke __pyobjc_PythonObject__: case _C_ID: { id obj = *(id *) datum; if (obj == nil) { retobject = Py_None; Py_INCREF (retobject); } else { retobject = [obj __pyobjc_PythonObject__]; I'm not sure where to go from here. Any suggestions? -- Mitch |