From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22300 invoked by alias); 14 Nov 2008 07:03:53 -0000 Received: (qmail 22228 invoked by uid 22791); 14 Nov 2008 07:03:52 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 07:03:15 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id mAE73Cae022393 for ; Thu, 13 Nov 2008 23:03:13 -0800 Received: from rv-out-0506.google.com (rvbf9.prod.google.com [10.140.82.9]) by wpaz33.hot.corp.google.com with ESMTP id mAE73B3o003629 for ; Thu, 13 Nov 2008 23:03:11 -0800 Received: by rv-out-0506.google.com with SMTP id f9so76378rvb.5 for ; Thu, 13 Nov 2008 23:03:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.141.26.19 with SMTP id d19mr359167rvj.184.1226646190776; Thu, 13 Nov 2008 23:03:10 -0800 (PST) In-Reply-To: <20081114005333.GC12802@adacore.com> References: <20081111225021.015C61C79A1@localhost> <20081114005333.GC12802@adacore.com> Date: Fri, 14 Nov 2008 13:51:00 -0000 Message-ID: Subject: Re: [RFA] detect inferior exit in call_function_by_hand From: Doug Evans To: Joel Brobecker Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00323.txt.bz2 On Thu, Nov 13, 2008 at 4:53 PM, Joel Brobecker wrote: >> + send_gdb "set language c\n" >> + gdb_expect { >> + -re ".*$gdb_prompt $" {} >> + timeout { fail "set language c (timeout)" ; return 0; } >> + } >> + >> + send_gdb "show language\n" >> + gdb_expect { >> + -re ".* source language is \"c\".*$gdb_prompt $" { >> + pass "set language to \"c\"" >> + return 1 >> + } >> + -re ".*$gdb_prompt $" { >> + fail "setting language to \"c\"" >> + return 0 >> + } >> + timeout { >> + fail "can't show language (timeout)" >> + return 0 >> + } >> + } > > Generally speaking, we try to avoid send_gdb/gdb_expect, and use > gdb_test_multiple. I realize that you probably inherited this > through copy/paste... In any case, I don't think it will necessary > to rewrite the above, because, Like Pedro, I don't think you need > the set lang c. The only time when I had to explicitly set the language > is after attaching to a program - you never know where you might end up, > and sometimes you find your way into asm frames, for instance. I propose > you remove this part entirely. That should simplify your testcase and > it's easy enough to put it back if we discover a case where it's > really needed. > >> +if { ![set_lang_c] } { >> + gdb_suppress_tests; >> +} else { >> + if { ![runto_main] } { >> + gdb_suppress_tests; >> + } > > We don't use gdb_suppress_tests anymore. As far as I know, the usual > way of doing things is to log a FAIL and then return. For instance: > > if ![runto_main] then { > fail "Can't run to main" > return 0 > } In past lives, I've often found it useful to never introduce fails that don't also have passes - it makes regression reports cleaner: otherwise tests that failed the previous time but now pass disappear and the test count has gone down leading one to wonder if there's a testsuite issue. In this case it doesn't matter as the gdb testsuite is all over the map so I'm happy to just go with the flow.