Skip to content

Commit

Permalink
Suggest using -gdwarf-2 instead of -ggdb with mingw64. (#2510)
Browse files Browse the repository at this point in the history
At least with mingw-w64-x86_64-gcc 14.2.0, line numbers are not provided
when using -ggdb but are when using -gdwarf-2. Fix was found here:
https://stackoverflow.com/questions/73508016/dr-memory-does-not-show-line-number-in-call-stack
  • Loading branch information
brettle authored Sep 23, 2024
1 parent 24c3c06 commit 9a569cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drmemory/docs/using.dox
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Dr. Memory supports applications compiled with the MinGW gcc or g++
compilers, but will only provide line number information if DWARF
debugging information is present. The default for MinGW gcc prior to
version 4.3 is to use the stabs format, which is not supported by
Dr. Memory. Pass the \p -ggdb option to gcc to generate DWARF format
Dr. Memory. Pass the \p -gdwarf-2 option to gcc to generate DWARF format
instead.

You install the MinGW compiler in a Cygwin installation by running the
Expand All @@ -342,7 +342,7 @@ GCC for Win32 (i686-w64-mingw32) toolchain (C++)" Cygwin package (this is a
32-bit compiler available for both 32-bit and 64-bit Cygwin):

\verbatim
i686-w64-mingw32-g++.exe -static-libgcc -static-libstdc++ -ggdb -o myapp.exe myfile1.cpp myfile2.cpp
i686-w64-mingw32-g++.exe -static-libgcc -static-libstdc++ -gdwarf-2 -o myapp.exe myfile1.cpp myfile2.cpp
\endverbatim

********************
Expand Down

0 comments on commit 9a569cb

Please sign in to comment.