This is an example of an error Dr. Memory is giving me. I can see the call stack, however I can not see the line numbers. I am using msys-Mingw64 gcc.
Error #2: INVALID HEAP ARGUMENT to free 0x00007ffec80dfa90
# 0 replace_free [d:\a\drmemory\drmemory\common\alloc_replace.c:2710]
# 1 freeElf
# 2 main
Note: @0:00:00.332 in thread 18856
To compile run this command:
gcc -ggdb -static-libgcc main.c
I've also tried with gcc -g main.c
both don't work. I've checked with gdb that the line debug symbols exist. It's that Dr. Memory is not showing me them.
Dr. Memory supports DWARF-2 debugging format. Turns out that neither
-ggdbnor-gdwarfdoes this.The correct way to do it is this: