From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47754 invoked by alias); 18 Feb 2016 17:28:45 -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 47734 invoked by uid 89); 18 Feb 2016 17:28:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Feb 2016 17:28:43 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 14C03C000708; Thu, 18 Feb 2016 17:28:42 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IHSeHV021978; Thu, 18 Feb 2016 12:28:41 -0500 Message-ID: <56C5FF48.3050804@redhat.com> Date: Thu, 18 Feb 2016 17:28:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org CC: Luis Machado Subject: Re: [PATCH] Fix logic in exec_file_locate_attach References: <56BDF92B.50107@redhat.com> <1455815129-14795-1-git-send-email-gbenson@redhat.com> In-Reply-To: <1455815129-14795-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00556.txt.bz2 On 02/18/2016 05:05 PM, Gary Benson wrote: > > * exec.c (exec_file_locate_attach): Throw error if > exec_file_find fails to locate the main executable. This goes back to: https://sourceware.org/ml/gdb-patches/2016-02/msg00413.html Why is this an error, that even makes us stop the attach process halfway, if the case when we don't know the file name is completely silent? : void exec_file_locate_attach (int pid, int from_tty) { ... /* Try to determine a filename from the process itself. */ exec_file = target_pid_to_exec_file (pid); if (exec_file == NULL) return; > + > +set test_spawn_id [spawn_wait_for_attach $binfile] > +set testpid [spawn_id_get_pid $test_spawn_id] > + > +set outdir [make_gdb_parallel_path outputs $subdir $testfile] > +set sysroot ${outdir}/does-not-exist > + > +gdb_start > +gdb_test_no_output "set sysroot $sysroot" Does this "$sysroot" expand to an absolute path? If so, the test message depends on where in the filesystem you happen to run the testsuite. So this needs an explicit test message, or maybe simply: gdb_test_no_output "set sysroot /dev/null" > +gdb_test "attach $testpid" "Attaching to process $testpid\r\n.*: No such file or directory\\." > + > +kill_wait_spawned_process $test_spawn_id > Thanks, Pedro Alves