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)


On Nov 27,  2:29pm, Daniel Jacobowitz wrote:

> I think your patch is OK.  If we fail to find it in the absolute path,
> search for its "absolute" (without leading directory separator[s])
> path in each directory in the solib-search-path.  Then try searching
> for its basename as a last resort.  Right?

I don't like it.  In particular, the part I don't like is:

+  /* 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++;
+

I do understand Orjan's reasons for doing this, but it seems rather
fragile to me.  I think that we'd be better off doing one of the
following:

    1) Change openp()'s behavior so that it (optionally) doesn't
       attempt to open a file (which has an absolute path).  I.e,
       force it to only consider the paths that we pass it.

    2) Explicitly prepend solib_absolute_prefix to the path in question
       and pass that to openp().  Or, perhaps openp() doesn't even need
       to be called.  Perhaps we can do the job with open().

Of these two, I like the second better.

Kevin


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