cmu-db / bustub

The BusTub Relational Database Management System (Educational)
https://15445.courses.cs.cmu.edu
MIT License
4.11k stars 1.8k forks source link

Update CMakeLists.txt for better debug info #677

Open JinjieZhao opened 10 months ago

JinjieZhao commented 10 months ago

Add -fstandalone-debug to emit full debug info

skyzh commented 10 months ago

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?

JinjieZhao commented 10 months ago

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

skyzh commented 10 months ago

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.

JinjieZhao commented 10 months ago

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

prashanthduvvada commented 3 months ago

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.