From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20100 invoked by alias); 8 Nov 2003 01:05:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20093 invoked from network); 8 Nov 2003 01:05:57 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 8 Nov 2003 01:05:57 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.10/8.12.10) with ESMTP id hA815uud000545; Fri, 7 Nov 2003 19:05:56 -0600 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.10/8.12.9) with ESMTP id hA815ufa028945; Fri, 7 Nov 2003 19:05:56 -0600 Received: (from mec@localhost) by duracef.shout.net (8.12.10/8.12.9/Submit) id hA815u3k028944; Fri, 7 Nov 2003 20:05:56 -0500 Date: Sat, 08 Nov 2003 01:05:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200311080105.hA815u3k028944@duracef.shout.net> To: ac131313@redhat.com Subject: Re: [patch/rfc] Rewrite "structs" testcase Cc: gdb-patches@sources.redhat.com X-SW-Source: 2003-11/txt/msg00150.txt.bz2 The results are: PASS FAIL gcc 2.95.3 -gdwarf-2 544 40 gcc 2.95.3 -gstabs+ 544 40 gcc 3.3.2 -gdwarf-2 540 44 gcc 3.3.2 -gstabs+ 544 40 The problem is in this code: # Now force a return. Be careful to only produce one PASS/FAIL. send_gdb "return foo${n}\n" gdb_expect { -re "Make fun${n} return now.*y or n. $" { send_gdb "y\n" gdb_expect { -re "L${n} *= fun${n}.*${gdb_prompt} $" { # Need to step off the function call gdb_test "next" "L.* *= fun.*" "${test}" } -re "${gdb_prompt} $" { pass "${test}" } timeout { fail "${test} (timeout)" } } } } First there are duplicate "${test}" names in the output, and some of them PASS and some of them FAIL. Confusion! The real problem is what to do when the notorious "location at which to store the function's return value is unknown" happens. If that message happens, perhaps it is a KFAIL because gdb cannot do what the user asked. Or perhaps it is okay because a message was printed. I'm leaning towards the KFAIL, myself. But the next bit of code: # Finally check that the value returned ended up in "L${n}". setup_fails ${fails} gdb/1444 gdb_test "p/c L${n}" " = [foo ${n}]" "${test}" If "location unknown" has occurred, then it's not even worthwhile to execute this at all. Once gdb has informed the user about "location unknown" then there should be no expectation on the part of the user that the return value will get stored into memory. Maybe gdb needs to print an additional message to make it more clear to the user: The location at which to store the function's return value is unknown. If you continue, the return value that you specified will be ignored. Make fun1 return now? (y or n) y Then in the test script, if you get "location unknown", issue a KFAIL (or do whatever) and skip a test or two. I put up a tarball here: ftp://ftp.shout.net/pub/users/mec/gdb/2003-11-06.tar.gz (The filename is lame because I made 2003-11-06-2 yesterday). Michael C