mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
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:
@@ -1260,6 +1260,10 @@ btrace_fetch (struct thread_info *tp)
|
||||
/* Compute the trace, provided we have any. */
|
||||
if (!btrace_data_empty (&btrace))
|
||||
{
|
||||
/* Store the raw trace data. The stored data will be cleared in
|
||||
btrace_clear, so we always append the new trace. */
|
||||
btrace_data_append (&btinfo->data, &btrace);
|
||||
|
||||
btrace_clear_history (btinfo);
|
||||
btrace_compute_ftrace (tp, &btrace);
|
||||
}
|
||||
@@ -1296,6 +1300,7 @@ btrace_clear (struct thread_info *tp)
|
||||
btinfo->end = NULL;
|
||||
btinfo->ngaps = 0;
|
||||
|
||||
btrace_data_clear (&btinfo->data);
|
||||
btrace_clear_history (btinfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user