Solib-absolute-prefix vs. solib-search-path in gdb

I read a description of both, but I still do not understand the difference. Can someone help me understand the differences?

set solib-absolute-prefix -
Specifies the local directory that contains copies of target libraries in the 
corresponding subdirectories. This option is useful when debugging with gdbserver.

.

set solib-search-path command - 
Specifies directories where GDB will search for shared libraries with symbols. This option        
is useful when debugging with gdbserver.

Thank.

+4
source share
1 answer

The wording is completely unclear: - (

Suppose your target is loaded /usr/lib/libfoo.so, and on the host (where GDB is running) you have a copy of the entire target tree in /tmp/host. That is, a copy of target /usr/lib/libfoo.sois on node at /tmp/host/usr/lib/libfoo.so.

Then the following commands are almost equivalent:

set solib-absolute-prefix /tmp/host
set solib-search-path /tmp/host/usr/lib

Now consider what happens if you also have /usr/local/lib/libbar.soon the target and a copy of it in /tmp/host/usr/local/lib/libbar.so.

solib-absolute-prefix, , - libbar.so, solib-search-path :

set solib-search-path /tmp/host/usr/lib:/tmp/host/usr/local/lib

, $ROOT, solib-absolute-prefix $ROOT, .

"" , solib-search-path GDB - .

+13

All Articles