public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix fail in gdb.server/wrapper.exp
Date: Tue, 14 Jul 2015 13:37:00 -0000	[thread overview]
Message-ID: <86zj2ykghw.fsf@gmail.com> (raw)
In-Reply-To: <55A5057D.6000500@redhat.com> (Pedro Alves's message of "Tue, 14	Jul 2015 13:50:05 +0100")

Pedro Alves <palves@redhat.com> 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/gdbserver/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=26024, wstat=1407) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2114
#3  0x08070cee in linux_wait_for_event_filtered (wait_ptid=..., filter_ptid=..., wstatp=0xffffccdc, options=1073741824)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2362
#4  0x08070fa4 in linux_wait_for_event (ptid=..., wstatp=0xffffccdc, options=1073741824) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2456
#5  0x080715d7 in linux_wait_1 (ptid=..., ourstatus=0x80aba14 <last_status>, target_options=0)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:2778
#6  0x080728f3 in linux_wait (ptid=..., ourstatus=0x80aba14 <last_status>, target_options=0)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:3350
#7  0x0805a558 in mywait (ptid=..., ourstatus=0x80aba14 <last_status>, options=0, connected_wait=0)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/target.c:107
#8  0x08051e38 in start_inferior (argv=0x80b4308) 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.

-- 
Yao (齐尧)

  reply	other threads:[~2015-07-14 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 12:38 Yao Qi
2015-07-14 12:50 ` Pedro Alves
2015-07-14 13:37   ` Yao Qi [this message]
2015-07-14 14:53     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zj2ykghw.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).