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]

RE: [PATCH 3/8] Python: Use correct ptid in btrace recording


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

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