aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-delegates.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-05-20 19:11:39 +0100
committerPedro Alves <palves@redhat.com>2014-05-20 19:11:39 +0100
commit936d299246c2be32cfc92e0ad824f31d5b8cec73 (patch)
treeb177ec4c4f4bc0061c5abc62169cb40878599d2c /gdb/target-delegates.c
parent9440a9045928d3d4624b8dbcfbd98587a49d35e7 (diff)
downloadgdb-936d299246c2be32cfc92e0ad824f31d5b8cec73.zip
gdb-936d299246c2be32cfc92e0ad824f31d5b8cec73.tar.gz
gdb-936d299246c2be32cfc92e0ad824f31d5b8cec73.tar.bz2
Make compare-sections work against all targets; add compare-sections [-r] tests.
This does two things: 1. Adds a test. Recently compare-sections got a new "-r" switch, but given no test existed for compare-sections, the patch was allowed in with no testsuite addition. This now adds a test for both compare-sections and compare-sections -r. 2. Makes the compare-sections command work against all targets. Currently, compare-sections only works with remote targets, and only those that support the qCRC packet. The patch makes it so that if the target doesn't support accelerating memory verification, then GDB falls back to comparing memory itself. This is of course slower, but it's better than nothing, IMO. While testing against extended-remote GDBserver I noticed that we send the qCRC request to the target if we're connected, but not yet running a program. That can't work of course -- the patch fixes that. This all also goes in the direction of bridging the local/remote parity gap. I didn't decouple 1. from 2., because that would mean that the test would need to handle the case of the target not supporting the command. Tested on x86_64 Fedora 17, native, remote GDBserver, and extended-remote GDBserver. I also hack-disabled qCRC support to make sure the fallback paths in remote.c work. gdb/doc/ 2014-05-20 Pedro Alves <palves@redhat.com> * gdb.texinfo (Memory) <compare-sections>: Generalize comments to not be remote specific. Add cross reference to the qCRC packet. (Separate Debug Files): Update cross reference to the qCRC packet. (General Query Packets) <qCRC packet>: Add anchor. gdb/ 2014-05-20 Pedro Alves <palves@redhat.com> * NEWS: Mention that compare-sections now works with all targets. * remote.c (PACKET_qCRC): New enum value. (remote_verify_memory): Don't send qCRC if the target has no execution. Use packet_support/packet_ok. If the target doesn't support the qCRC packet, fallback to a deep memory copy. (compare_sections_command): Say "target image" instead of "remote executable". (_initialize_remote): Add PACKET_qCRC to the list of config packets that have no associated command. Extend comment. * target.c (simple_verify_memory, default_verify_memory): New function. * target.h (struct target_ops) <to_verify_memory>: Default to default_verify_memory. (simple_verify_memory): New declaration. * target-delegates.c: Regenerate. gdb/testsuite/ 2014-05-20 Pedro Alves <palves@redhat.com> * gdb.base/compare-sections.c: New file. * gdb.base/compare-sections.exp: New file.
Diffstat (limited to 'gdb/target-delegates.c')
-rw-r--r--gdb/target-delegates.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 87ce0d1..0e95cf0 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -1249,12 +1249,6 @@ delegate_verify_memory (struct target_ops *self, const gdb_byte *arg1, CORE_ADDR
}
static int
-tdefault_verify_memory (struct target_ops *self, const gdb_byte *arg1, CORE_ADDR arg2, ULONGEST arg3)
-{
- tcomplain ();
-}
-
-static int
delegate_get_tib_address (struct target_ops *self, ptid_t arg1, CORE_ADDR *arg2)
{
self = self->beneath;
@@ -2003,7 +1997,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_set_trace_buffer_size = tdefault_set_trace_buffer_size;
ops->to_set_trace_notes = tdefault_set_trace_notes;
ops->to_core_of_thread = tdefault_core_of_thread;
- ops->to_verify_memory = tdefault_verify_memory;
+ ops->to_verify_memory = default_verify_memory;
ops->to_get_tib_address = tdefault_get_tib_address;
ops->to_set_permissions = tdefault_set_permissions;
ops->to_static_tracepoint_marker_at = tdefault_static_tracepoint_marker_at;