This is the mail archive of the
gdb-patches@sourceware.org
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: uweigand at de dot ibm dot com (Ulrich Weigand)
- Cc: sangamesh dot swamy at in dot ibm dot com (Sangamesh Mallayya), gdb-patches at sourceware dot org
- Date: Tue, 11 Oct 2016 09:16:48 +0200 (CEST)
- Subject: Re: set sysroot command on AIX has no effect.
- Authentication-results: sourceware.org; auth=none
I wrote:
> 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);
Sorry, I mixed up the two BFDs here, we need to get the pathname from
the archive_bfd, of coutse. So this would be something like:
xfree (bfd_get_filename (object_bfd));
object_bfd->filename = xstrprintf ("%s%s", bfd_get_filename (archive_bfd), sep);
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com