This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: Solib search (Was: Re: Cross solib support; continued)
- From: "Eli Zaretskii" <eliz at is dot elta dot co dot il>
- To: orjan dot friberg at axis dot com
- Cc: gdb-patches at sources dot redhat dot com, drow at mvista dot com
- Date: Tue, 27 Nov 2001 17:59:32 +0200
- Subject: Re: [RFC]: Solib search (Was: Re: Cross solib support; continued)
- References: <3BEAA3A0.586B3046@axis.com> <20011108110955.A12240@nevyn.them.org> <3C03AB51.DB27B3D4@axis.com>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> Date: Tue, 27 Nov 2001 16:03:45 +0100
> From: Orjan Friberg <orjan.friberg@axis.com>
>
> + /* If the search in solib_absolute_prefix failed, and the path name is
> + absolute at this point, make it relative. (openp will try and open the
> + file according to its absolute path otherwise, which is not what we want.)
> + Affects all subsequent searches for this solib. */
> + if (found_file < 0 && IS_DIR_SEPARATOR (in_pathname[0]))
> + in_pathname++;
This is not how one should test for an absoulte file name portably,
and incrementing in_pathname by one is not how you portably make it a
relative file name. I suggest to use IS_ABSOLUTE_PATH for the first
and this for the second:
while (!IS_DIR_SEPARATOR (*in_pathname++))
;
Please note that these portable macros are described in gdbint.texinfo
(node "Coding", subsection about portable coding).