![]() I've had very little exposure to other people's code, so I thought to ask here. I was a bit embarassed and didn't insist, but I'm not convinced, he didn't give technical arguments as to why it's wrong. I explained my situation but he didn't budge. He said to always make one debug and one release build. ![]() He said this was silly, that I should never mix -g and -O2, that debug and release are separate entities and to keep it that way. Sometimes when stepping in gdb the line numbers will be off compared to the source code, but in general it works well enough.Ī more experienced C++ dev who is helping me on a new part of the app was puzzled when he saw this. I'm not maxing out the CPU yet, I could ship a -O0 build if I wanted, but I'd rather not take the ~25% CPU penalty (in my experience) from not using it, also I prefer to leave more breathing room for the future. I build with -O2 for performance reasons. The debug symbols get extracted anyway, so I figured there was no downside. Furthermore I prefer to use the same single binary to have it see the most use (and therefore battle-testing). Crashes are so rare that I can't justify having people temporarily install debug builds while hunting a bug, another crash might not be encountered for weeks. Scenario 2: I need to troubleshoot something on a user's system and just want to attach gdb to the running process to watch a breakpoint. Scenario 1: a core dump is detected (crash), they email it to me, and I can feed this into gdb and find out the cause, see readable function and variable names. ![]() The reason I build with -g is to have a decent amount of debug info available to me when I need it. debug files, prior to creating the package. When making a release package I build with -O2 and -g, then I strip the debug symbols from the binaries into their own separate. ![]() They run on dedicated low-power PCs, without network access. I'm a solo developer on "semi-embedded" apps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |