Setting sysroot[1] allows one to use an alternative system root for the program being debugged. Using it in combination with solib-search-path unfortunately leak in the local / system root if no matching library was found in the search path. In a cross debugging scenario this yield the following warning as GDB load the host libraries instead of the target ones: warning: `/usr/lib/libfoobar.so': Shared library architecture FOO is not compatible with target architecture BAR. [1] http://sourceware.org/gdb/current/onlinedocs/gdb/Files.html#index-set-sysroot-1077 Set sysroot ----------- $ gdb -q -ex "set sysroot /foo/bar" -ex "file /bin/true" -ex run Reading symbols from /bin/true...(no debugging symbols found)...done. Starting program: /bin/true warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. GDB could not find any matching solibs in the set sysroot, which is expected at least to me. Set sysroot and solib-search-path --------------------------------- $ gdb -q -ex "set sysroot /foo/bar" -ex "set solib-search-path /foo/bar" -ex "file /bin/true" -ex run Reading symbols from /bin/true...(no debugging symbols found)...done. Starting program: /bin/true In this case GDB resolved the solibs via the / system root and thus break the sysroot jail.
Hmm, sounds about the same as: http://sourceware.org/ml/gdb-patches/2012-09/msg00665.html Do you have that patch? What's your GDB version?
I`m using archer-fc18. After applying the patch or moving to fsf-head it works. Thanks.