bustub icon indicating copy to clipboard operation
bustub copied to clipboard

Update CMakeLists.txt for better debug info

Open JinjieZhao opened this issue 1 year ago • 5 comments

Add -fstandalone-debug to emit full debug info

JinjieZhao avatar Jan 05 '24 03:01 JinjieZhao

do you have any comparison on the debug information produced before and after this option is enabled? i.e., do you see more information in your debugger?

skyzh avatar Jan 08 '24 09:01 skyzh

Without -fstandalone-debug p str -> error: summary string parsing error image With -fstandalone-debug image

JinjieZhao avatar Jan 09 '24 10:01 JinjieZhao

Hmm. This is weird as the debug info should be already embedded in the executable file? I assume the flag only helps generating some debug symbol files outside the executable.

skyzh avatar Jan 09 '24 15:01 skyzh

Yes, it is weird.

For gcc, this flag helps generating some debug symbol files outside the executable. For clang, this flag adds more debug info in the executable. see https://clang.llvm.org/docs/UsersManual.html#controlling-debug-information

JinjieZhao avatar Jan 10 '24 03:01 JinjieZhao

the '-fstandalone-debug' flag doesn't exist in g++. The g++ does all the prints that clang with '-fstandalone-debug' does by default.

The fix isn't correct. It requires a check if it's g++ or clang.

prashanthduvvada avatar Aug 09 '24 09:08 prashanthduvvada