This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 00/11] btrace: Turn linked list of function call segments into vector


Hi all,

this series removes the extra list of btrace function call segments in struct
btrace_thread_info.  To achieve this, the doubly linked list of function call
segments in struct btrace_thread_info is replaced by a (GDB) vector.  In some
instances, struct btrace_thread_info is initialized by memset'ing it to 0x00,
so we can't use std::vector (yet).

Patch 1, 2 and 3 are preparation, patch 4 and 5 change the iterators
(struct btrace_call_iterator and struct btrace_insn_iterator) to use indices
instead of pointers, patch 6 to 11 actually replace the the linked list in
struct btrace_thread_info.

Patch 6 to 11 is actually only one patch that is split up for easier review.
As we push more function call segments in the vector when we decode the trace,
the vector may run out of space and reallocate, rendering all pointers invalid
and preventing incremental change from pointer usage to index usage.

Patch 6 introduces some temporary pre-allocating of memory for this vector,
which is removed in patch 11.  This wastes a lot of memory but allows for
testing each step of the transition.

Regards,
Tim

Tim Wiederhake (11):
  btrace: Use struct btrace_thread_info fields directly.
  btrace: Change parameters to use btrace_thread_info.
  btrace: Add btinfo to instruction interator.
  btrace: Use function segment index in call iterator.
  btrace: Use function segment index in insn iterator.
  [SQUASH] btrace: Save function calls in a vector.
  [SQUASH] btrace: Adjust struct btrace_function::up.
  [SQUASH] btrace: Adjust struct btrace_function::{flow,segment}.
  [SQUASH] btrace: Remove struct btrace_thread_info::{begin,end}.
  [SQUASH] btrace: Remove bfun_s vector.
  [SQUASH] btrace: Cleanup.

 gdb/btrace.c                  | 843 ++++++++++++++++++++----------------------
 gdb/btrace.h                  |  56 ++-
 gdb/python/py-record-btrace.c |  12 +-
 gdb/record-btrace.c           |  32 +-
 4 files changed, 462 insertions(+), 481 deletions(-)

-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]