Skip to content

Commit

Permalink
catch.hpp: Fixed breakpoint on ARM MacOS
Browse files Browse the repository at this point in the history
The breakpoint on assertion failure enabled by the `--break` flag
wasn't working properly on ARM (M1/M2) Macs: LLDB couldn't continue
after hitting the breakpoint.
I'm cherry-picking the fix from the latest revision of Catch2.
It simply changes the ARM machine instruction emitted; I don't know
the details, but it fixes the problem in Xcode.
  • Loading branch information
snej committed Jul 18, 2023
1 parent c1e2276 commit cd3dfa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vendor/catch/catch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7949,7 +7949,7 @@ namespace Catch {
#if defined(__i386__) || defined(__x86_64__)
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
#elif defined(__aarch64__)
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
#define CATCH_TRAP() __asm__(".inst 0xd43e0000")
#endif

#elif defined(CATCH_PLATFORM_IPHONE)
Expand Down

0 comments on commit cd3dfa4

Please sign in to comment.