From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30031 invoked by alias); 14 Nov 2008 00:54:16 -0000 Received: (qmail 29929 invoked by uid 22791); 14 Nov 2008 00:54:15 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 00:53:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 358F61EEA7B; Thu, 13 Nov 2008 19:53:36 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id V7QqLAJKroCq; Thu, 13 Nov 2008 19:53:36 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D86391EEA65; Thu, 13 Nov 2008 19:53:35 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id C88BEE7ACD; Thu, 13 Nov 2008 16:53:33 -0800 (PST) Date: Fri, 14 Nov 2008 11:43:00 -0000 From: Joel Brobecker To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [RFA] detect inferior exit in call_function_by_hand Message-ID: <20081114005333.GC12802@adacore.com> References: <20081111225021.015C61C79A1@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081111225021.015C61C79A1@localhost> User-Agent: Mutt/1.4.2.2i 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/msg00317.txt.bz2 > + 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 } -- Joel