[PATCH] Fix fail in gdb.server/wrapper.exp

Yao Qi qiyaoltc@gmail.com
Tue Jul 14 13:37:00 GMT 2015


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 (齐尧)



More information about the Gdb-patches mailing list