This is the mail archive of the 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: set sysroot command on AIX has no effect.

Sangamesh Mallayya wrote:

> Here is the change i have it right now which takes care of.
> 1) calling solib_find and then solib_bfd_fopen.
> 2) Appending parenthesized member name.

This is looking mostly good.  The one thing I don't like is all the extra
xfree calls.  I think a better way would to not actually xstrdup the found
pathname early after all, but instead just get it from the BFD.  So instead
of the original:

   xfree (bfd_get_filename (object_bfd));
   object_bfd->filename = xstrdup (pathname);

you'd do something like:

   object_bfd->filename = xrealloc (object_bfd->filename, ...);
   strcat (object_bfd->filename, sep);

> +   /* Calling solib_find makes certain that sysroot path is set properly
> +      if program has a dependency on .a archive and sysroot is set via
> +      set sysroot command */

Minor coding style issue: sentences in a comment should end with a '.'
followed by two spaces, like so:
        ... set sysroot command.  */

> +   found_pathname1 = xstrdup (found_pathname);
> +   found_path_len = strlen (found_pathname1) + strlen (sep);
> +   found_pathname1 = xrealloc (found_pathname1, found_path_len);

See comment above, but also: there should be a "+ 1" for the null
terminator in the length computation somewhere.


  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain

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