aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorCheng Renquan <crq@sourceware.org>2010-07-27 20:33:40 +0000
committerCheng Renquan <crq@sourceware.org>2010-07-27 20:33:40 +0000
commit53a71c068156f7c35e07ddd5c0cce97bf98c025c (patch)
tree5bbf950c3a6ecfbcbca936f2e93516fd9c9c3f70 /gdb/doc
parentc63a1f8688b64b454605a10755e7a4c4c780dbfe (diff)
downloadgdb-53a71c068156f7c35e07ddd5c0cce97bf98c025c.zip
gdb-53a71c068156f7c35e07ddd5c0cce97bf98c025c.tar.gz
gdb-53a71c068156f7c35e07ddd5c0cce97bf98c025c.tar.bz2
* cli/cli-cmds.c (disassemble_command): Add support of disassemble
"start,+length" form of arguments.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo28
2 files changed, 30 insertions, 3 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 8c249ef..8d3e265 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-28 CHENG Renquan <rqcheng@smu.edu.sg>
+
+ * gdb.texinfo (Machine Code): Update description of two forms of
+ arguments, and add new example to demonstrate the new form.
+
2010-07-27 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Values From Inferior): Add value inferior function
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index fa583aa..dfd6ffa 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -6742,9 +6742,19 @@ 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. When two arguments are given, they should
be separated by a comma, possibly surrounded by whitespace. The
-arguments specify a range of addresses (first inclusive, second exclusive)
-to dump. In that case, the name of the function is also printed (since
-there could be several functions in the given range).
+arguments specify a range of addresses to dump, in one of two forms:
+
+@table @code
+@item @var{start},@var{end}
+the addresses from @var{start} (inclusive) to @var{end} (exclusive)
+@item @var{start},+@var{length}
+the addresses from @var{start} (inclusive) to
+@code{@var{start}+@var{length}} (exclusive).
+@end table
+
+@noindent
+When 2 arguments are specified, the name of the function is also
+printed (since there could be several functions in the given range).
The argument(s) can be any expression yielding a numeric value, such as
@samp{0x32c4}, @samp{&main+10} or @samp{$pc - 8}.
@@ -6796,6 +6806,18 @@ Dump of assembler code for function main:
End of assembler dump.
@end smallexample
+Here is another example showing raw instructions in hex for AMD x86-64,
+
+@smallexample
+(gdb) disas /r 0x400281,+10
+Dump of assembler code from 0x400281 to 0x40028b:
+ 0x0000000000400281: 38 36 cmp %dh,(%rsi)
+ 0x0000000000400283: 2d 36 34 2e 73 sub $0x732e3436,%eax
+ 0x0000000000400288: 6f outsl %ds:(%rsi),(%dx)
+ 0x0000000000400289: 2e 32 00 xor %cs:(%rax),%al
+End of assembler dump.
+@end smallexample
+
Some architectures have more than one commonly-used set of instruction
mnemonics or other syntax.