I would echo the comments you already have about the debugger flag. Another thing I have found with XS is that I have had trouble getting perl to run in the debugger (admittedly this is mostly when I am messing with interrupts and with modules linked to dynamic libraries). A trick that I have found usefull is to temporarily insert an infinite loop at the start of my C code:
int temp_val; temp_val = 100; /* An infinite loop that usually won't be optimised away */ while(temp_val > 0) { temp_val--; if(temp_val < 50) temp_val = 100; }
Then start up the perl script, it will go into the infinite loop. Use
ps auxto get its process number. Start gdb with
gdb `which perl` <Process Number>And get out of the infinite loop with
set temp_val=-1000Now you have a gdb session with all the correct libraries loaded stopped at the start of your routine.
In reply to Re: How can I debug perl-xs code?
by hawtin
in thread How can I debug perl-xs code?
by pijush
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |