How to view the disassembly in Code::Blocks?

二次信任 提交于 2019-12-21 04:35:27

问题


I read this article about some low level underpinnings of C/C++, and the author is basically showing us through the assembly code generated by the compiler, line by line. He is using VS 2010, but I don't, I use Code::Blocks. How do I view the disassembly there? When I go to debugger, and click disassembly, it shows me a blank window...

This is the C++ (.cpp) code (the whole code) I compiled:

int main()
{
    int x = 1;
    int y = 2;
    int z = 0;

    z = x + y;

    return 0;
}

回答1:


The kind of disassembly that the author shows in the article is called inter-leaved disassembly ( C and disassembly interleaved ) which a few IDEs like Visual Studio support. Code Blocks does not support. But Code Blocks has a separate disassembly window like this

Select a source line. Right Click. Say Run to Cursor. Now Debug->Debugging Windows->Disassembly. Instead of Run to cursor you can also set break points and then do this. But somehow it wasn't going well with mine, so I am suggesting Run to Cursor method.

Hope it helps.



来源:https://stackoverflow.com/questions/9619215/how-to-view-the-disassembly-in-codeblocks

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