This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/1475: chdir(), dlopen() using relative path fails to track module
- From: Kevin Buettner <kevinb at redhat dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 5 Dec 2003 20:18:00 -0000
- Subject: Re: gdb/1475: chdir(), dlopen() using relative path fails to track module
- Reply-to: Kevin Buettner <kevinb at redhat dot com>
The following reply was made to PR gdb/1475; it has been noted by GNATS.
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-gnats@sources.redhat.com, n@ml.org
Cc:
Subject: Re: gdb/1475: chdir(), dlopen() using relative path fails to track module
Date: Fri, 5 Dec 2003 13:13:17 -0700
On Dec 5, 7:48pm, n@ml.org wrote:
> Create a gcc -shared /tmp/test.so and a simple program that does:
> chdir("/tmp"); dlopen("./test.so", RTLD_LAZY);
> Run the simple program in gdb. Changing the dlopen() call to "/tmp/test.so" works as expected.
Interesting.
I don't know of any (easy) way for gdb to track the inferior's notion of
current working directory. (I suppose gdb could try to do a getcwd()
inferior function call, but I would prefer that GDB not make "hidden"
inferior function calls without the user's knowledge.)
I recommend using ``set solib-search'' to allow gdb to find the shared
object.
Kevin