diff options
author | Yao Qi <yao@codesourcery.com> | 2013-11-27 18:01:05 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-11-29 21:32:03 +0800 |
commit | 9f7132948dd9a08e020e6409ebe790d8fd9c6d5d (patch) | |
tree | da852d27b7b1156181e7e852a5e1e83e33131304 /gdb/ChangeLog | |
parent | 5425b0d80b3f883115ae120124625cb4f040e17c (diff) | |
download | gdb-9f7132948dd9a08e020e6409ebe790d8fd9c6d5d.zip gdb-9f7132948dd9a08e020e6409ebe790d8fd9c6d5d.tar.gz gdb-9f7132948dd9a08e020e6409ebe790d8fd9c6d5d.tar.bz2 |
Delegate to target_ops->beneath for TARGET_OBJECT_RAW_MEMORY
GDB on x86_64-linux is unable to disassemble on core-file target.
$ ./gdb ./testsuite/gdb.base/corefile
(gdb) core-file ./testsuite/gdb.base/corefile.core
(gdb) disassemble main
Dump of assembler code for function main:
0x0000000000400976 <+0>: Cannot access memory at address 0x400976
However, it works if we turn code-cache off.
(gdb) set code-cache off
(gdb) disassemble main,+4
Dump of assembler code from 0x400976 to 0x40097a:
0x0000000000400976 <main+0>: push %rbp
0x0000000000400977 <main+1>: mov %rsp,%rbp
End of assembler dump.
When code-cache is off, GDB will iterate target_ops from top to bottom
and call to_xfer_partial. When current_target is "core", it will call
to_xfer_partial of target "exec", which reads the contents for
disassemble. However, dcache uses TARGET_OBJECT_RAW_MEMORY to read,
but target_xfer_partial doesn't delegate requests to beneath for
TARGET_OBJECT_RAW_MEMORY.
This patch factors out the iteration from top to bottom to a new
function, raw_memory_xfer_partial, and use it for
TARGET_OBJECT_RAW_MEMORY.
Regression tested on x86_64-linux.
gdb:
2013-11-29 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* dcache.c (dcache_read_line): Use current_target.beneath
instead of ¤t_target.
* target.c (memory_xfer_partial_1): Factor code out to ...
(raw_memory_xfer_partial): ... it. New function.
(target_xfer_partial): Call raw_memory_xfer_partial if OBJECT
is TARGET_OBJECT_RAW_MEMORY.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6eef295..e86f5c3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2013-11-29 Yao Qi <yao@codesourcery.com> + Pedro Alves <palves@redhat.com> + + * dcache.c (dcache_read_line): Use current_target.beneath + instead of ¤t_target. + * target.c (memory_xfer_partial_1): Factor code out to ... + (raw_memory_xfer_partial): ... it. New function. + (target_xfer_partial): Call raw_memory_xfer_partial if OBJECT + is TARGET_OBJECT_RAW_MEMORY. + 2013-11-28 Doug Evans <xdje42@gmail.com> * breakpoint.h (gdbpy_breakpoint_object): Renamed from |