Debugging a NULL CGContext under Cocoa/Carbon
Asked Answered
G

1

14

During the execution of my program I'm getting the following output in the XCode debugging console:

<Error>: CGContextSetTextMatrix: invalid context 0x0

I have no idea where in the application this NULL-context is being passed to the OS. Anyone know of a good technique to hunt it down? Can I break into the application when something is written to stdout?

Guano answered 9/12, 2009 at 18:51 Comment(1)
Set a breakpoint for CGContextSetTextMatrix.Infundibuliform
G
33

Adding a breakpoint in the gdb console for CGPostError breaks when the OS writes a CG-related error to stderr.

Guano answered 9/12, 2009 at 19:14 Comment(1)
and in Xcode 4, to do this, you click the plus button at the bottom left of the breakpoints pane, add symbolic breakpoint and put CGPostError as the Symbol, then leave the Module field blank.Louvre

© 2022 - 2024 — McMap. All rights reserved.