From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9138 invoked by alias); 14 Jul 2015 12:50:11 -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 9046 invoked by uid 89); 14 Jul 2015 12:50:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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; Tue, 14 Jul 2015 12:50:09 +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 03DC23CA150; Tue, 14 Jul 2015 12:50:07 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6ECo6aG023254; Tue, 14 Jul 2015 08:50:07 -0400 Message-ID: <55A5057D.6000500@redhat.com> Date: Tue, 14 Jul 2015 12:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix fail in gdb.server/wrapper.exp References: <1436877481-11495-1-git-send-email-yao.qi@linaro.org> In-Reply-To: <1436877481-11495-1-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00400.txt.bz2 On 07/14/2015 01:38 PM, Yao Qi wrote: > We are testing i686-linux GDB (Fedora-i686) on an x86_64-linux box > (fedora-x86-64-4) in buildbot, such configuration causes fails in > gdb.server/wrapper.exp like this: > > spawn /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/../../gdb/gdbserver/gdbserver --once --wrapper env TEST=1 -- :2346 /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper > Process /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper created; pid = 8795 > Can't debug 64-bit process with 32-bit GDBserver > Exiting > target remote localhost:2346 > localhost:2346: Connection timed out. > (gdb) FAIL: gdb.server/wrapper.exp: setting breakpoint at marker > > See https://sourceware.org/ml/gdb-testers/2015-q3/msg01541.html > > I can reproduce this fail on my ubuntu box as well. "wrapper" is > 32-bit, but when GDBserver option --wrapper is used, the wrapper > program is executed to launch the program, and the wrapper is > /usr/bin/env in this case. In > gdbserver/linux-x86-low.c:x86_linux_read_description, GDBserver > checks whether the executable is 64-bit or not by means of > /proc/PID/exe, which is the symbol-link to the wrapper, instead > of the test program. Since 32-bit GDBserver is being used, it > refuse to debug 64-bit process (/usr/bin/env) and exit. But why is gdbserver trying to compute a target description for /usr/bin/env? That's not the target process. We shouldn't try to read registers, memory, etc. out of it, just like native gdb doesn't read anything out of the shell process, and I assume, of the "set exec-wrapper" process. Thanks, Pedro Alves