How can this be fixed?
I recommend that you do what Jim suggested on that thread you referenced [1], namely file a bug.
Please post your bug number, just for the record.
In terms of workarounds, if you modify your assert macro to not use abort
but rather invoke __builtin_trap()
, that seems to make LLDB much happier.
If you can’t modify your assert macro then you could try something like this:
#include <stdio.h>
#include <stdlib.h>
static void myAbort(int sigNum) {
__builtin_trap();
}
int main(int argc, const char * argv[]) {
signal(SIGABRT, myAbort);
fprintf(stderr, "Hello Cruel World!\n");
abort();
fprintf(stderr, "Goodbye Cruel World!\n");
return 0;
}
This does really weird stuff when you run it directly [2], but it seems to yield reasonable results when debugging with LLDB.
btw I’m testing on macOS 14.0 with Xcode 15.0. YMMV on other configs.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] https://discourse.llvm.org/t/lldb-doesnt-stop-on-sigabrt-assert-with-x86-executable-on-apple-arm/69749/1
[2] I won’t hold that against Rosetta. Honestly, I’m in awe of its ability to make any of this stuff work.