diff options
author | Toshihito Kikuchi <k.toshihito@yahoo.de> | 2016-06-09 22:47:42 -0700 |
---|---|---|
committer | Toshihito Kikuchi <k.toshihito@yahoo.de> | 2016-06-09 22:50:47 -0700 |
commit | bb556f1facb86cdd1591d490f2d2d670bdd5a1ee (patch) | |
tree | ccc99d237487ee5952ff66d92a4f2a207dd41f6a /gdb/NEWS | |
parent | c040f3fb55315f06ceb9e6de6ac167a95a445ace (diff) | |
download | gdb-bb556f1facb86cdd1591d490f2d2d670bdd5a1ee.zip gdb-bb556f1facb86cdd1591d490f2d2d670bdd5a1ee.tar.gz gdb-bb556f1facb86cdd1591d490f2d2d670bdd5a1ee.tar.bz2 |
Add negative repeat count to 'x' command
This change adds support for specifying a negative repeat count to
all the formats of the 'x' command to examine memory backward.
A new testcase 'examine-backward' is added to cover this new feature.
Here's the example output from the new feature:
<format 'i'>
(gdb) bt
#0 Func1 (n=42, p=0x40432e "hogehoge") at main.cpp:5
#1 0x00000000004041fa in main (argc=1, argv=0x7fffffffdff8) at main.cpp:19
(gdb) x/-4i 0x4041fa
0x4041e5 <main(int, char**)+11>: mov %rsi,-0x10(%rbp)
0x4041e9 <main(int, char**)+15>: lea 0x13e(%rip),%rsi
0x4041f0 <main(int, char**)+22>: mov $0x2a,%edi
0x4041f5 <main(int, char**)+27>: callq 0x404147
<format 'x'>
(gdb) x/-4xw 0x404200
0x4041f0 <main(int, char**)+22>: 0x00002abf 0xff4de800 0x76e8ffff 0xb8ffffff
(gdb) x/-4
0x4041e0 <main(int, char**)+6>: 0x7d8910ec 0x758948fc 0x358d48f0 0x0000013e
gdb/ChangeLog:
* NEWS: Mention that GDB now supports a negative repeat count in
the 'x' command.
* printcmd.c (decode_format): Allow '-' in the parameter
"string_ptr" to accept a negative repeat count.
(find_instruction_backward): New function.
(read_memory_backward): New function.
(integer_is_zero): New function.
(find_string_backward): New function.
(do_examine): Use new functions to examine memory backward.
(_initialize_printcmd): Mention that 'x' command supports a negative
repeat count.
gdb/doc/ChangeLog:
* gdb.texinfo (Examining Memory): Document negative repeat
count in the 'x' command.
gdb/testsuite/ChangeLog:
* gdb.base/examine-backward.c: New file.
* gdb.base/examine-backward.exp: New file.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r-- | gdb/NEWS | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -3,6 +3,20 @@ *** Changes since GDB 7.11 +* GDB now supports a negative repeat count in the 'x' command to examine + memory backward from the given address. For example: + + (gdb) bt + #0 Func1 (n=42, p=0x40061c "hogehoge") at main.cpp:4 + #1 0x400580 in main (argc=1, argv=0x7fffffffe5c8) at main.cpp:8 + (gdb) x/-5i 0x0000000000400580 + 0x40056a <main(int, char**)+8>: mov %edi,-0x4(%rbp) + 0x40056d <main(int, char**)+11>: mov %rsi,-0x10(%rbp) + 0x400571 <main(int, char**)+15>: mov $0x40061c,%esi + 0x400576 <main(int, char**)+20>: mov $0x2a,%edi + 0x40057b <main(int, char**)+25>: + callq 0x400536 <Func1(int, char const*)> + * Fortran: Support structures with fields of dynamic types and arrays of dynamic types. |