This is the mail archive of the gdb-prs@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]

[Bug gdb/15079] New: GDB loads local symbol file if it cannot find amatching file in sysroot/solib-search-path (both set).


http://sourceware.org/bugzilla/show_bug.cgi?id=15079

             Bug #: 15079
           Summary: GDB loads local symbol file if it cannot find a
                    matching file in sysroot/solib-search-path (both set).
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: sanimir.agovic@intel.com
    Classification: Unclassified


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.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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