This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding an auxiliary shared library to a debug session


Thanks. Problem is that the process I was trying to attach to is not
linked to libdl.so. So LD_PRELOAD remains the most reliable way.

Strange why GDB have no such feature. I don't think there is any big
problem with it.

-Andriy

On Mon, Nov 9, 2009 at 9:41 AM, Andrà PÃnitz <andre.poenitz@nokia.com> wrote:
> On Sunday 08 November 2009 12:25:51 Andriy Symonovych wrote:
>> I'm trying to add some shared library to GDB session to be able to
>> call functions from it.
>> The only possible way I found is to execute program with
>> LD_PRELOAD=/path/to/aux/lib and attach with gdb to it's process.
>> Is there any another way?
>
> Assuming that your program links to libdl (and quite a few do...),
> you can use Â'call dlopen(....)' (or 'call LoadLibraryA(...)' on Windows)
> on the gdb command line.
>
> That works fairly reliably with FSF gdb up to and including
> version 6.8, and Apple gdb, but not with FSF gdb 7.0.
> (see http://sourceware.org/bugzilla/show_bug.cgi?id=10886).
>
> Andre'
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]