From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8987 invoked by alias); 25 Sep 2017 11:07:29 -0000 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 Received: (qmail 8414 invoked by uid 89); 25 Sep 2017 11:07:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MISSING_HEADERS,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1804, non-existing, nonexisting, 8888 X-HELO: hqemgate15.nvidia.com Received: from hqemgate15.nvidia.com (HELO hqemgate15.nvidia.com) (216.228.121.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Sep 2017 11:07:27 +0000 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Mon, 25 Sep 2017 04:07:04 -0700 Received: from HQMAIL106.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 25 Sep 2017 04:07:05 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 25 Sep 2017 04:07:05 -0700 Received: from UKMAIL102.nvidia.com (10.26.138.15) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 25 Sep 2017 11:06:56 +0000 Received: from localhost.localdomain (10.21.45.12) by UKMAIL102.nvidia.com (10.26.138.15) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 25 Sep 2017 11:06:53 +0000 Subject: Spurious re-attach error with extended-remote target CC: GDB Development References: <20170921185736.GA1625@host1.jankratochvil.net> From: Dmitry Antipov Message-ID: Date: Mon, 25 Sep 2017 11:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170921185736.GA1625@host1.jankratochvil.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL102.nvidia.com (10.26.138.15) X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00114.txt.bz2 It seems that an attempt to re-attach to an existing PID fails after an (unsuccessful) attempt to attach to a non-existing one. Example: $ gdbserver --attach tcp:8888 $(pidof test) Attached; pid = 5128 Listening on port 8888 Remote debugging from host 127.0.0.1 Detaching from process 5128 gdbserver: Cannot attach to process 12345: No such process (3) Listening on port 8888 Attached; pid = 5128 ;; gdbserver says it's OK, but... $ ./gdb/gdb -q (gdb) set sysroot / (gdb) target extended-remote :8888 Remote debugging using :8888 Reading symbols from /tmp/test...done. Reading symbols from /lib64/libstdc++.so.6...(no debugging symbols found)...done. Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done. Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done. Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done. Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 0x00007f8fb3fae83d in pthread_join () from /lib64/libpthread.so.0 (gdb) detach Detaching from program: /tmp/test, process 5128 (gdb) attach 12345 ;; no process with specified PID Attaching to program: /tmp/test, process 12345 Attaching to process 12345 failed (gdb) attach 5128 Attaching to program: /tmp/test, process 5128 ;;; hmm... Unknown remote qXfer reply: T0006:0000000000000000;07:c00f7d81ff7f0000;10:3de8fab38f7f0000;thread:1408;core:3; ;;; problem? (gdb) (current HEAD at 57a024f4650d7562e963efb6b00c4a4cd74185c4, configured with '--with-python=no --with-guile=no --disable-nls --disable-binutils --disable-ld --disable-gold --disable-gas --disable-sim --disable-gprof'). Dmitry