This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 6/7] python: Add tests for record Python bindings
Hi Simon,
Thanks for the comments!
> -----Original Message-----
> From: Simon Marchi [mailto:simon.marchi@polymtl.ca]
> Sent: Thursday, October 27, 2016 6:00 PM
> To: Wiederhake, Tim <tim.wiederhake@intel.com>
> Cc: gdb-patches@sourceware.org; palves@redhat.com; Metzger, Markus T
> <markus.t.metzger@intel.com>
> Subject: Re: [PATCH 6/7] python: Add tests for record Python bindings
>
> On 2016-10-27 02:28, Tim Wiederhake wrote:
> > +# Skip this test if btrace is disabled.
> > +
> > +if { [skip_btrace_tests] } { return -1 }
>
> Would it be helpful to have at least some minimal tests using the "full"
> method, even if btrace is not available?
If you are recording using the "full" method and try to access the data from Python, you get a not-yet-implemented exception. All we can test in this case is that the recording method in the gdb.Record object is displayed properly, i.e. gdb.current_recording().method == "full". I could rename py-record.exp to py-record-btrace.exp and add a py-record-full.exp with that exact test in it, but I don't see too much value in that. Your opinion?
> > +with_test_prefix "no or double record" {
> > + gdb_test "python print(gdb.current_recording())" "None"
> > +
> > + gdb_test_no_output "python gdb.start_recording()"
> > + gdb_test "python gdb.start_recording(\"full\")" ".*gdb\.error:
> > The process is already being recorded\..*"
> > +
> > + gdb_test_no_output "python gdb.stop_recording()"
> > + gdb_test "python gdb.stop_recording()" ".*gdb\.error: No record
> > target is currently active\..*"
>
> These last two tests give the same test name (which must be unique).
> You could give a specific name to one of them.
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