Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: XS Debugging segmentation faults

by jsegal (Friar)
on Jan 29, 2003 at 21:40 UTC ( [id://231104]=note: print w/replies, xml ) Need Help??


in reply to XS Debugging segmentation faults

It is definitely easier if you have the perl source available. It has been a long time since I have done this, but you should be able to compile it all with -g (and -DDEBUGGING) to enable the debugging stuff, and do
gdb /my/debugging/perl (gdb) run my_script my_args
To make your life even easier, while you are recompiling your perl, link your .xs module in statically -- it will make setting breakpoints and the like easier, because your module will be loaded in from the get-go.
Another little trick is to use the perl debugger too:
gdb /my/debugging/perl (gdb) run -d my_script my_args
Hitting Ctl-C from the perl debugging prompt will (or at least should...) drop you back down into the gdb prompt. (click here for a post showing an example of this trick in use...)

It should also work with dbx or any other C-level debugger.

Best of luck...

--JAS

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://231104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found