This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] validate binary before use
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Sun, 31 Mar 2013 17:26:42 +0200
- Subject: Re: [patch] validate binary before use
- References: <20121227205924 dot GA5109 at host2 dot jankratochvil dot net> <50DCB787 dot 6020601 at qnx dot com> <20121227211328 dot GA5739 at host2 dot jankratochvil dot net> <50DCBBD1 dot 7000707 at qnx dot com> <5107F591 dot 304 at qnx dot com> <20130131063518 dot GA3027 at host2 dot jankratochvil dot net> <510A7EB0 dot 90702 at qnx dot com> <51278A2A dot 9000802 at qnx dot com> <512E42D1 dot 3040101 at qnx dot com> <514C58B2 dot 6090701 at qnx dot com>
On Fri, 22 Mar 2013 14:12:18 +0100, Aleksandar Ristovski wrote:
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/solib-mismatch.exp
[...]
> + send_gdb "set args \"${binlibfiledirrun}\"\n"
This is another reason why this testcase could ever run with gdbserver, you
would need to use gdbserver_run as normally "args" are not passed through.
Did you follow this advice?
http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration
I always get:
(gdb) break solib-mismatch.c:55
Reading in symbols for ./gdb.base/solib-mismatch.c...done.
Breakpoint 1 at 0x400830: file ./gdb.base/solib-mismatch.c, line 55.
(gdb) kill
The program is not being run.
(gdb) spawn ../gdbserver/gdbserver --once :2346 /home/jkratoch/redhat/gdb-qnx/gdb/testsuite/gdb.base/solib-mismatch
Process /home/jkratoch/redhat/gdb-qnx/gdb/testsuite/gdb.base/solib-mismatch created; pid = 30827
Listening on port 2346
target remote localhost:2346
Remote debugging using localhost:2346
Remote debugging from host 127.0.0.1
Reading symbols from system-supplied DSO at 0x7ffff7ffa000...(no debugging symbols found)...done.
0x00007ffff7ddd420 in ?? () from /lib64/ld-linux-x86-64.so.2
Created trace state variable $trace_timestamp for target's variable 1.
(gdb) continue
Continuing.
ERROR - CWD not provided
Child exited with status 1
GDBserver exiting
[Inferior 1 (process 30827) exited with code 01]
(gdb) sharedlibrary
Which understandable breaks all the later tests.
The testcases currently rather define a macro in the testcase using:
additional_flags=-DSOMEVAR=\"${binlibfiledirrun}\"
It then works both with local and gdbserver testsuite run the same.
Thanks,
Jan