This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 3/8] Python: Use correct ptid in btrace recording
- From: "Wiederhake, Tim" <tim dot wiederhake at intel dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "Metzger, Markus T" <markus dot t dot metzger at intel dot com>, "brobecker at adacore dot com" <brobecker at adacore dot com>
- Date: Thu, 20 Apr 2017 13:43:18 +0000
- Subject: RE: [PATCH 3/8] Python: Use correct ptid in btrace recording
- Authentication-results: sourceware.org; auth=none
- Dlp-product: dlpe-windows
- Dlp-reaction: no-action
- Dlp-version: 10.0.102.7
- References: <1492095516-8650-1-git-send-email-tim.wiederhake@intel.com> <1492095516-8650-4-git-send-email-tim.wiederhake@intel.com> <86lgqv8lgs.fsf@gmail.com>
Hi Yao!
Thanks for reviewing!
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Yao Qi
> Sent: Thursday, April 20, 2017 11:42 AM
> To: Wiederhake, Tim <tim.wiederhake@intel.com>
> Cc: gdb-patches@sourceware.org; Metzger, Markus T
> <markus.t.metzger@intel.com>; brobecker@adacore.com
> Subject: Re: [PATCH 3/8] Python: Use correct ptid in btrace recording
>
> Tim Wiederhake <tim.wiederhake@intel.com> writes:
>
> > +
> > +# Thread 1 is supposed to call func1 (), thread 2 is supposed to call
> func2 ().
> > +# Check that the function call history for the current thread contains
> a call
> > +# to the right function and does not contain a call to the wrong
> function.
> > +proc check_insn_for_thread { self other } {
>
> Need to switch current thread to "self".
We want to explicitly test retrieving the recorded data from a thread that is not the current one.
That's why we have two gdb.Record objects here.
> > + gdb_test_no_output "python fch = rec$self.function_call_history"
> > + gdb_test_no_output "python f1calls = \{x for x in fch if x.symbol and
> x.symbol.name == \"func1\"\}"
> > + gdb_test_no_output "python f2calls = \{x for x in fch if x.symbol and
> x.symbol.name == \"func2\"\}"
> > +
> > + gdb_test "python print not f${self}calls" "False"
> > + gdb_test "python print not f${other}calls" "True"
> > +}
> > +
> > +with_test_prefix "thread 1" {
> > + check_insn_for_thread 1 2
> > +}
> > +
> > +with_test_prefix "thread 2" {
> > + check_insn_for_thread 2 1
> > +}
>
> You can move with_test_prefix into check_insn_for_thread,
>
> proc check_insn_for_thread { self other } {
> with_test_prefix "treadh $self" {
> }
> }
Right, changed locally.
>
> --
> Yao (齐尧)
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