From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8743 invoked by alias); 2 Apr 2013 03:58:15 -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 8702 invoked by uid 89); 2 Apr 2013 03:58:02 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 02 Apr 2013 03:57:59 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UMsM9-0007TA-8z from Yao_Qi@mentor.com ; Mon, 01 Apr 2013 20:57:57 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 1 Apr 2013 20:57:56 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Mon, 1 Apr 2013 20:57:56 -0700 Message-ID: <515A56FC.0@codesourcery.com> Date: Tue, 02 Apr 2013 13:41:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Jan Kratochvil CC: Pedro Alves , , Hui Zhu Subject: Re: [commit+7.6] [patch+7.6] Fix 7.5 regression crashing GDB if gdbserver dies References: <20130315195359.GA19841@host2.jankratochvil.net> <514C50EF.6030202@redhat.com> <20130322191841.GA29259@host2.jankratochvil.net> <514CB6D4.9070909@redhat.com> <20130322204243.GA31871@host2.jankratochvil.net> In-Reply-To: <20130322204243.GA31871@host2.jankratochvil.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-04/txt/msg00031.txt.bz2 On 03/23/2013 04:42 AM, Jan Kratochvil wrote: > +set server_pid [exp_pid -i [board_info target fileid]] > +remote_exec target "kill -9 $server_pid" > + > +gdb_test "step" "Remote connection closed" Jan, I got a fail in this test (on Lucid x86_64), Executing on native-gdbserver: kill -9 31336 {} {} {} (timeout = 300) spawn -ignore SIGHUP kill -9 31336 ^M kill: : invalid process id^M kill: : invalid process id^M kill: : invalid process id^M step^M Cannot find bounds of current function (gdb) FAIL: gdb.server/server-kill.exp: step The GDB's output of command 'step' is unexpected but looks reasonable to me. What we want to check here is GDB gets "connection closed" when GDBserver died, so any commands which talk with GDBserver should be qualified. I choose 'tstaus' here, because it simply talks with GDBserver to get trace status, and don't involve other factors into it. Note that we can use 'stepi' here, but I think 'tstatus' is simpler than it, so I choose 'tstatus' in the test finally. This patch fixes the fail I saw. Is it OK for mainline and 7.6? -- Yao (齐尧) gdb/testsuite: 2013-04-02 Yao Qi * gdb.server/server-kill.exp: Use command 'tstatus' instead of 'step'. --- gdb/testsuite/gdb.server/server-kill.exp | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp index 45a2a89..1b48152 100644 --- a/gdb/testsuite/gdb.server/server-kill.exp +++ b/gdb/testsuite/gdb.server/server-kill.exp @@ -40,4 +40,6 @@ delete_breakpoints set server_pid [exp_pid -i [board_info target fileid]] remote_exec target "kill -9 $server_pid" -gdb_test "step" "Remote connection closed" +# Force GDB to talk with GDBserver, so that we can get the +# "connection closed" error. +gdb_test "tstatus" "Remote connection closed" -- 1.7.7.6