Breakpoint on os_log gets hit three times

When I set breakpoints on os_log statements like below:

os_log_debug(OS_LOG_DEFAULT, "hi"); //<--break point RIGHT on this line….

I have to click the "Continue Program Execution" button three times to actually continue program execution. At first I thought my method was being called multiple times unexpectedly but it’s not. I just have to keep hitting the continue program execution button. I’m not hitting “Step over” or “step into”. I’m hitting the “Continue Program Execution” button.

FB9792745

The reason why this is happening is that os_log_debug is not a function but a macro, and so the breakpoint ends up being instantiated multiple times based on its expansion.

FB9792745

Thanks for that.

As to a workaround, go to the Breakpoints navigator, click the chevron next to your breakpoint to disclose the ‘child’ breakpoints, and disable all but one.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Breakpoint on os_log gets hit three times
 
 
Q