Himanshu Shukla <[EMAIL PROTECTED]> writes:
>Hi,
>I'm calling C Library functions(a .so) from Perl. Is it possible to 
>debug the C functions via a debugger ?

Depends on your system and if C code has debug info.
The gdb approach I use (linux/solaris) is like this: 

gdb perl 
handle SIGWINCH pass nostop noprint
break XS_DynaLoader_dl_find_symbol
break Perl_vmess 
run -Mblib yourscript
...
break SymbolInSo


--------------------------------
The break on XS_DynaLoader_dl_find_symbol happens just after 
the .so is loaded as perl is about to define the "bootstrap" symbol.
So when you hit that you can set break points on symbols in your .so file.

Note that you may well hit dl_find_symbol several times before you
get to yours (common things like Cwd.so get loaded too). So you
may have to "keep trying" till setting breakpoint succeeds.

Same basic idea works with gdb and MinGW on Win32.
Visual Studio is possible too same scheme in outline but 
harder to "script".


Reply via email to