Home | History | Annotate | Line # | Download | only in gdb
t_regress.sh revision 1.1
      1  1.1  gson # $NetBSD: t_regress.sh,v 1.1 2016/04/08 10:09:16 gson Exp $
      2  1.1  gson #
      3  1.1  gson # Copyright (c) 2016 The NetBSD Foundation, Inc.
      4  1.1  gson # All rights reserved.
      5  1.1  gson #
      6  1.1  gson # Redistribution and use in source and binary forms, with or without
      7  1.1  gson # modification, are permitted provided that the following conditions
      8  1.1  gson # are met:
      9  1.1  gson # 1. Redistributions of source code must retain the above copyright
     10  1.1  gson #    notice, this list of conditions and the following disclaimer.
     11  1.1  gson # 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  gson #    notice, this list of conditions and the following disclaimer in the
     13  1.1  gson #    documentation and/or other materials provided with the distribution.
     14  1.1  gson #
     15  1.1  gson # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     16  1.1  gson # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     17  1.1  gson # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18  1.1  gson # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     19  1.1  gson # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     20  1.1  gson # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     21  1.1  gson # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     22  1.1  gson # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     23  1.1  gson # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     24  1.1  gson # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25  1.1  gson # POSSIBILITY OF SUCH DAMAGE.
     26  1.1  gson #
     27  1.1  gson 
     28  1.1  gson # Regression tests for some GDB PRs
     29  1.1  gson 
     30  1.1  gson # PR 47430
     31  1.1  gson 
     32  1.1  gson atf_test_case threads
     33  1.1  gson threads_head() {
     34  1.1  gson 	atf_set "descr" "Test that gdb works with threaded programs"
     35  1.1  gson 	atf_set "require.progs" "gdb"
     36  1.1  gson }
     37  1.1  gson threads_body() {
     38  1.1  gson 	# Dig at an unused IP address so that dig fails the
     39  1.1  gson 	# same way on machines with Internet connectivity
     40  1.1  gson 	# as on those without.
     41  1.1  gson 	cat <<EOF >test.gdb
     42  1.1  gson run +time=1 +tries=1 @127.0.0.177
     43  1.1  gson cont
     44  1.1  gson cont
     45  1.1  gson cont
     46  1.1  gson cont
     47  1.1  gson cont
     48  1.1  gson EOF
     49  1.1  gson 	gdb --batch -x test.gdb dig >gdb.out
     50  1.1  gson 	atf_check -s exit:1 -o ignore -e ignore grep "Program received signal SIGTRAP" gdb.out
     51  1.1  gson }
     52  1.1  gson 
     53  1.1  gson # PR 48250
     54  1.1  gson 
     55  1.1  gson atf_test_case pie
     56  1.1  gson pie_head() {
     57  1.1  gson 	atf_set "descr" "Test that gdb works with PIE executables"
     58  1.1  gson 	atf_set "require.progs" "cc gdb"
     59  1.1  gson }
     60  1.1  gson pie_body() {
     61  1.1  gson 	cat <<\EOF >test.c
     62  1.1  gson #include <stdio.h>
     63  1.1  gson int main(int argc, char **argv) { printf ("hello\n"); return 0; }
     64  1.1  gson EOF
     65  1.1  gson 	cc -fpie -pie -g test.c -o test
     66  1.1  gson 	cat <<EOF >test.gdb
     67  1.1  gson break main
     68  1.1  gson run
     69  1.1  gson EOF
     70  1.1  gson 	gdb --batch -x test.gdb ./test >gdb.out 2>&1
     71  1.1  gson 	atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out
     72  1.1  gson }
     73  1.1  gson 
     74  1.1  gson atf_init_test_cases() {
     75  1.1  gson 	atf_add_test_case threads
     76  1.1  gson 	atf_add_test_case pie
     77  1.1  gson }
     78