From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107480 invoked by alias); 3 Jun 2016 15:59:05 -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 107468 invoked by uid 89); 3 Jun 2016 15:59:04 -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,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1467, sk:server X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 03 Jun 2016 15:59:03 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id D0.25.03614.D09A1575; Fri, 3 Jun 2016 17:58:05 +0200 (CEST) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.87) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 3 Jun 2016 11:58:59 -0400 References: <1464965361-25399-1-git-send-email-antoine.tremblay@ericsson.com> <49f3eb1e-d03d-e434-a831-e40f18f7823c@redhat.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Pedro Alves CC: Antoine Tremblay , Subject: Re: [PATCH v2] Fix failure to detach if threads exit while detaching on linux In-Reply-To: <49f3eb1e-d03d-e434-a831-e40f18f7823c@redhat.com> Date: Fri, 03 Jun 2016 15:59:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00062.txt.bz2 Pedro Alves writes: > On 06/03/2016 04:32 PM, Antoine Tremblay wrote: >>>> >> + #Don't try to exit gdbserver see above comment. >>>> >> + set gdbserver_reconnect_p 1 >>> > >>> > I don't understand this one. It shouldn't be needed. >>> > >> This one is needed since on the teardown of the .exp test gdb_exit is >> called and calls monitor_exit which fails with a timeout this avoids >> this and the original gdb_exit is called. > > Then that strikes me as the wrong thing to do. We should instead > expect that gdbserver exits cleanly, and then clear server_spawn_id. > > E.g.: > > proc test_server_exit {} { > global server_spawn_id > if ![info exists server_spawn_id] { > return > } > > set test "server exits" > gdb_expect { > -i $server_spawn_id > eof { > pass $test > wait -i $server_spawn_id > unset server_spawn_id > } > timeout { > fail "$test (timeout)" > } > } > } > } > > and then: > > -re "Detaching from .*, process $decimal\r\nEnding remote debugging\.\r\n$gdb_prompt $" { > # This is what you get with "target remote". > pass $test > # If testing with gdbserver, make sure it manages to exit. > test_server_exit > } > Thanks does seems much better ! However, testing it it triggers the test_server_exit timeout case, I'm guessing because eof already happened and we're waiting for nothing ? I'm tempted just to unset the var... but ideas are welcome.. Regards, Antoine