Skip to content

Commit

Permalink
[Apple M1] Nimbus add support for M1 debugger break
Browse files Browse the repository at this point in the history
BEGIN_PUBLIC add support for arm macOS devices debugger breakpoint

* Fix for jumping into debugger on M1 device with Simulator

END_PUBLIC

Tested if __builtin_debugtrap(); was working correctly
by adding it to my project on M1 MacbookPro and when hitting
that function in my App, it worked as expected by jumping
in the debugger and then also able to continue the app
after this.

PiperOrigin-RevId: 423896988
  • Loading branch information
Nobody authored and material-automation committed Jan 24, 2022
1 parent be91576 commit 74ca146
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/src/NIDebuggingTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ int NIIsInDebugger(void);
#endif

#if TARGET_IPHONE_SIMULATOR
// We leave the __asm__ in this macro so that when a break occurs, we don't have to step out of
// a "breakInDebugger" function.
#define NIDASSERT(xx) { if (!(xx)) { NIDPRINT(@"NIDASSERT failed: %s", #xx); \
if (NIDebugAssertionsShouldBreak && NIIsInDebugger()) { __asm__("int $3\n" : : ); } } \
if (NIDebugAssertionsShouldBreak && NIIsInDebugger()) { __builtin_debugtrap(); } } \
} ((void)0)
#else
#define NIDASSERT(xx) { if (!(xx)) { NIDPRINT(@"NIDASSERT failed: %s", #xx); \
Expand Down

0 comments on commit 74ca146

Please sign in to comment.