Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: RFC: gdb.c++/main-falloff.exp (a new KFAIL)
@ 2003-01-03 21:17 Michael Elizabeth Chastain
  2003-01-03 21:24 ` David Carlton
  2003-01-03 21:37 ` Daniel Jacobowitz
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-03 21:17 UTC (permalink / raw)
  To: carlton, drow; +Cc: gdb-patches

Daniel J wrote:
> Secondly, I really dislike this form.  Adding gdb_expect's all over is
> bad, because gdb_test has a much more thorough list of things to expect
> indicating various errors.  Better would be to solve this problem with
> a little TCL.  What do you think of:
>   gdb_test_multiple "info locals" \
> 	{pass "(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)"
> 	 kfail "gdb/900" "No locals."} \
> 	"testing locals"

David C replies:
> It would be nice if the branches could execute arbitrary code, like
> gdb_expect does, though, so that the xfails/kfails could be conditional
> on the operating system, debug format, or whatever.

I'm changing my mind about the gdb_test_multiple approach.  I'm not
opposed to gdb_test_multiple, but I don't want KFAIL activity to
wait for it.

My original goals, back around April 2002, were:

(1) provide a way to add new tests which show bugs in gdb.

For example, look at PR gdb/186, "gdb have problems with C++ casting".

  http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&database=gdb&pr=186

I have test code for this.  It's not even a new test case; it is
more test code for gdb.c++/casts.exp (which does not cover classes
that have virtual functions).

My understanding is that it's forbidden to add new tests which FAIL,
but acceptable to add new tests which KFAIL.

I would like to commit my new tests and have them KFAIL with reference
to PR gdb/186.  We talked about problems like this 9 months ago and
KFAIL is the solution that Fernando picked.

(2) connect existing FAILs to the PR database.

We have dozens of tests that already FAIL due to known reasons.
I think everybody wants to start marking those with KFAIL.

I'm getting dismayed by the new turn of events where KFAIL deployment
is sprouting a dependency on new syntax in lib/gdb.exp which needs
to be designed and implemented.

I would rather do these things in parallel.  There are already plenty
of tests which use send_gdb/gdb_expect.  If someone wants to implement a
better facility than send_gdb/gdb_expect, go for it, I will support such
an effort.  As soon as it's available then I will convert gdb.c++/*.exp
to use it.  But I no longer want to hold off on KFAIL activity to wait
for gdb_test_multiple.

Michael C


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: RFC: gdb.c++/main-falloff.exp (a new KFAIL)
@ 2003-01-03 22:03 Michael Elizabeth Chastain
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-03 22:03 UTC (permalink / raw)
  To: drow; +Cc: carlton, gdb-patches

Daniel J rebuffs me with:
> No, please wait until tomorrow so that I can give you something less
> error prone.

Okay.  Heck, for you: Monday.

Monday, I wanna start the KFAIL bacchanalia with whatever syntax
is available at that time.  Deal?

Michael C


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: RFC: gdb.c++/main-falloff.exp (a new KFAIL)
@ 2003-01-03 21:45 Michael Elizabeth Chastain
  2003-01-03 21:49 ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-03 21:45 UTC (permalink / raw)
  To: drow; +Cc: carlton, gdb-patches

As David C mentioned, gdb_test_multiple cannot replace send_gdb/gdb_expect,
because there is no room in the syntax to add TCL code blocks
which some tests use to check compiler version, target version.

> If it's bugging you that bad I'll do it or something similar tomorrow
> morning.

That would be great.

But: is it okay with you if we de-couple these things and proceed
with the KFAIL bacchanal?

Michael C
pushy new yorker


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: RFC: gdb.c++/main-falloff.exp (a new KFAIL)
@ 2002-12-30  8:09 Michael Elizabeth Chastain
  2002-12-30 11:41 ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-30  8:09 UTC (permalink / raw)
  To: drow, gdb-patches

Hi Daniel!

> First of all, KFAIL is (in my opinion) for things that we have analyzed
> and established to be known bugs _in the tool under test_.  That's what
> differentiates them from XFAILs; I thought that was the consensus.

You are right.  I am mixing two issues here.  I agree with you,
but my code doesn't.  :-(

I would like to file a gcc bug on this and then it would be an xfail.
It's only a kfail because I am so conservative about marking bugs
as "gdb bugs" until proven otherwise.  In the past we have been
lax about blaming things as xfail prematurely.

> I.E. the "return 0" is outside of the lexical block for main.  That's
> not necessarily wrong.  We have to decide if it is wrong - whether the
> test case should be updated or a GCC bug report filed.  My inclination
> is that it's a GCC bug.

Me too.  How about if I file it as such, and then make this an XFAIL?

> GDB is behaving exactly as expected given its inputs; ergo, this is not
> a KFAIL at all.

