Adding an auxiliary shared library to a debug session

Andriy Symonovych sima.rv@gmail.com
Mon Nov 9 11:09:00 GMT 2009


Daniel,

Environment is read once at the start of the program.

I'm trying to do following:
1. I have `test` program running with PID 12345
2. I attach with gdb to it: gdb test 12345
3. Load my library somehow in GDB CLI, library contains some
helper functions which I can call using GDB CLI `call` command

I'm asking about 3rd step, is there any way to do this?

Currently my workaround is to start test like this:
LD_PRELOAD=/mylib ./test

Ideas?

Thanks.

-Andriy.


On Sun, Nov 8, 2009 at 5:07 PM, Daniel Jacobowitz wrote:
> On Sun, Nov 08, 2009 at 01:25:51PM +0200, 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?
>
> Try using "set env"?
>
> --
> Daniel Jacobowitz
> CodeSourcery
>



More information about the Gdb mailing list