This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V2 7/9] Simple testsuite for DTrace USDT probes.
- From: Pedro Alves <palves at redhat dot com>
- To: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>, gdb-patches at sourceware dot org
- Date: Thu, 16 Oct 2014 23:36:40 +0100
- Subject: Re: [PATCH V2 7/9] Simple testsuite for DTrace USDT probes.
- Authentication-results: sourceware.org; auth=none
- References: <1412961772-16249-1-git-send-email-jose dot marchesi at oracle dot com> <1412961772-16249-8-git-send-email-jose dot marchesi at oracle dot com>
Hi Jose,
> + set result [catch "exec $dtrace -V" output]
Please use "remote_exec host" to invoke tools on the host.
> + set dscript_file "${srcdir}/${subdir}/${testfile}.d"
> + set out_header_file "${srcdir}/${subdir}/${testfile}.h"
Generating files in the ${srcdir} is a no-no.
Use standard_output_file to put this in the build dir, and to
make it parallel safe.
> + set result \
> + [catch "exec $dtrace -h -s $dscript_file -o $out_header_file" output]
> + verbose -log $output
> + if {$result != 0} {
> + fail "invoke dtrace -h to generate the header file for USDT probes"
> + return -1
> + }
> +
> + if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != ""} {
> + fail "compile ${binfile}.o"
> + return -1
> + }
> +
> + set result \
> + [catch "exec $dtrace -G -s $dscript_file ${binfile}.o -o ${binfile}-p.o" output]
> + verbose -log $output
> + if {$result != 0} {
> + fail "invoke dtrace -G to generate the object file with probe information"
> + return -1
> + }
> +
> + if {[gdb_compile "${binfile}.o ${binfile}-p.o" ${binfile} executable {debug}] != ""} {
> + fail "compile ${binfile}"
> + return -1
> + }
Seems like this routine may be general enough that it'd be reused for other
tests. How about putting it a new testsuite/lib/dtrace.exp file?
It's not usual that failure to compile generates a FAIL. Do we need that?
Instead, it's more usual for the caller of a routine that builds
the test to call "untested" on build failure.
> + gdb_test "break -pdtrace test:two-locations" \
> + "Breakpoint \[0-9\]+ at $hex.*2 locations.*" \
> + "set multii-location probe breakpoint (probe two-locations)"
typo "multii".
Thanks,
Pedro Alves