gdb and cint

From: Maxim Nikulin <>
Date: Thu, 01 Jun 2006 23:31:14 +0700


I'm afraid that in the discussion of debugging stand-alone programs and dynamicaly loaded libraries one quite convenient way is missed. Gdb can be attached to a running program with -p option after all plugins have been loaded.

Roland Kuhn wrote:

> The point was that I normally do not dynamically link my 'custom shared
> library', which enables me to do
> prompt> gdb analyze
> (gdb) br some_function
> (gdb) run -i infile -o outfile

An example with interpreter and aclic. Two shells marked as '1:' and '2:'.

1:bash$ root -l
1:root [0] .L
1:Info in <TUnixSystem::ACLiC>: creating shared library 

2:bash$ ps x | grep root.exe
2: 4413 pts/0 S+ 0:00 /mnt/soft/hep/root-5.02.00/bin/root.exe -splash -l

2:bash$ gdb -p 4413
2:(gdb) break 'test()'
2:Breakpoint 1 at 0x421e355a: file, line 4.
2:(gdb) c

1:root [1] test()

2:Breakpoint 1, test () at
2:4          int result = 0;
2:Current language:  auto; currently c++

Sometimes it's more tricky to set a break point inside a shared library linked to a stand-alone program.

Best regards,
Maxim Nikulin
Received on Thu Jun 01 2006 - 18:32:21 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET