This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Missing test cases for jit-reader interface
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com, sanjoyd at sourceware dot org
- Date: Wed, 25 Feb 2015 15:50:01 +0000
- Subject: Re: Missing test cases for jit-reader interface
- Authentication-results: sourceware.org; auth=none
- References: <87oaolx6xy dot fsf at igalia dot com> <87k2z8ydq4 dot fsf at igalia dot com>
Andy Wingo <wingo@igalia.com> writes:
> I think it was Sanjoy who forgot to commit these. Anyway, here is an
> updated version of the same patch, which passes tests for me. WDYT?
>
Yes, we should add them back since they were reviewed and approved.
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/jit-protocol.h
> @@ -0,0 +1,54 @@
> +/* Copyright (C) 2009-2013 Free Software Foundation, Inc.
It should be 2009-2013.
> diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
> new file mode 100644
> index 0000000..6080564
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/jit-reader.exp
> @@ -0,0 +1,80 @@
> +# Copyright 2012 Free Software Foundation, Inc.
Likewise.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +
> +standard_testfile jithost.c
> +
> +if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is_lp64_target] } {
> + return -1;
> +}
I don't see any reason why this test is arch specific. We can remove
such checking, IMO.
> +
> +if {[skip_shlib_tests]} {
> + return -1
> +}
> +
> +if { ![isnative] } {
> + return -1
> +}
and remove it too.
> +
> +if {[get_compiler_info]} {
> + untested "could not get compiler info"
> + return 1
> +}
> +
> +set jit_host_src ${srcfile}
> +set jit_host_bin ${binfile}
> +
> +# We inject the complete path to jit-reader.h into the source file
> +# lest we end up (incorrectly) building against a system-installed
> +# version.
> +set jit_reader_header [standard_output_file "../../../gdb/jit-reader.h"]
> +set jit_reader_flag "-DJIT_READER_H=\"$jit_reader_header\""
> +
> +if { [gdb_compile "${srcdir}/${subdir}/${jit_host_src}" "${jit_host_bin}" \
> + executable [list debug additional_flags=$jit_reader_flag]] != "" } {
> + untested jit-reader.exp
> + return -1
> +}
> +
> +set jit_reader jitreader
> +set jit_reader_src ${jit_reader}.c
> +set jit_reader_bin [standard_output_file ${jit_reader}.so]
> +
> +if { [gdb_compile_shlib "${srcdir}/${subdir}/${jit_reader_src}" "${jit_reader_bin}" \
> + [list debug additional_flags=$jit_reader_flag]] != "" } {
> + untested jit-reader.exp
> + return -1
> +}
> +
> +gdb_load_shlibs "${jit_reader_bin}"
> +
It should be moved into jit_reader_test, after clean_restart, otherwise,
we'll get the following errors if I run it with --target_board=native-gdbserver.
ERROR: tcl error sourcing /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.base/jit-reader.exp.
ERROR: can't read "use_gdb_stub": no such variable
while executing
"if {$use_gdb_stub
&& [regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} $command]} {
error "gdbserver does not support $command wi..."
(procedure "gdb_test_multiple" line 21)
invoked from within
"gdb_test_multiple $command $message {
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
..."
(procedure "gdb_test" line 22)
invoked from within
--
Yao (éå)