Debugging C with Cosmopolitan Libc
> Cosmopolitan Libc allows you to log every function call over the program’s execution – just pass --ftrace at the end of your program, like this:<p>> ./hex16.com ./missing.txt --ftrace<p>That seems like magic. It seems you have to build with a special flag that tells GCC to put a nop at the start of each function. Then, before main runs, Cosmopolitan sees the --ftrace on the command line, and modifies the code in memory to replace those nops with calls to something that does the logging. See <a href="https://justine.lol/ftrace/" rel="nofollow">https://justine.lol/ftrace/</a>.