aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorMarkus Metzger <mmetzger@sourceware.org>2013-03-11 08:17:08 +0000
committerMarkus Metzger <mmetzger@sourceware.org>2013-03-11 08:17:08 +0000
commit02d27625761a91b9ea78ab4048e1171a7b47a603 (patch)
treeb2ccd263c72cb451d952aca550d8389ce488e6e7 /gdb/target.h
parent7bc0ae020fedff59d2acda93cb9e78b112b350ea (diff)
downloadgdb-02d27625761a91b9ea78ab4048e1171a7b47a603.zip
gdb-02d27625761a91b9ea78ab4048e1171a7b47a603.tar.gz
gdb-02d27625761a91b9ea78ab4048e1171a7b47a603.tar.bz2
Add branch trace information to struct thread_info.
Add functions to enable, disable, clear, and fetch a thread's branch trace. gdb/ * target.h: Include btrace.h. (struct target_ops) <to_supports_btrace, to_enable_btrace, to_disable_btrace, to_teardown_btrace, to_read_btrace>: New. * target.c (target_supports_btrace): New function. (target_enable_btrace): New function. (target_disable_btrace): New function. (target_teardown_btrace): New function. (target_read_btrace): New function. * btrace.h: New file. * btrace.c: New file. * Makefile.in: Add btrace.c. * gdbthread.h: Include btrace.h. (struct thread_info): Add btrace field. * thread.c: Include btrace.h. (clear_thread_inferior_resources): Call target_teardown_btrace. * common/btrace-common.h: New file.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/gdb/target.h b/gdb/target.h
index c99642d..05a3ad1 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -62,6 +62,7 @@ struct expression;
#include "memattr.h"
#include "vec.h"
#include "gdb_signals.h"
+#include "btrace.h"
enum strata
{
@@ -286,7 +287,7 @@ enum target_object
/* Darwin dynamic linker info data. */
TARGET_OBJECT_DARWIN_DYLD_INFO,
/* OpenVMS Unwind Information Block. */
- TARGET_OBJECT_OPENVMS_UIB
+ TARGET_OBJECT_OPENVMS_UIB,
/* Possible future objects: TARGET_OBJECT_FILE, ... */
};
@@ -859,6 +860,26 @@ struct target_ops
/* Is the target able to use agent in current state? */
int (*to_can_use_agent) (void);
+ /* Check whether the target supports branch tracing. */
+ int (*to_supports_btrace) (void);
+
+ /* Enable branch tracing for PTID and allocate a branch trace target
+ information struct for reading and for disabling branch trace. */
+ struct btrace_target_info *(*to_enable_btrace) (ptid_t ptid);
+
+ /* Disable branch tracing and deallocate TINFO. */
+ void (*to_disable_btrace) (struct btrace_target_info *tinfo);
+
+ /* Disable branch tracing and deallocate TINFO. This function is similar
+ to to_disable_btrace, except that it is called during teardown and is
+ only allowed to perform actions that are safe. A counter-example would
+ be attempting to talk to a remote target. */
+ void (*to_teardown_btrace) (struct btrace_target_info *tinfo);
+
+ /* Read branch trace data. */
+ VEC (btrace_block_s) *(*to_read_btrace) (struct btrace_target_info *,
+ enum btrace_read_type);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -1902,4 +1923,21 @@ extern void update_target_permissions (void);
/* Blank target vector entries are initialized to target_ignore. */
void target_ignore (void);
+/* See to_supports_btrace in struct target_ops. */
+extern int target_supports_btrace (void);
+
+/* See to_enable_btrace in struct target_ops. */
+extern struct btrace_target_info *target_enable_btrace (ptid_t ptid);
+
+/* See to_disable_btrace in struct target_ops. */
+extern void target_disable_btrace (struct btrace_target_info *btinfo);
+
+/* See to_teardown_btrace in struct target_ops. */
+extern void target_teardown_btrace (struct btrace_target_info *btinfo);
+
+/* See to_read_btrace in struct target_ops. */
+extern VEC (btrace_block_s) *target_read_btrace (struct btrace_target_info *,
+ enum btrace_read_type);
+
+
#endif /* !defined (TARGET_H) */