diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-02-21 21:44:48 +0100 |
---|---|---|
committer | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-02-25 17:57:28 +0100 |
commit | ae91f6253926e4dadebcae90772f4f5a5bd06056 (patch) | |
tree | e637ff2e0a4e574714b9b389a505fcef72868d5a /gdb/gdbserver/target.h | |
parent | e0471c16c5ac8eddf49daf781248822f4a1ebc58 (diff) | |
download | gdb-ae91f6253926e4dadebcae90772f4f5a5bd06056.zip gdb-ae91f6253926e4dadebcae90772f4f5a5bd06056.tar.gz gdb-ae91f6253926e4dadebcae90772f4f5a5bd06056.tar.bz2 |
[PR gdb/13808] gdb.trace: Pass tdesc selected in gdbserver to IPA.
If gdbserver and IPA are using different tdesc, they will disagree
about 'R' trace packet size. This results in mangled traces.
To make sure they pick the same tdesc, gdbserver pokes the tdesc
(specified as an index in a target-specific list) into a global
variable in IPA. In theory, IPA could find out the tdesc on its
own, but that may be complex (in particular, I don't know how to
tell whether we have LAST_BREAK on s390 without messing with ptrace),
and we'd have to duplicate the logic.
Tested on i386 and x86_64. On i386, it fixes two FAILs in ftrace.exp.
On x86_64, these failures have been KFAILed - one of them works now,
but the other now fails due to an unrelated reason (ugh).
gdb/gdbserver/ChangeLog:
PR gdb/13808
* Makefile.in: Add i386-*-linux-ipa.o and amd64-*-linux-ipa.o.
* configure.srv: Ditto.
* linux-aarch64-ipa.c (get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment.
* linux-amd64-ipa.c: Add "linux-x86-tdesc.h" include.
(init_registers_amd64_linux): Remove prototype.
(tdesc_amd64_linux): Remove declaration.
(get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment,
initialize remaining tdescs.
* linux-i386-ipa.c: Add "linux-x86-tdesc.h" include.
(init_registers_i386_linux): Remove prototype.
(tdesc_i386_linux): Remove declaration.
(get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment,
initialize remaining tdescs.
* linux-low.c (linux_get_ipa_tdesc_idx): New function.
(linux_target_ops): wire in linux_get_ipa_tdesc_idx.
* linux-low.h (struct linux_target_ops): Add get_ipa_tdesc_idx.
* linux-x86-low.c: Move tdesc declarations to linux-x86-tdesc.h.
(x86_get_ipa_tdesc_idx): New function.
(the_low_target): Wire in x86_get_ipa_tdesc_idx.
* linux-x86-tdesc.h: New file.
* target.h (struct target_ops): Add get_ipa_tdesc_idx.
(target_get_ipa_tdesc_idx): New macro.
* tracepoint.c (ipa_tdesc_idx): New macro.
(struct ipa_sym_addresses): Add addr_ipa_tdesc_idx.
(symbol_list): Add ipa_tdesc_idx.
(cmd_qtstart): Write ipa_tdesc_idx in the target.
(ipa_tdesc): Remove.
(ipa_tdesc_idx): New variable.
(get_context_regcache): Use get_ipa_tdesc.
(gdb_collect): Ditto.
(gdb_probe): Ditto.
* tracepoint.h (get_ipa_tdesc): New prototype.
(ipa_tdesc): Remove.
gdb/testsuite/ChangeLog:
PR gdb/13808
* gdb.trace/ftrace.exp (test_fast_tracepoints): Remove kfail.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r-- | gdb/gdbserver/target.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index 5af2051..4c14c20 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -471,6 +471,9 @@ struct target_ops /* Return 1 if the target supports catch syscall, 0 (or leave the callback NULL) otherwise. */ int (*supports_catch_syscall) (void); + + /* Return tdesc index for IPA. */ + int (*get_ipa_tdesc_idx) (void); }; extern struct target_ops *the_target; @@ -550,6 +553,10 @@ int kill_inferior (int); (the_target->supports_catch_syscall ? \ (*the_target->supports_catch_syscall) () : 0) +#define target_get_ipa_tdesc_idx() \ + (the_target->get_ipa_tdesc_idx \ + ? (*the_target->get_ipa_tdesc_idx) () : 0) + #define target_supports_tracepoints() \ (the_target->supports_tracepoints \ ? (*the_target->supports_tracepoints) () : 0) |