This is the mail archive of the
mailing list for the GDB project.
Re: set sysroot command on AIX has no effect.
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: sangamesh dot swamy at in dot ibm dot com (Sangamesh Mallayya)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Oct 2016 18:28:53 +0200 (CEST)
- Subject: Re: set sysroot command on AIX has no effect.
- Authentication-results: sourceware.org; auth=none
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