This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 3/7] btrace: Use binary search to find instruction.
- From: "Wiederhake, Tim" <tim dot wiederhake at intel dot com>
- To: 'Simon Marchi' <simon dot marchi at polymtl dot ca>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "palves at redhat dot com" <palves at redhat dot com>, "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Date: Wed, 2 Nov 2016 10:01:39 +0000
- Subject: RE: [PATCH 3/7] btrace: Use binary search to find instruction.
- Authentication-results: sourceware.org; auth=none
- References: <1477549711-2603-1-git-send-email-tim.wiederhake@intel.com> <1477549711-2603-4-git-send-email-tim.wiederhake@intel.com> <32eeec01cc2ddc61dcb90caab5a6e645@polymtl.ca>
Hi Simon,
Thanks for your input!
> Unless you expect to backport this patch in the 7.12 branch (which I don't think is the case here), you can use C++ standard containers and functions. Specifically, std::vector instead of DEF_VEC, and probably std::lower_bound (if I understand correctly what the code is doing).
struct btrace_thread_info is initialized by memset'ing it to zero. If I'm not mistaken we can't do that if the struct contains a C++ member with a constructor.
> Also, since we now have btrace_function pointers in a sorted vector, do we still need them to be linked together as a linked list?
The btrace_function pointers will go away in the next patch series.
Tim
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928