From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21751 invoked by alias); 2 Mar 2007 20:23:16 -0000 Received: (qmail 21741 invoked by uid 22791); 2 Mar 2007 20:23:16 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.palmsource.com (HELO mx2.palmsource.com) (12.7.175.14) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 Mar 2007 20:23:08 +0000 Received: from localhost (localhost [127.0.0.1]) by localhost.domain.tld (Postfix) with ESMTP id 2E7BC12E407 for ; Fri, 2 Mar 2007 12:17:48 -0800 (PST) Received: from mx2.palmsource.com ([127.0.0.1]) by localhost (mx2.palmsource.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26924-12-29 for ; Fri, 2 Mar 2007 12:17:45 -0800 (PST) Received: from ussunex01.palmsource.com (unknown [192.168.101.9]) by mx2.palmsource.com (Postfix) with ESMTP id B883A12E66D for ; Fri, 2 Mar 2007 12:14:59 -0800 (PST) Received: from 192.168.92.81 ([192.168.92.81]) by ussunex01.palmsource.com ([192.168.101.9]) via Exchange Front-End Server owa.palmsource.com ([10.0.20.17]) with Microsoft Exchange Server HTTP-DAV ; Fri, 2 Mar 2007 20:14:52 +0000 Received: from svmsnyderlnx by owa.palmsource.com; 02 Mar 2007 12:14:52 -0800 Subject: gdbserver hangs on open port From: Michael Snyder To: gdb@sourceware.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 02 Mar 2007 20:23:00 -0000 Message-Id: <1172866492.9783.23.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00039.txt.bz2 A user pointed out this behavior to me, which certainly seems wrong. If you tell gdbserver to open an executable which doesn't exist, it goes ahead and opens a port anyway, waits for gdb to connect, and only then terminates (without sending any useful info to gdb). gdbserver$ ./gdbserver :2345 foo Cannot exec foo: No such file or directory. Process foo created; pid = 2186 Child exited with retcode = 7f Listening on port 2345 [different shell] ./gdb -nx GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-pc-linux-gnu --target=i386-linux". (gdb) tar rem :2345 Remote debugging using :2345 Remote communication error: Connection reset by peer. (gdb) [original shell] Remote debugging from host 127.0.0.1 Child exited with status 127 GDBserver exiting