Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run gcc -gcodeview

Tags:

c++

c

gcc

g++

I want to run gcc on Windows + MSYS2|UCRT64 with the -gcodeview flag, to generate pdb files. Those are required, to generate stacktraces including line numbers in source files.

But gcc/g++ always reports, that the debug level is unrecognized: g++: error: unrecognized debug output level ‘codeview’

Do I have to compile and configure gcc with a specific flag to support CodeView?

like image 383
Fabian Keßler Avatar asked May 29 '26 14:05

Fabian Keßler


1 Answers

The version of the GCC documentation you linked to is for the development branch 14.0. The current release, 13.1.0, doesn't include -gcodeview in its debug options. So it's something new added for 14.

My MSYS2/mingw64 installation is using gcc 13.1.0; I assume the ucrt64 version is too.

So, basically, to generate codeview debug information, you either need to install a development version of gcc (Possibly having to build it from source) and hope it's in a usable state, or wait for 14.1 to be released and adopted.

like image 85
Shawn Avatar answered May 31 '26 05:05

Shawn