While compiling a large c++ program with msvc .net 2003 and with debug information, I ran into C1067, the fatal compiler error for to big or to large debug symbols. As it is in boost, and I don't want to fiddle around with the source code, the easiest thing would be, if there is a pragma or something that could switch off the generation of debug symbols from source code side. Any idea?
Here's a KB article suggesting compiling with /Z7 (old style debug info). It will give an ignorable warning, and symbol info:
http://support.microsoft.com/kb/122539
Related
I'm trying to debug a program, but initializing (loading data) takes very long time in Debug mode (more than 10 minutes) where as it takes milliseconds in release mode.
Is there an easy way to compile the unimportant cpp file in Release mode, while the rest of the program in Debug mode?
I've tried changing the properties of the cpp file from Optimization Disabled (/Od) to Maximize Speed (/O2) but then I get this error 1>cl : Command line error D8016: '/O2' and '/RTC1' command-line options are incompatible
Yes you can. There's nothing stopping you from switching some projects to release mode and others to debug, assuming you actually have different projects and they produce dynamically linked libraries (dlls). Not too sure if this works with statically linked libraries too.
It might be also nice to know that you can debug your optimized-for-speed build by turning on debug symbols in the linking phase (project->properties->linker->debuggin->"Generate debug info":"optimize for debugging". It will not show all variables and doesn't let you jump into inlined functions but it does let you debug slow programs.
I'm trying to debug a c++ project in visual studio 2012 and when attempting to view a string value I get the error 'Error reading characters of string.'.
The only relevant article I can find is here:
http://connect.microsoft.com/VisualStudio/feedback/details/721456
but my project has none of the relevant preprocessor options set.
Heres a screenshot to show exactly what I mean
error http://img854.imageshack.us/img854/1682/09112012100524.png
Any help on this error would be much appreciated!
0xcdcdcdcd Is a special marker sequence used in Microsoft debug builds and shows the presence of uninitialized memory:
Well known magic numbers
This rather suggests that you haven't initialized the string inside your AptConstItem.
I had this same issue and it was a problem in my build definitions. I could debug some variables but not others. I had to turn off all optimizations. In C/C++ -> Optimization and Linker -> Optimization.
I use ndk-build to compile libpng source code in debug mode, then it shows “internal compiler error” in pngrtran.c. But when I compile in release mode, it can success. Is this a bug in libpng? How I can resolve this?
It's not a bug in libpng; anything a program describes as an "internal error" is a bug in the program (libpng does this, but then it shows "libpng: internal error"!) So it's a bug in the compiler.
You should report it to the ndk guys or you could go directly to the compiler vendor (probably GNU) because they would likely to be more responsive.
You can't resolve the problem - it needs a compiler fix (maybe only to output a message that doesn't claim it's an internal error, but at least that.) You can avoid the problem by simply not compiling libpng in debug mode. Since I assume this is for Android so you can (I believe) mix-and-match debug and now debug code (this does NOT work on Windows with at least one compiler!)
You can also try working out which compiler option reveals the problem; compare the options being passed to the compiler in both release and debug, then bisect the differences to see if you can narrow the issue down to one setting.
John Bowler jbowler 2 acm.org
The android team should know about the bug. As Its a resurface of an old one:
http://code.google.com/p/android/issues/detail?id=20862
I have a program that I intend to distribute to end users, and would like to have receive crash reports from them. If I were using MSVC, I would generate minidumps and have those sent to me, and then inspect them with the corresponding PDB to get a useful stack trace, at the very least.
What is the equivalent of doing this with GCC? I can generate a stack trace, but if I want this to be useful, it requires having debug symbols compiled into the executable (with -g). Obviously this is unacceptable for release distribution, since the executable can balloon in size quite a bit.
I googled a bit and found references to objcopy being able to separate out debug symbols to a separate file, but that page implied I would still need to have the debug symbols available alongside the release executable, which again is obviously unacceptable.
Well the idea is that you compile with -g to add debug symbols but not slow the program down, ie. most programs will do -g -O2 then you can seperate debug symbols with objdump. After that you can strip your release build so it won't have any debug symbols.
Update: Recent gdb supports separate debug files, see https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
For example you can doo
objcopy --only-keep-debug prog prog.debug
strip prog
Now your prog won't have any debug symbols. But you can use proc.debug file to debug it in gdb.
I couldn't find an exact answer to this, but I found an alternate solution that works just as well: Compile with optimization and other release flags alongside -g, store the resulting executable somewhere, then remove debug symbols using strip. Ship the stripped executable, and when you get a stack trace, use addr2line in combination with the original, unstripped executable, and you should get all the symbols back.
I'm trying to analyze a mini crash dump and need symbol files in order to get more details about the crash. Im currently just seeing:
"034eff74 0086eee9 00000000 0089d58d 034eff94 app_integrator!ZNK14ACE_Data_Block4baseEv+0x6"
Is it possible to extract debugging information from a msys/mingw gcc built dll into a windbg readable format? If not, is there any other way of getting more detailed information, like loading a MAP file in some way?
The dll and all it's contained .o files are built with the -g flag.
Windbg can't cope with the debugging information that will be generated by -g on a mingw installation. However, it can allegedly cope with COFF symbols.
If the source files for your DLL are small enough, you can probably get COFF debug information to build (-gcoff rather than -g).
So, Windbg can (allegedly) handle COFF symbols and GCC can generate them. So it should be easy from there, right? I was trying to do exactly this with a Win32 executable generated by Visual Studio 2008 that was loading a gcc-compiled DLL. Unfortunately for me, compiling with -gcoff didn't work. Mingw's gcc won't generate COFF symbols for projects with more than 64k lines of code. The DLL I was using was distincly larger then 64K code lines. Sadly I have to admit, I gave up and fell back on the trusty OutputDebugString. Otherwise I'd be able to give more complete instructions. I didn't fancy investigating the option of making gcc do COFF symbols for larger source files, or the alternative option of writing a debugging extension to parse DWARF or STABS data into windbg's internal symbol tables.
I fixed the issue, by the way!
Further suggestions can be found in this forum post at windbg.info.