aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2008-05-05 21:14:37 +0000
committerDoug Evans <dje@google.com>2008-05-05 21:14:37 +0000
commitd14508fea9d63a399de25f8a47d59bc33a1fd206 (patch)
treeb625eb7214353b8ff5fe757a893ca7b27a82c4a1 /gdb/doc
parent5142f611ca2556cb8e1510a69b9d240785a7db48 (diff)
downloadgdb-d14508fea9d63a399de25f8a47d59bc33a1fd206.zip
gdb-d14508fea9d63a399de25f8a47d59bc33a1fd206.tar.gz
gdb-d14508fea9d63a399de25f8a47d59bc33a1fd206.tar.bz2
* NEWS: Mention new /m modifier for disassemble command.
* cli/cli-cmds.c (print_disassembly): New function. (disassemble_current_function): New function (disassemble_command): Recognize /m modifier, print mixed source+assembly. (init_cli_cmds): Update disassemble help text. * gdb.texinfo (disassemble): Document /m modifier.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo30
2 files changed, 33 insertions, 1 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index f371b21..dd5ee73 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-05 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (disassemble): Document /m modifier.
+
2008-05-05 Vladimir Prus <vladimir@codesourcery.com>
* gdb.texinfo (Maintenance Commands): Clarify that "maint time"
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index f4b9417..16b9b66 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -5446,8 +5446,11 @@ Variables}).
@cindex machine instructions
@cindex listing machine instructions
@item disassemble
+@itemx disassemble /m
This specialized command dumps a range of memory as machine
-instructions. The default memory range is the function surrounding the
+instructions. It can also print mixed source+disassembly by specifying
+the @code{/m} modifier.
+The default memory range is the function surrounding the
program counter of the selected frame. A single argument to this
command is a program counter value; @value{GDBN} dumps the function
surrounding this value. Two arguments specify a range of addresses
@@ -5471,6 +5474,31 @@ Dump of assembler code from 0x32c4 to 0x32e4:
End of assembler dump.
@end smallexample
+Here is an example showing mixed source+assembly for Intel x86:
+
+@smallexample
+(@value{GDBP}) disas /m main
+Dump of assembler code for function main:
+5 @{
+0x08048330 <main+0>: push %ebp
+0x08048331 <main+1>: mov %esp,%ebp
+0x08048333 <main+3>: sub $0x8,%esp
+0x08048336 <main+6>: and $0xfffffff0,%esp
+0x08048339 <main+9>: sub $0x10,%esp
+
+6 printf ("Hello.\n");
+0x0804833c <main+12>: movl $0x8048440,(%esp)
+0x08048343 <main+19>: call 0x8048284 <puts@@plt>
+
+7 return 0;
+8 @}
+0x08048348 <main+24>: mov $0x0,%eax
+0x0804834d <main+29>: leave
+0x0804834e <main+30>: ret
+
+End of assembler dump.
+@end smallexample
+
Some architectures have more than one commonly-used set of instruction
mnemonics or other syntax.