btrace: store raw btrace data

Store the raw branch trace data that has been read from the target.

This data can be used for maintenance commands as well as for generating
a core file for the "record save" command.

gdb/
	* btrace.c (btrace_fetch): Append the new trace data.
	(btrace_clear): Clear the stored trace data.
	* btrace.h (btrace_thread_info) <data>: New.
	* common/btrace-common.h (btrace_data_clear)
	(btrace_data_append): New.
	* common/btrace-common.c (btrace_data_clear)
	(btrace_data_append): New.
This commit is contained in:
Markus Metzger
2014-02-03 11:40:50 +01:00
parent 010a18a1b1
commit 9be54cae43
5 changed files with 114 additions and 0 deletions

View File

@@ -214,7 +214,16 @@ extern void btrace_data_init (struct btrace_data *data);
/* Cleanup DATA. */
extern void btrace_data_fini (struct btrace_data *data);
/* Clear DATA. */
extern void btrace_data_clear (struct btrace_data *data);
/* Return non-zero if DATA is empty; zero otherwise. */
extern int btrace_data_empty (struct btrace_data *data);
/* Append the branch trace data from SRC to the end of DST.
Both SRC and DST must use the same format.
Returns zero on success; a negative number otherwise. */
extern int btrace_data_append (struct btrace_data *dst,
const struct btrace_data *src);
#endif /* BTRACE_COMMON_H */