aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-10-14 08:47:44 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-14 08:47:44 -0400
commit2098b39391a5ade9ed308d76f2dfc7ceedd2d9a3 (patch)
treea6be020ecea33167c825e9898e81d2f32b8066c6 /gdb/tracepoint.h
parent4cdd21a8d3fd943d6993e9d053edf09583802744 (diff)
downloadgdb-2098b39391a5ade9ed308d76f2dfc7ceedd2d9a3.zip
gdb-2098b39391a5ade9ed308d76f2dfc7ceedd2d9a3.tar.gz
gdb-2098b39391a5ade9ed308d76f2dfc7ceedd2d9a3.tar.bz2
Make to_traceframe_info return a unique_ptr
Since this target method returns an allocated object, return a unique_ptr. It allows getting rid a some cleanups here and there. I had to shuffle the includes around. First, target.h now needs to include tracepoint.h, to get the definition of traceframe_info_up. However, the definition of enum trace_find_type was later in target, so I had to move it to tracepoint.h, so that the declaration of tfind_1 could know about it. I then had to remove the include of target.h from tracepoint.h, which caused a circular dependency (it was probably included to get enum trace_find_type in the first place anyway). Regression tested on the buildbot. gdb/ChangeLog: * target.h: Include tracepoint.h. (enum trace_find_type): Move to tracepoint.h. (struct target_ops) <to_traceframe_info>: Return a unique ptr. * tracepoint.h: Don't include target.h (enum trace_find_type): Move from target.h. (parse_traceframe_info): Return a unique ptr. * tracepoint.c (current_traceframe_info): Change type to unique ptr. (free_traceframe_info): Remove. (clear_traceframe_info): Don't manually free current_traceframe_info. (free_result): Remove. (parse_traceframe_info): Return a unique ptr. (get_traceframe_info): Adjust to unique ptr. * ctf.c (ctf_traceframe_info): Return a unique ptr. * remote.c (remote_traceframe_info): Return a unique ptr. * tracefile-tfile.c (tfile_traceframe_info): Return a unique ptr. * target-debug.h (target_debug_print_traceframe_info_up): New macro. * target-delegates.c: Regenerate.
Diffstat (limited to 'gdb/tracepoint.h')
-rw-r--r--gdb/tracepoint.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index 872681d..88c18c3 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -20,7 +20,6 @@
#define TRACEPOINT_H 1
#include "breakpoint.h"
-#include "target.h"
#include "memrange.h"
#include "gdb_vecs.h"
@@ -38,6 +37,8 @@ struct traceframe_info
std::vector<int> tvars;
};
+typedef std::unique_ptr<traceframe_info> traceframe_info_up;
+
/* A trace state variable is a value managed by a target being
traced. A trace state variable (or tsv for short) can be accessed
and assigned to by tracepoint actions and conditionals, but is not
@@ -376,6 +377,18 @@ extern void trace_status_mi (int on_stop);
extern void tvariables_info_1 (void);
extern void save_trace_state_variables (struct ui_file *fp);
+/* Enumeration of the kinds of traceframe searches that a target may
+ be able to perform. */
+
+enum trace_find_type
+{
+ tfind_number,
+ tfind_pc,
+ tfind_tp,
+ tfind_range,
+ tfind_outside,
+};
+
extern void tfind_1 (enum trace_find_type type, int num,
CORE_ADDR addr1, CORE_ADDR addr2,
int from_tty);
@@ -385,7 +398,7 @@ extern void trace_save_tfile (const char *filename,
extern void trace_save_ctf (const char *dirname,
int target_does_save);
-extern struct traceframe_info *parse_traceframe_info (const char *tframe_info);
+extern traceframe_info_up parse_traceframe_info (const char *tframe_info);
extern int traceframe_available_memory (VEC(mem_range_s) **result,
CORE_ADDR memaddr, ULONGEST len);