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: sangamesh dot swamy at in dot ibm dot com (Sangamesh Mallayya)
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 29 Sep 2016 17:22:51 +0200 (CEST)
- Subject: Re: set sysroot command on AIX has no effect.
- Authentication-results: sourceware.org; auth=none
Sangamesh Mallaya wrote:
> set sysroot command on AIX has no effect if a program depends on shared
> library archives (.a).
Yes, that seems a bug.
> + /* If gdb_sysroot is set via set sysroot command,
> + then we need to prefix gdb_sysroot to shared library path */
> + /* .a shared library archives case */
> + if (gdb_sysroot != NULL && *gdb_sysroot != 0) {
> + sys_path = alloca (sizeof(gdb_sysroot)+strlen(pathname));
> + memset (sys_path, 0, sizeof(sys_path));
> + strcpy(sys_path, gdb_sysroot);
> + pathname = strcat (sys_path, pathname);
> + }
> + path_len = strlen (pathname);
This duplicates some of the logic in solib_find. It would be better
to avoid that duplication ...
Is there any reason why you cannot use solib_find / solib_bfd_fopen
to open the archive file, like solib_bfd_open does? This would ensure
we're always using the same search logic for .a files as for .so files.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com