Debugging Intel Compiled Project with GDB

旧时模样 提交于 2019-12-11 09:45:47

问题


I've got a simple Hello World project in the Code::Blocks IDE which I'm compiling using the Intel C++ compiler.

I've set the compiler option '/Zi' in the projects Build Settings so I can debug the application with breakpoints. However no breakpoints are ever reached. It appears that no debugging symbols can be found within the object.

They are correctly reached when I change to use the gcc compiler however.

What am I missing here? Shouldn't this work as is?

[Update]

Seems to work on Linux but not on Windows. I ran the same sort of test a simple project with Intel compiler and the correct compiler option and I could reach breakpoints. Is there some reason Windows would have a problem?


回答1:


Is there some reason Windows would have a problem?

On UNIX, the debug info is usually completely documented, and often standard (e.g. Linux uses DWARF).

On Windows, Microsoft compilers use .PDB (Program Database) files, which are completely undocumented and proprietary. GDB can't use them.

I don't know what debug info format Intel compiler generates, but chances are that format is only understood by idb.

Effectively then, you can't mix and match GDB with any of the Microsoft or Intel compilers.



来源:https://stackoverflow.com/questions/23515634/debugging-intel-compiled-project-with-gdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!