drewpts
drewpts

Reputation: 446

Xcode: Determine caller of function in xcode in debug

How can I determine where some function called in debug state? I'm in stuck with EXC_I386_GPFLT error hence I do not expect invocation such function with my test case.

Upvotes: 0

Views: 310

Answers (1)

mixel
mixel

Reputation: 25836

You can try new Xcode 7 feature called Address Sanitizer.

In Xcode go to Product -> Scheme -> Edit Scheme, select Run, open Diagnostics tab and check Enable Address Sanitizer.

Address sanitizer

Then Product -> Clean project and run it again.

Objective-C and C code is susceptible to memory corruption issues such as stack and heap buffer overruns and use-after-free issues. When these memory violations occur, your app can crash unpredictably or display odd behavior. Memory corruption issues are difficult to track down because the crashes and odd behavior are often hard to reproduce, and the cause can be far from the origin of the problem.

You enable the address sanitizer in the build scheme. Once enabled, added instrumentation is built into the app to catch memory violations immediately, enabling you to inspect the problem right at the place where it occurs. Other diagnostic information is provided as well, such as the relationship between the faulty address and a valid object on the heap and allocation/deallocation information, which helps you pinpoint and fix the problem quickly. The address sanitizer is efficient—fast enough to be used regularly as well as with interactive applications. It is supported in OS X, in the Simulator, and on iOS devices.

New features in Xcode 7

Upvotes: 1

Related Questions