This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] new test script for gnatsweb gdb/15
- To: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Subject: Re: [RFA] new test script for gnatsweb gdb/15
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Mon, 29 Jan 2001 19:19:19 -0500
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat Canada
- References: <200101292359.PAA19159@bosch.cygnus.com>
Michael Elizabeth Chastain wrote:
>
> This patch adds a test for gdb-gnats bug gdb/15. I have already submitted a
> bug fix as a separate patch.
>
> The test gives an ERROR on the current sourceware gdb (it actually
> crashes gdb). It will give a PASS once gdb/15 is fixed.
>
> OK to apply?
>
Nice detective work :-) One more loop is gone.
I guess there is no way to detect this malfunction without going all the
way to the crash, right? It would be nice if you could find a way to
detect that and produce a FAIL but I confess I don't see how. But you
looked
at the code, so maybe you can think of something.
Also, I am concerned that we are creating structN.exp test files. I
wonder
if we couldn't have all struct tests in the struct.exp file.
Could you please take a look and see if you can't incorporate this into
that
file (and if you feel like do the same with that struct2.exp)?
Thanks,
Fernando
> Michael Elizabeth Chastain
> <chastain@redhat.com>
> "love without fear"
>
> ===
>
> 2001-01-29 Michael Chastain <chastain@redhat.com>
>
> * gdb.base/structs3.exp: New file. Tests gdb-gnats bug gdb/15.
> * gdb.base/structs3.c: New file.
>
> ===
>
> Index: gdb/testsuite/gdb.base/structs3.c
> ===================================================================
> RCS file: structs3.c
> diff -N structs3.c
> 0a1,57
> > /* gdb-gnats gdb/15 */
> >
> > struct tag_00 * tag_00 (int a0)
> > {
> > return 0;
> > }
> >
> > int
> > main ()
> > {
> > #ifdef usestubs
> > set_debug_traps ();
> > breakpoint ();
> > #endif
> >
> > tag_00( 0 );
> > return 0;
> > }
> >
> > int sym_0;
> > int sym_1;
> > int sym_2;
> > int sym_3;
> > int sym_4;
> > int sym_5;
> > int sym_6;
> > int sym_7;
> > int sym_8;
> > int sym_9;
> > int sym_10;
> > int sym_11;
> > int sym_12;
> > int sym_13;
> > int sym_14;
> > int sym_15;
> > int sym_16;
> > int sym_17;
> > int sym_18;
> > int sym_19;
> > int sym_20;
> > int sym_21;
> > int sym_22;
> > int sym_23;
> > int sym_24;
> > int sym_25;
> > int sym_26;
> > int sym_27;
> > int sym_28;
> > int sym_29;
> > int sym_30;
> > int sym_31;
> > int sym_32;
> > int sym_33;
> > int sym_34;
> > int sym_35;
> > int sym_36;
> > int sym_37;
> Index: gdb/testsuite/gdb.base/structs3.exp
> ===================================================================
> RCS file: structs3.exp
> diff -N structs3.exp
> 0a1,55
> > # Copyright 2001 Free Software Foundation, Inc.
> >
> > # 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 2 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, write to the Free Software
> > # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> >
> > # Please email any bugs, comments, and/or additions to this file to:
> > # bug-gdb@prep.ai.mit.edu
> >
> > # Written by Michael Chastain <chastain@redhat.com>
> > # This is gdb-gnats gdb/15.
> >
> > if $tracelevel then {
> > strace $tracelevel
> > }
> >
> > set prms_id 0
> > set bug_id 0
> >
> > set testfile "structs3"
> > set srcfile ${testfile}.c
> > set binfile ${objdir}/${subdir}/${testfile}
> >
> > # build the first test case
> > if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
> > gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> > }
> >
> > # Start with a fresh gdb.
> >
> > gdb_exit
> > gdb_start
> > gdb_reinitialize_dir $srcdir/$subdir
> > gdb_load ${binfile}
> >
> > if { ![runto_main] } then {
> > perror "couldn't run to breakpoint"
> > continue
> > }
> >
> > gdb_test "ptype tag_00" "type.*=.*struct.*tag_00.*incomplete type.*int.*"
> >
> > # End of tests.
> >
> > gdb_continue_to_end "finish program"
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9