nelhage / llama

Apache License 2.0
589 stars 24 forks source link

Use `-fdebug-prefix-map=old=new` when compiling with gcc/clang #54

Closed nvartolomei closed 3 years ago

nvartolomei commented 3 years ago

Currently, symbols point to temporary folders as created on lambda 0. /tmp/llama.565826462/_root/home/nv/[...] this makes stacktraces quite ugly.

Think this can be fixed with passing -fdebug-prefix-map.

https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

-fdebug-prefix-map=old=new
When compiling files residing in directory old, record debugging information describing them as if the files resided in directory new instead. This can be used to replace a build-time path with an install-time path in the debug info. It can also be used to change an absolute path to a relative path by using . for new. This can give more reproducible builds, which are location independent, but may require an extra command to tell GDB where to find the source files. 
nelhage commented 3 years ago

Great suggestion! Can you test whether https://github.com/nelhage/llama/pull/55 helps for you? There's a bit of complexity as mentioned in the issue, but it should get most of the way there.