From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94757 invoked by alias); 9 Nov 2018 19:41:42 -0000 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 Received: (qmail 94732 invoked by uid 89); 9 Nov 2018 19:41:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:844 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 19:41:38 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0A6A461E3; Fri, 9 Nov 2018 19:41:37 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C4D76013F; Fri, 9 Nov 2018 19:41:36 +0000 (UTC) Subject: Re: [PATCH v2] Avoid crash when calling warning too early To: Tom Tromey , gdb-patches@sourceware.org References: <20181031181820.24308-1-tom@tromey.com> From: Pedro Alves Message-ID: <5993d96c-afe2-99b1-af8d-56173ea73e08@redhat.com> Date: Fri, 09 Nov 2018 19:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181031181820.24308-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-11/txt/msg00169.txt.bz2 On 10/31/2018 06:18 PM, Tom Tromey wrote: > +set save $INTERNAL_GDBFLAGS > +set INTERNAL_GDBFLAGS "-nw -nx -data-directory $tname" > + > +gdb_start > + > +# Make sure gdb started up. > +gdb_test "echo 23\\n" "23" I guess this could also check that the warning was emitted? > + > +set INTERNAL_GDBFLAGS $save FYI, you can use: save_vars { INTERNAL_GDBFLAGS } { set INTERNAL_GDBFLAGS "-nw -nx -data-directory $tname" ... } But, note that gdb/testsuite/README says this about INTERNAL_GDBFLAGS: ~~~ The testsuite does not override a value provided by the user. ~~~ I think that the test should instead be replacing/sed'ing the existing -data-directory option, instead of overriding INTERNAL_GDBFLAGS completely. That's what gdb.base/gdbinit-history.exp does. Thanks, Pedro Alves