This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v6 03/21] btrace: change branch trace data structure
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: gdb-patches at sourceware dot org, Christian Himpel <christian dot himpel at intel dot com>
- Date: Sun, 6 Oct 2013 21:46:36 +0200
- Subject: Re: [patch v6 03/21] btrace: change branch trace data structure
- Authentication-results: sourceware.org; auth=none
- References: <1379676639-31802-1-git-send-email-markus dot t dot metzger at intel dot com> <1379676639-31802-4-git-send-email-markus dot t dot metzger at intel dot com>
On Fri, 20 Sep 2013 13:30:21 +0200, Markus Metzger wrote:
> --- a/gdb/btrace.h
> +++ b/gdb/btrace.h
[...]
> @@ -103,16 +168,25 @@ struct btrace_thread_info
> the underlying architecture. */
> struct btrace_target_info *target;
>
> - /* The current branch trace for this thread. */
> - VEC (btrace_block_s) *btrace;
> - VEC (btrace_inst_s) *itrace;
> - VEC (btrace_func_s) *ftrace;
> + /* The current branch trace for this thread (both inclusive).
> +
> + The last instruction of END is the current instruction, which is not
> + part of the execution history.
> + Both will be NULL if there is not branch trace available. If there is
I do not think the wording is right. Either:
Both will be NULL if branch trace is not available.
or
Both will be NULL if there is no branch trace available.
> + branch trace available, both will be non-NULL. */
> + struct btrace_function *begin;
> + struct btrace_function *end;
> +
> + /* The function level offset. When added to each function's LEVEL,
> + this normalizes the function levels such that the smallest level
> + becomes zero. */
> + int level;
>
[...]
> +/* Initialize a branch trace call iterator to point to the begin/end of
> + the branch trace. Throws an error if there is no branch trace. */
> +extern void btrace_call_begin (struct btrace_call_iterator *,
> + const struct btrace_thread_info *);
> +extern void btrace_call_end (struct btrace_call_iterator *,
> + const struct btrace_thread_info *);
> +
> +/* Increment/decrement a branch trace call iterator by at most STRIDE function
> + segments. Return the number of function segments s by which the call
Typo, excessive " s ".
> + iterator has been advanced.
> + Returns zero, if the operation failed or STRIDE had been zero. */
> +extern unsigned int btrace_call_next (struct btrace_call_iterator *,
> + unsigned int stride);
> +extern unsigned int btrace_call_prev (struct btrace_call_iterator *,
> + unsigned int stride);
Thanks,
Jan