in reply to How to build DEBUG version of a perl module using Makefile.PL?
WriteMakefile( 'DEFINE' => '-DDEBUG', [download]
You need to compile a debug version of perl and any library your XS links