[Pyobjc-dev] Re: Subclassing NSCell?
Brought to you by:
ronaldoussoren
From: Mitch C. <mit...@ea...> - 2003-05-14 14:28:37
|
On Monday, May 12, 2003, at 11:35 PM, Mitch Chapman wrote: > I can create instances of the subclass, defined roughly as > > from AppKit import * > class MyCell(NSCell): > ... > > and can install these instances as data cells for NSTableColumns in an > NSTableView. > All cool. But if I try to override drawInteriorWithFrame_inView_, as > follows, > I get a segmentation fault on the first attempt to draw cell contents. > What's more, > I don't get the output from the print statement. I should probably be asking this elsewhere, but: Can anyone summarize how to use gdb to debug a Python2.3b1 application? In this case I've set SHOWPID and tried to attach to the running Python process, but gdb encounters errors during startup. It turns out that it does this even if I just try to debug the Python interpreter, without attaching to any running processes. (See below.) I get the same output even after setting DYLD_FRAMEWORK_PATH et al to match the settings used by bin-python-main: ---- gdb /Library/Frameworks/Python.framework/Versions/2.3/bin/python GNU gdb 5.3-20021014 (Apple version gdb-250) (Sat Dec 7 02:14:27 GMT 2002) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-macos10". unable to open symbol file: /Users/mitchchapman/lib/Python: No such file or directory. warning: Unable to read symbols from "Python.framework/Versions/2.3/Python"; reading from memory. /SourceCache/gdb/gdb-250/src/gdb/macosx/macosx-nat-dyld-process.c:505: internal-error: assertion failure in function "dyld_load_library": e->dyld_valid A problem internal to GDB has been detected. Further debugging may prove unreliable. Quit this debugging session? (y or n) ---- Meanwhile, Console.app has this to say about the original problem, a SEGFAULT when invoking drawInteriorWithFrame_inView_ on a Python-based subclass of NSCell: ---- Date/Time: 2003-05-14 07:52:40 -0600 OS Version: 10.2.6 (Build 6L60) Host: CallMeLuxo.local. Command: python PID: 19097 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x3f800000 Thread 0 Crashed: #0 0x9068ba4c in objc_msgSend #1 0x0021b228 in pythonify_c_value (objc_support.m:672) #2 0x00229530 in method_stub (libffi_support.m:351) #3 0x0022a1f4 in ffi_closure_helper_DARWIN (ffi_darwin.c:712) #4 0x0022a568 in ffi_closure_ASM #5 0x930a0758 in -[NSTableView drawRow:clipRect:] [...] ---- Thanks again for any clues. -- Mitch |