This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFC]: Solib search (Was: Re: Cross solib support; continued)


> 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).


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