How to fix solib path name?
Aleksandar Ristovski
aristovski@qnx.com
Wed Jul 8 17:19:00 GMT 2009
Pedro Alves wrote:
> On Wednesday 08 July 2009 16:37:31, Aleksandar Ristovski wrote:
>
>>>> What would you do differently?
>>> Use "(gdb) set sysroot".
>>>
>> That is for absolute paths. For relative paths
>> find_and_open_solib is still a way to go IMHO - if you
>> disagree I would like to hear your rationale.
>
> Where would this look? What benefit does this have over
> solib-search-path? Windows dlls can be everywhere on
> the filesystem.
>
Our case is cross-debugging with different host
architectures (win32, linux, nto).
We set sysroot in "architecture_changed" event. We set it
only if it hasn't been set previously, thus allowing users
to specify their own.
We used to have solib-search-path "automagically" set which,
then, gave problems when users wanted to specify their own
because "set solib-search-path" will replace previously set
path, forcing users to specify their own + all the default ones.
The solution I ended up with, that made the most sense to
me, is:
* we set solib-absolute-prefix as described above (and the
path itself is determined by env. variable and architecture),
* solib-search-path - we don't touch it internally, user can
specify it if needed in which case default search algorithm
will take over, whether absolute path was not found in
sysroot or relative path is specified
* and we have "find_and_open_solib" that will search
internally built solib-search-path based on the same env.
variable, architecture and usual paths (e.g. lib, usr/lib
etc...) using basename of the given path and the search path.
In Danny's case, if he wanted to follow the same scenario,
he could either not set sysroot or set it to a reasonable
default (if he doesn't want to use env. var).
find_and_open_solib could use sysroot to build "usual"
paths, which I presume would be "Windows" and such.
Finally, we don't have the issue of fwd/backward slashes,
but I think it could be fixed in Danny's case by configuring
gdb to define HAVE_DOS_BASED_FILE_SYSTEM, or by taking care
of it in find_and_open_solib.
Anyway... just my two cents.
Thanks,
--
Aleksandar Ristovski
QNX Software Systems
More information about the Gdb-patches
mailing list