From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 859 invoked by alias); 14 Jul 2015 13:37:13 -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 834 invoked by uid 89); 14 Jul 2015 13:37:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f182.google.com Received: from mail-pd0-f182.google.com (HELO mail-pd0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 14 Jul 2015 13:37:11 +0000 Received: by pdjr16 with SMTP id r16so6209819pdj.3 for ; Tue, 14 Jul 2015 06:37:09 -0700 (PDT) X-Received: by 10.70.129.143 with SMTP id nw15mr79864586pdb.101.1436881029800; Tue, 14 Jul 2015 06:37:09 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id vl1sm1458953pab.21.2015.07.14.06.37.06 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Tue, 14 Jul 2015 06:37:09 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: 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> <55A5057D.6000500@redhat.com> Date: Tue, 14 Jul 2015 13:37:00 -0000 In-Reply-To: <55A5057D.6000500@redhat.com> (Pedro Alves's message of "Tue, 14 Jul 2015 13:50:05 +0100") Message-ID: <86zj2ykghw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00403.txt.bz2 Pedro Alves writes: > 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. I see what you mean. GDBserver creates target description when it is still skipping the extra trap, (gdb) bt #0 x86_linux_read_description () at /home/yao/SourceCode/gnu/gdb/git/gdb/g= dbserver/linux-x86-low.c:1159 #1 0x0807ea77 in x86_arch_setup () at /home/yao/SourceCode/gnu/gdb/git/gdb= /gdbserver/linux-x86-low.c:1434 #2 0x080705a2 in linux_low_filter_event (lwpid=3D26024, wstat=3D1407) at /= home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2114 #3 0x08070cee in linux_wait_for_event_filtered (wait_ptid=3D..., filter_pt= id=3D..., wstatp=3D0xffffccdc, options=3D1073741824) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2362 #4 0x08070fa4 in linux_wait_for_event (ptid=3D..., wstatp=3D0xffffccdc, op= tions=3D1073741824) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux= -low.c:2456 #5 0x080715d7 in linux_wait_1 (ptid=3D..., ourstatus=3D0x80aba14 , target_options=3D0) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2778 #6 0x080728f3 in linux_wait (ptid=3D..., ourstatus=3D0x80aba14 , target_options=3D0) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:3350 #7 0x0805a558 in mywait (ptid=3D..., ourstatus=3D0x80aba14 , = options=3D0, connected_wait=3D0) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/target.c:107 #8 0x08051e38 in start_inferior (argv=3D0x80b4308) at /home/yao/SourceCode= /gnu/gdb/git/gdb/gdbserver/server.c:258 on frame #8, GDBserver resumes the inferior and waits for it to skip the extra trap caused by exec-wrapper. GDBserver creates target description too early, and the fix should be creating target description after GDBserver skips the extra trap and when the inferior stops at the target process. I'll give a new patch. --=20 Yao (=E9=BD=90=E5=B0=A7)