root
root copied to clipboard
Set CLING_DEBUG automatically when a debugger is attached
So that users don't have to know/find out that they need to set the CLING_DEBUG env variable in order to have proper stacktraces when debugging programs that include jitted code.
Detecting if a debugger is attached isn't very straightforward unless on Windows.
I can add something similar to the solution here: https://stackoverflow.com/questions/3596781/how-to-detect-if-the-current-process-is-being-run-by-gdb, but not sure if that's ideal.
As @devajithvs says, not easy to implement on linux/mac for reasons not dependent on us.