I've gotten my project to a point where it segfaults, so I'd like to use the debugger to find out how this happens. The problem is though, my project is set up for an optimized and stripped build, which is how I want to run things 99% of the time, but it does mean the debugger doesn't tell me an awful lot when ran on the executable. What's the best way to set up a debug build for a project in CodeLite?
e.g. in CodeBlocks, which I used until recently (it's still a decent IDE, but I'm honestly not sure how I survived for so long without LSP integration...), you could set up multiple targets in one project, which differed mostly in compiler arguments, though you could disable/enable individual compilation units. I don't see a similar option in CodeLite. I could make two projects (one for "production" builds and one for debugging), but as far as I can see, that would mean I'd have to manually keep active compilation units in sync between the projects.
I haven't used CodeLite before, but just as a cursory glance, it appears to follow configuration similar to Visual Studio.
https://wiki.codelite.org/pmwiki.php/Main/ProjectSettings
In the Project Settings dialog, you have Configuration Type, and it appears you can set individualized settings for both Debug and other configurations.
So, for Debug builds, I would not having any -O (optimization) flags, and make sure to turn on -g (debug). For Release builds, crank the optimization up if desired.