Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Andy Wingo <wingo@igalia.com>
Cc: gdb-patches@sourceware.org,  jan.kratochvil@redhat.com,
	 sanjoyd@sourceware.org
Subject: Re: Missing test cases for jit-reader interface
Date: Wed, 25 Feb 2015 15:50:00 -0000	[thread overview]
Message-ID: <86y4nmvvme.fsf@gmail.com> (raw)
In-Reply-To: <87k2z8ydq4.fsf@igalia.com> (Andy Wingo's message of "Mon, 23 Feb	2015 14:11:31 +0100")

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 (齐尧)


  parent reply	other threads:[~2015-02-25 15:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 10:23 Andy Wingo
2015-02-23 13:11 ` Andy Wingo
2015-02-25  7:38   ` Sanjoy Das
2015-02-25 15:50   ` Yao Qi [this message]
2015-02-25 16:23     ` Andy Wingo
2015-02-25 22:39       ` Yao Qi
2015-02-26  9:02         ` Andy Wingo
2016-06-17 18:56     ` [pushed] " Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y4nmvvme.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=sanjoyd@sourceware.org \
    --cc=wingo@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox