diff options
author | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-05-30 12:47:37 +0200 |
---|---|---|
committer | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-05-30 12:49:25 +0200 |
commit | 08c3f6d234761d92b50d3c56d3cb4b82fdd58c77 (patch) | |
tree | f75f360cd18d35994ef8d12c75c00b86a1ad8972 /gdb/btrace.h | |
parent | 8ffd39f2e42151b383616923ae922e697273ec8e (diff) | |
download | gdb-08c3f6d234761d92b50d3c56d3cb4b82fdd58c77.zip gdb-08c3f6d234761d92b50d3c56d3cb4b82fdd58c77.tar.gz gdb-08c3f6d234761d92b50d3c56d3cb4b82fdd58c77.tar.bz2 |
btrace: Store function segments as objects.
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r-- | gdb/btrace.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h index ed5fe91..9fde919 100644 --- a/gdb/btrace.h +++ b/gdb/btrace.h @@ -135,6 +135,13 @@ enum btrace_pt_error We do not allow function segments without instructions otherwise. */ struct btrace_function { + btrace_function (struct minimal_symbol *msym_, struct symbol *sym_, + unsigned int number_, unsigned int insn_offset_, int level_) + : msym (msym_), sym (sym_), insn_offset (insn_offset_), number (number_), + level (level_) + { + } + /* The full and minimal symbol for the function. Both may be NULL. */ struct minimal_symbol *msym; struct symbol *sym; @@ -143,22 +150,22 @@ struct btrace_function the same function. If a function calls another function, the former will have at least two segments: one before the call and another after the return. Will be zero if there is no such function segment. */ - unsigned int prev; - unsigned int next; + unsigned int prev = 0; + unsigned int next = 0; /* The function segment number of the directly preceding function segment in a (fake) call stack. Will be zero if there is no such function segment in the record. */ - unsigned int up; + unsigned int up = 0; /* The instructions in this function segment. The instruction vector will be empty if the function segment represents a decode error. */ - VEC (btrace_insn_s) *insn; + VEC (btrace_insn_s) *insn = NULL; /* The error code of a decode error that led to a gap. Must be zero unless INSN is empty; non-zero otherwise. */ - int errcode; + int errcode = 0; /* The instruction number offset for the first instruction in this function segment. @@ -180,7 +187,7 @@ struct btrace_function int level; /* A bit-vector of btrace_function_flag. */ - btrace_function_flags flags; + btrace_function_flags flags = 0; }; /* A branch trace instruction iterator. */ @@ -325,10 +332,10 @@ struct btrace_thread_info /* The raw branch trace data for the below branch trace. */ struct btrace_data data; - /* Vector of pointer to decoded function segments in execution flow order. + /* Vector of decoded function segments in execution flow order. Note that the numbering for btrace function segments starts with 1, so function segment i will be at index (i - 1). */ - std::vector<btrace_function *> functions; + std::vector<btrace_function> functions; /* The function level offset. When added to each function's LEVEL, this normalizes the function levels such that the smallest level |