This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]