diff options
author | Siva Chandra Reddy <sivachandra@sourceware.org> | 2013-02-21 01:46:57 +0000 |
---|---|---|
committer | Siva Chandra Reddy <sivachandra@sourceware.org> | 2013-02-21 01:46:57 +0000 |
commit | 9f44fbc03496a470cf661d011d9bcdcf21859726 (patch) | |
tree | 9fd2d9e47afdc5718ea6dcb017ca812df8bcb30e /gdb/doc | |
parent | d373aa7be9bbd3d47988652ba59496db34b0d246 (diff) | |
download | gdb-9f44fbc03496a470cf661d011d9bcdcf21859726.zip gdb-9f44fbc03496a470cf661d011d9bcdcf21859726.tar.gz gdb-9f44fbc03496a470cf661d011d9bcdcf21859726.tar.bz2 |
Add a new method 'disassemble' to gdb.Architecture class.
* python/py-arch.c (archpy_disassmble): Implementation of the
new method gdb.Architecture.disassemble.
(arch_object_methods): Add entry for the new method.
* doc/gdb.texinfo (Architectures In Python): Add description
about the new method gdb.Architecture.disassemble.
* testsuite/gdb.python/py-arch.c: New test case
* testsuite/gdb.python/py-arch.exp: New tests to test
gdb.Architecture.disassemble
* testsuite/gdb.python/Makefile.in: Add py-arch to the list of
EXECUTABLES.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 36 |
2 files changed, 41 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 6a16958..a2a6ec6 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2013-02-20 Siva Chandra Reddy <sivachandra@google.com> + + * gdb.texinfo (Architectures In Python): Add description about + the new method gdb.Architecture.disassemble. + 2013-02-15 Pedro Alves <pedro@codesourcery.com> Hafiz Abid Qadeer <abidh@codesourcery.com> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index e8ac8c5..d611f96 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -26040,6 +26040,42 @@ A @code{gdb.Architecture} class has the following methods: Return the name (string value) of the architecture. @end defun +@defun Architecture.disassemble (@var{start_pc} @r{[}, @var{end_pc} @r{[}, @var{count}@r{]]}) +Return a list of disassembled instructions starting from the memory +address @var{start_pc}. The optional arguments @var{end_pc} and +@var{count} determine the number of instructions in the returned list. +If both the optional arguments @var{end_pc} and @var{count} are +specified, then a list of at most @var{count} disassembled instructions +whose start address falls in the closed memory address interval from +@var{start_pc} to @var{end_pc} are returned. If @var{end_pc} is not +specified, but @var{count} is specified, then @var{count} number of +instructions starting from the address @var{start_pc} are returned. If +@var{count} is not specified but @var{end_pc} is specified, then all +instructions whose start address falls in the closed memory address +interval from @var{start_pc} to @var{end_pc} are returned. If neither +@var{end_pc} nor @var{count} are specified, then a single instruction at +@var{start_pc} is returned. For all of these cases, each element of the +returned list is a Python @code{dict} with the following string keys: + +@table @code + +@item addr +The value corresponding to this key is a Python long integer capturing +the memory address of the instruction. + +@item asm +The value corresponding to this key is a string value which represents +the instruction with assembly language mnemonics. The assembly +language flavor used is the same as that specified by the current CLI +variable @code{disassembly-flavor}. @xref{Machine Code}. + +@item length +The value corresponding to this key is the length (integer value) of the +instruction in bytes. + +@end table +@end defun + @node Python Auto-loading @subsection Python Auto-loading @cindex Python auto-loading |