2020-06-15 14:18:57 +00:00
|
|
|
#if 0
|
|
|
|
/*─────────────────────────────────────────────────────────────────╗
|
|
|
|
│ To the extent possible under law, Justine Tunney has waived │
|
|
|
|
│ all copyright and related or neighboring rights to this file, │
|
|
|
|
│ as it is written in the following disclaimers: │
|
|
|
|
│ • http://unlicense.org/ │
|
|
|
|
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
|
|
|
╚─────────────────────────────────────────────────────────────────*/
|
|
|
|
#endif
|
|
|
|
#include "libc/log/log.h"
|
2022-05-16 20:20:08 +00:00
|
|
|
#include "libc/runtime/symbols.internal.h"
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
/**
|
2021-03-05 14:09:12 +00:00
|
|
|
* @fileoverview How to print backtraces and cpu state on crash.
|
2020-06-15 14:18:57 +00:00
|
|
|
*
|
2021-03-05 14:09:12 +00:00
|
|
|
* make -j8 -O o//examples/crashreport.com
|
|
|
|
* o//examples/crashreport.com
|
2020-06-15 14:18:57 +00:00
|
|
|
*
|
|
|
|
* To prevent the GDB GUI from popping up:
|
|
|
|
*
|
2021-03-05 14:09:12 +00:00
|
|
|
* export GDB=
|
|
|
|
* make -j8 -O o//examples/crashreport.com
|
|
|
|
* o//examples/crashreport.com
|
2020-06-15 14:18:57 +00:00
|
|
|
*/
|
|
|
|
|
2022-05-12 13:43:59 +00:00
|
|
|
noubsan int main(int argc, char *argv[]) {
|
2021-03-05 14:09:12 +00:00
|
|
|
volatile int64_t x;
|
2022-03-21 10:46:16 +00:00
|
|
|
ShowCrashReports();
|
2021-03-05 14:09:12 +00:00
|
|
|
return 1 / (x = 0);
|
2020-06-15 14:18:57 +00:00
|
|
|
}
|