debug-symbols

Why does a 2-stage command-line build with clang not generate a dSYM directory?

拈花ヽ惹草 提交于 2019-11-29 05:59:11
I have a simple project I want to debug want to produce dSYM folder with debugging symbols. Running: clang++ -std=c++14 -stdlib=libc++ -g -o Lazy Lazy.cpp Creates Lazy.dSYM as I expect. However: clang++ -std=c++14 -stdlib=libc++ -g -c Lazy.cpp clang++ -stdlib=libc++ -g -o Lazy Lazy.o Does not create Lazy.dSYM (It seems that the symbols are embedded in the binary). Sadly the 2-step build is what my modified makefile does. How can I generate Lazy.dSYM from a 2-stage compile-and-link build? I don't need a dSYM directory, just debugging symbols, but would like to understand when and why it is

Visual Studio 2010 not generating .pdb files

核能气质少年 提交于 2019-11-29 05:11:34
问题 I was trying to debug a c++ app, but I saw breakpoints show "breakpoint will not be hit", so I checked the modules window and I saw "Binary was not build with debug information" so no symbols are loaded. And the only pdb file on the /debug folder is vc100.pdb, and there are no other pdb files anywhere in the project folders. In properties C/C++ > Debug Information Format, I have set Program Database (/Zi). And runtime library is set to Multi-threaded Debug (/MTd). Am I missing any other

gcc : Is using -Werror and -pedantic considered good practice?

99封情书 提交于 2019-11-29 03:12:40
I'm just digging into the gcc manual and some things are still unclear to me: When specifying a std, should I always use -pedantic in conjunction? When using -g, it the standard level sufficient or should I specify level 3, i.e. -g3? Is it good practice to use -Werror to promote all warnings to errors and -pedantic-errors to promote all pedantic warnings to errors? If you are writing a library, please do make sure that a simple program like #include <yourlib.h> int main() { return 0; } compiles without any warnings whatsoever even when the compiler is running in the most pedantic mode with all

How do debug symbols affect performance of a Linux executable compiled by GCC?

孤者浪人 提交于 2019-11-29 01:05:29
All other factors being equal (eg optimisation level), how does having debug symbols in an ELF or SO affect: Load time. Runtime memory footprint. Runtime performance? And what could be done to mitigate any negative effects? EDIT I've seen this question but I find the discussion unhelpful, as the code optimization factor has confused the issue there. Why does my code run slower with multiple threads than with a single thread when it is compiled for profiling (-pg)? The debug symbols are located in totally different sections from the code/data sections. You can check it with objdump : $ objdump

Make gcc put relative filenames in debug information

梦想与她 提交于 2019-11-28 21:31:29
The project I'm compiling uses CMake, which loves absolute pathnames . When I compile with debugging information enabled, gcc puts those long names into .debug_str sections, which is bad for debugging. I'd like to have short relative-to-project-root pathnames there instead. Is there some option to tell gcc to strip some part of pathname before emitting debug data? Or, maybe, there is some tool that could do that on compiled binaries? I've tried using SET(CMAKE_USE_RELATIVE_PATHS ON) (which seems to be frowned upon by devs) option, but as I'm using out-of-source builds, pathnames are still not

Visual Studio: debug information in release build

自古美人都是妖i 提交于 2019-11-28 21:10:57
I'm tempted to include debug information in my release builds that go out to customers. As far as I see the only down side is 25% increase in the binary file size. The advantage is that I can get an immediately usable crash dump, much easier to analyze. I'm willing to live with the 25% increase. Are there any other disadvantages I'm missing? This is a C project and all I want to do is Linked/Debugging/Generate Debug Info Michael Burr The size of the executable should increase much less than 25%. I'm actually a little surprised that it increases much at all, but some quick tests show that at

Why are some java libraries compiled without debugging information

血红的双手。 提交于 2019-11-28 20:31:36
I've noticed recently that there's a few java libs (the JDK, joda time, iText) that compile without some/all of the debugging information. Either the local variable info is missing, or the both the local variable info and line numbers are missing. Is there any reason for this? I realise it makes compiled code larger but I don't believe that's a particular large consideration. Or is it just building with the default compile options? Thanks. The default compile options don't include debugging information, you must specifically tell the compiler to include it. There are several reasons why most

Visual Studio breakpoints break in the wrong source file (or multiple files simultaneously) if multiple files have the same name

守給你的承諾、 提交于 2019-11-28 20:05:11
In a team project I'm working on, setting a breakpoint in a file (say IdeasController.cs ) will lead to erratic debugger behaviour if there's another file with the same name in the solution. I've reproduced the problem on several developers' workstations. Example I set a breakpoint in IdeasController.cs in our Web API: Another file called IdeasController.cs exists in our separate MVC 4 web project. In the screenshot below, the debugger shows the Api->IdeasController source code, but the line highlight matches the code structure of Web->IdeasController . The breakpoint is duplicated, with one

Xcode: Should I Strip Debug Symbols During Copy?

偶尔善良 提交于 2019-11-28 19:59:01
问题 The TestFlight SDK recommends setting Strip Debug Symbols During Copy to YES in Xcode Build Settings to enable the best crash reporting possible. I noticed that it's set to YES by default. Should I change it to YES ? Why or why not? 回答1: I work at TestFlight. Short answer is: set it to YES . Long answer: @Kerni is correct. Before we started symbolicating server side, we needed that data to symbolicate on device. So if you upload your dSYM to TestFlight, you can strip them. If you don't want

Creating symbol table for gdb using cmake

孤街浪徒 提交于 2019-11-28 17:26:00
问题 Is there any way to create only symbol table using cmake for gdb ? 回答1: The usual way to produce debugging information for gdb is to pass -g to the gcc or g++ compiler (and also at linking time). Look into the Cmake FAQ for how to get a debuggable executable. 回答2: Add this line to the file CMakeLists.txt : set(CMAKE_BUILD_TYPE Debug) 回答3: compile in Release mode optimized but adding debug symbols, useful for profiling : cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ... or compile with NO