User forums > Help

How to view an assembly code while debugging?

(1/5) > >>

visir:
I'm paused at the first line of main(), and opened Debug -> Debugging windows -> Disassembly, but it's empty.

When on windows, and when using mingw and gdb, is it possible to see the resulted assembly code? Or should I generate assembly listings?

visir:
Actually, even keeping the disassembly window open breaks the debugger. It like halts, I can't even stop the debugging without closing gdb.exe in the task manager. Stepping doesn't work too.

visir:
This is what it prints in log when I open assembly window

[debug]> if 1
disassemble 0x4016b5
info frame
end
[debug] > > >

After that, it stops reacting to anything.

BlueHazzard:
have you enabled full debugger log?
Settings->Debugger->Common->Full (Debug) log ?
try again, and post the full debug log

for me the disassembly works. What codeblocks version are you using?

visir:
full debugger log enabled.
codeblocks version is 16.01 ,  "Build: Jan 25 2016, 21:19:34 - wx2.8.12 (Windows, unicode) - 32 bit". Should be the last, I downloaded it half a month or month ago.
It's 32bit codeblocks with 32bit compiler and debugger on 64bit windows, hope that's not a problem.

Here is the full log.


--- Code: ---Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\User\Downloads\_codeblocks\hello world\
Adding source dir: C:\Users\User\Downloads\_codeblocks\hello world\
Adding file: C:\Users\User\Downloads\_codeblocks\hello world\bin\Debug\hello world.exe
Changing directory to: "C:/Users/User/Downloads/_codeblocks/hello world/."
Set variable: PATH=.;C:\msys64\mingw32\bin;C:\msys64\mingw32;C:\Program Files\Microsoft MPI\Bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Git\cmd;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone;C:\Go\bin;C:\LLVM\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseHg;C:\Program Files\doxygen\bin;D:\games\UltimateSSDKv3\Source Engine 2009\ep2\..\bin;C:\Program Files (x86)\Graphviz2.38\bin;C:\shared\my_programs\Console2;C:\shared\my_programs\mygothings\bin

[debug]Command-line: C:\msys64\mingw32\bin\gdb.exe -nx -fullname -quiet  -args "C:/Users/User/Downloads/_codeblocks/hello world/bin/Debug/hello world.exe"
[debug]Working dir : C:\Users\User\Downloads\_codeblocks\hello world

Starting debugger: C:\msys64\mingw32\bin\gdb.exe -nx -fullname -quiet  -args "C:/Users/User/Downloads/_codeblocks/hello world/bin/Debug/hello world.exe"
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:/Users/User/Downloads/_codeblocks/hello world/bin/Debug/hello world.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.12.1
[debug]Copyright (C) 2017 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.12.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files (x86)\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory "C:/Users/User/Downloads/_codeblocks/hello world/"
[debug]Source directories searched: C:/Users/User/Downloads/_codeblocks/hello world;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> start
[debug]Temporary breakpoint 2 at 0x401646: file C:\Users\User\Downloads\_codeblocks\hello world\main.cpp, line 7.
[debug]Starting program: C:\Users\User\Downloads\_codeblocks\hello world\bin\Debug\hello world.exe

Child process PID: 2224

[debug][New Thread 2224.0x1220]
[debug]Temporary breakpoint 2, main () at C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:7
[debug]C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:7:62:beg:0x401646
[debug]>>>>>>cb_gdb:

At C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:7

[debug]> info program
[debug] Using the running image of child Thread 2224.0x1220.
[debug]Program stopped at 0x401646.
[debug]It stopped at a breakpoint that has since been deleted.
[debug]Type "info stack" or "info registers" for more information.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:8:99:beg:0x40166b
[debug]>>>>>>cb_gdb:

At C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:8

[debug]> next
[debug]C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:9:136:beg:0x401690
[debug]>>>>>>cb_gdb:

At C:\Users\User\Downloads\_codeblocks\hello world\main.cpp:9

[debug]> if 1
disassemble 0x401690
info frame
end
[debug] > > >
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version