Is there is any way to switch to assembly when debugging a C or C++ program in gdb ? (Given that all source files and their corresponding assembly files are available)
+9
A:
There is a way to disassemble a function or a certain section of code, is that what you are after?
The command to do so would be disassemble <function name>
or a memory location.
Is this what you are referring to?
(gdb) help disassemble
Disassemble a specified section of memory.
Default is the function surrounding the pc of the selected frame.
With a single argument, the function surrounding that address is dumped.
Two arguments are taken as a range of memory to dump.
X-Istence
2009-02-26 08:39:49
actually yes .. thanks
Ben
2009-02-26 08:40:34
+3
A:
Using the disas command will probably do what you want.
According to the internal help, the disas command does the following:
Disassemble a specified section of memory.
Default is the function surrounding the pc of the selected frame.
With a single argument, the function surrounding that address is dumped.
Two arguments are taken as a range of memory to dump.
Paul Wicks
2009-02-26 08:45:42
+1
A:
In the new gdb version 7.0, the "disassemble" command can take a new argument "/m" which makes it emit mixed source and disassembly.
Michael Snyder
2009-10-28 20:07:24