I asked this on the Win32::GUI list, but no response. Not too many
XS users there, I guess. Maybe this isn't the right place to ask either. The obvious search terms are too generic to find a "practical tutorial for learning how to debug perl XS on Windows" but that is really what I'm looking for... in lieu of that, I'll ask the questions below.


I haven't been an XS user myself, yet, but it looks like I'm going to have to fix a few problems in Win32::GUI myself -- there hasn't been much development activity there of late, and the main developer seems to come and go randomly (I imagine he's just spread too thin--I'm not trying to be offensive here, just stating the appearance. Heh heh, I'm spread too think myself, but fixing these problems has become important enough to me to learn XS if needed-- maybe I can help the guy a bit once I get up to speed on XS). I'm just about to re-read perlguts, perlxs, perlxstut, and perlapi (I've read them before, but without a big incentive, so didn't learn much), to try to figure this out. I've been playing in the debugger (I've used VC++, have an extensive background in C/C++ programming, but have never looked at the infrastructure Perl is built upon, so there lies most of my present ignorance and questions).

Sorry for the wrapped lines below....
The code below is from Win32::GUI v0.0.665 GUI.xs:

         // #### add (or create) the tooltip
         if(perlcs.szTip != NULL) {
                        if(perlcs.hvParent != NULL) {
                                if(perlcs.hTooltip == NULL) {
                                        SV** t;
                                        t = hv_fetch_mg(NOTXSCALL perlcs.hvParent, 
"-tooltip", 8, 0);
                                        if(t != NULL) {
---->                                        perlcs.hTooltip = (HWND) SvIV(*t);
                                        }
                                }
                                if(perlcs.hTooltip == NULL) {
#ifdef PERLWIN32GUI_STRONGDEBUG
                                    printf("XS(Create): creating -tooltip...\n");
#endif
                                        perlcs.hTooltip = CreateTooltip(NOTXSCALL 
perlcs.hvParent);
                                }
                        }

The line that I've marked with ----> (line 641 of the released gui.xs)
produces a warning, text below:

Use of uninitialized value in subroutine entry at
C:/Perl/site/lib/Win32/GUI.pm line 524

The referenced line is a call to Win32::GUI::Create.

It seems like maybe the first -tip option defined in a subwindow results
in this warning.  So it would appear that dereferencing  SvIV(*t)  is
what produces the warning.  I don't (yet) speak XS well enough to say
anything more about what the bug might be, such that the warning is
generated.

I have some questions:

1) Does anyone else have sufficient knowledge to say anything more about
how to fix the problem?

2) Is there an easy way to see what (source) line of Perl is being
executed when debugging using VC++ and stepping through C code?

2b) Maybe a better question would be if there is a writeup or
suggestions for debugging XS code under Win32

3) When first starting Perl in the debugger, it claims that it's first symbol is from a file named "perlmain.c" which doesn't seem to exist (for Win32) in ActiveState Perl build 805. What does this really mean? (Where) can that source file be found? Is it generated during the make of Perl? I've only downloaded the symbols from ActiveState, I haven't compiled my own Perl. Do I need to compile my own Perl to be effective here? I don't intend to alter Perl...

3b) [Somewhat off-topic for this group] There was a perlmain.c under the
wince directory, but clearly it was the wrong one.  Once a VC "workspace
for debugging" was told that association, though, it "remembered" it,
and I had to throw that workspace away, and start a new one to
"disassociate" that file from the startup.  Is there an easier way to do
such disassociations?

--
Glenn -- http://nevcal.com/
===========================
Wise men talk because they have something to say.
Fools talk because they have to say something." -- Plato

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to