From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H . J . Lu" To: Kimball Thurston Cc: gdb@sources.redhat.com Subject: Re: gdb and dlopen Date: Tue, 16 Oct 2001 15:05:00 -0000 Message-id: <20011016150556.A27233@lucon.org> References: X-SW-Source: 2001-10/msg00160.html On Tue, Oct 16, 2001 at 01:11:39PM -0700, Kimball Thurston wrote: > Hey all, > > In our application, we've got a plugin architecture that, under > unix, we open using dlopen et al. When trying to debug using gdb, the > process of calling dlopen seems to take an extraordinary amount of > time, as it looks like gdb is using ptrace to copy a bunch of the > debug process's memory at each dlopen into itself. Is there a way to > delay this behavior, or disable it all together, or fix it? I couldn't > determine exactly how gdb uses the memory it copies in. All I know is > it makes using gdb nearly impossible when you have to wait 10 minutes > for the program to start up... We noticed the same thing. Our solution is not to start the application under gdb, but attach it to gdb after all DSOs are dlopened. It speeds up the startup time. BTW, gdb 4.18 doesn't have this `problem'. On the other hand, gdb 5.1 has much better support for dlopen. H.J.