POW.  Ya got me.

> What do you think of:
>   gdb_test_multiple "info locals" \
> 	{pass "(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)"
> 	 kfail "gdb/900" "No locals."} \
> 	"testing locals"

I am open to new syntax.  I do prefer gdb_test to send_gdb/gdb_expect.
I never thought of extending the gdb_test idea but it's a good idea.

So if you're cool with me filing a gcc bug report, I can s/kfail/xfail/,
close PR gdb/900 as "not a gdb bug -- see PR gcc/9NNN", and we can
wrangle about gdb_test_multiple.

I will definitely suspend committing this for a while.

Michael C


^ permalink raw reply	[flat|nested] 11+ messages in thread
* RFC: gdb.c++/main-falloff.exp (a new KFAIL)
@ 2002-12-30  2:36 Michael Elizabeth Chastain
  2002-12-30  8:05 ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-30  2:36 UTC (permalink / raw)
  To: gdb-patches

This is an RFC for main-falloff.exp, a new test script with a single
KFAIL.

This script tests a C++ main() function which has return type int but does
not return a value.  I don't like it, but this is legal C++.  I noticed
this happening with anon-union.exp on 2002-12-18.  anon-union.exp is
exposing another gcc bug so I am writing a separate test just for the
the fall-off-main behavior.

I'd like to get comments on the KFAIL aspect.  main-falloff.exp has just
one useful test, which currently KFAIL's with gcc HEAD%20021224 -gdwarf-2.
I have written the KFAIL code the way that I would like to use KFAIL.

. Is this an acceptable way to use KFAIL?
. Is this a good way to use KFAIL?
. Should we ask/require everyone to do KFAIL like this?

I know I'm probably being a little pedantic about this, I just want to
have a discussion before we find ourselves with four different KFAIL
philosophies in our test suite.  I won't mind at all doing it whatever
way that FernandoN and AndrewC think is best.

Testing: tested on my native i686-pc-linux-gnu test bed with gcc v2
and v3, dwarf-2 and stabs+.  It PASSes with all stabs+ configurations
and with dwarf-2 in 2.95.3, 3.2.1, gcc-3_2-branch, and gcc-3_3-branch.
It KFAILs with gcc HEAD -gdwarf-2.

Michael C

== main-falloff.cc

int main ()
{
  int i, j, k;

  i = 101;
  j = 102;
  k = 103;
}

=== main-falloff.exp

# Copyright 2002 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 Elizabeth Chastain (mec@shout.net)
# This file is part of the gdb testsuite.
#
# Stroustrup, "The C++ Programming Language", 3rd edition, section 3.2, says:
#
#   "Every C++ program must have a function named main().
#    The program starts by executing that function.
#    The int value returned by main(), if any, is the
#    program's return value to ``the system'.''
#    If no value is returned, the system will receive a value
#    indicating successful completion.  A nonzero return
#    value from main() indicates failure."
#
# gcc has special code to handle this wart where main() can legally fall
# off the end.  I have seen bugs in the special code, hence this test case.

if $tracelevel then {
   strace $tracelevel
}

if { [skip_cplus_tests] } { continue }

set prms_id 0
set bug_id 0

set testfile "main-falloff"
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}

if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
  gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}

if [get_compiler_info ${binfile} "c++"] {
  return -1
}

gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}

if ![runto_main] then {
  perror "couldn't run to breakpoint"
  continue
}

# next on through to the closing brace.

gdb_test "next 3" "8.*" "next 3"

# print the locals

send_gdb "info locals\n"
gdb_expect {
  -re "(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)\r\n(i|j|k) = (101|102|103)\r\n$gdb_prompt $" {
    pass "info locals"
  }
  -re "No locals.\r\n$gdb_prompt $" {
    # The locals have disappeared just before the end of the function.
    # This happened with gcc HEAD%20021224 -gdwarf-2.
    # -- chastain 2002-12-29
    kfail "gdb/900" "info locals"
  }
  -re ".*$gdb_prompt $" {
    fail "info locals"
  }
  timeout {
    fail "info locals (timeout)"
  }
}

gdb_exit
return 0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-01-03 22:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-03 21:17 RFC: gdb.c++/main-falloff.exp (a new KFAIL) Michael Elizabeth Chastain
2003-01-03 21:24 ` David Carlton
2003-01-03 21:37 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 22:03 Michael Elizabeth Chastain
2003-01-03 21:45 Michael Elizabeth Chastain
2003-01-03 21:49 ` Daniel Jacobowitz
2002-12-30  8:09 Michael Elizabeth Chastain
2002-12-30 11:41 ` Daniel Jacobowitz
2002-12-30  2:36 Michael Elizabeth Chastain
2002-12-30  8:05 ` Daniel Jacobowitz
2003-01-03 20:53   ` David Carlton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox