Nick Ing-Simmons wrote:

Reinhard Pagitsch <[EMAIL PROTECTED]> writes:

Ok, that info I found also in my documentation, that I have to compile Perl in debug - mode.

You don't _have_ to - as I say I have debug Tk with normal ActivePerl
build. You just can't back trace into perl from callbacks.


Ooh, than I have it missunderstood. I have only to compile my XS module with debug informations
(nmake CFG=Debug) and not compileing the perl sources with debug informations?



That results in a Config.pm with cl options to build debug objects.

Those seem (looking at makefile.mk) to be

cl -O1 -MD -Zi -DDEBUGGING ...
and link -debug


You can splice those into the Makefile generated by your Makefile.PL
(or hack latter to do it for you).
I have done that to debug Tk under ActivePerl.


Does this mean that from now on all my XS modules are compiled in debug - mode?

Depends what you mean by "debug mode" and "all" ;-)
Mode: As I understand those options
-O1 optimizes to level 1 - which happens to be same as a production build
so should be as fast.
-Zi outputs debug info so debugger knows what is going on this is the essential bit.
-DDEBUGGING is CPP level (source) thing which turns on features in perl and perhaps some XSes.


All: It turns of debugging for those XSes that use the Makefile(s) you modify.

Note that a perl built with CFG=Debug turns these on for ALL XS modules it builds.

Ok now I understand, I think. I do not have to recompile Perl with CFG=Debug enabled in the makefile, I have only use
my existing Activestate Perl which was compiled with the -Zi option but also with -DNDEBUG. And compile my XS module
with nmake CFG=Debug




But then there is the rather messy business to set up a "project" to _run_ your perl under the debugger.
I usually don't bother with that but just let the system fire up VisualStudio when a segfault or abort happens.


Ok, but what project I have to set? For the whole Perl or only for my module?

Not even the module but just the test script.
You just need to set those bits which invoke perl and pass it the command line (but under the debugger).


(Currently I can't send mail when I boot this machine to XP
so giving more explicit instructions is tricky.)



Hmm, do you mean I have only to run my test script with "perl -d test.pl!?
If you can give me more informations how to create a project under VC for a Perl module please let me know,
but it is not urgent.


If I have to set it for the wohle Perl
what source files I have to add to my project?

AFAIK you CANNOT build perl as "project" which is why we have all the nmake/dmake hackery.







Thank you,
Reinhard




Reply via email to