On approximately 11/29/2003 3:28 AM, came the following characters from
the keyboard of Laurent ROCHER:

Glenn,

    I try to merge and apply your patch on 665-Fix branch this week-end.

    I quick read your patch and i see this :

! #ifdef PERLWIN32GUI_GLBREAK
!     printf("XS(Create): %s\n", perlcs.cs.lpszName );
!     if ( perlcs.cs.lpszName
!       &&  strcmp ( perlcs.cs.lpszName, "findlist.pl Main Window" ) == 0 )
!     { __asm { int 3 };
!     }
! #endif

    It's a debugger breakpoint !!!!!
Some time ago, i search a way to debug a XS code whitout find. It's very usefull, i test it and it's work great with Visual C++.
    Thank for this "Tip Of The Day" ;o)

Laurent.

Yeah, I took out most (not all) of my debugging code of the nature of

#ifdef SOME_SYMBOL_MOST_PEOPLE_WONT_HAVE
   printf( "something or another\n" );
#endif

but when I got to that one, I thought it might be useful for someone that hadn't ever seen it done before. I love debuggers, but they can be real contrary to use with dynamically created code, such as Perl and other interpreters... in such situations, starting from the top, one needs to set a number of breakpoints along the way, after code get created and/or loaded, just to find your way in to where you really want to set the breakpoint. It can often be much easier to instrument the code you want to debug with the breakpoint in the manner above, but unless one understands the assembly language and the debugger itself to some extent, it can be difficult to figure that out!

Yes, it does work well with Visual C; some other debuggers, since they did not place the breakpoint there, may get somewhat confused about discovering one there... for those debuggers, often the way they express their confusion is to attempt to "reexecute" the "int 3" instruction. To sidestep their confusion, use the debugger commands to increment the instruction pointer ( reg IP = IP + 1 ) although the syntax varies between debuggers, and sometimes might be click here or there and type the new number (it would be in Visual C, if Visual C didn't handle it reasonably).

--
Glenn -- http://nevcal.com/
===========================
Like almost everyone, I receive a lot of spam every day, much of it
offering to help me get out of debt or get rich quick.  It's ridiculous.
-- Bill Gates

And here is why it is ridiculous:
The division that includes Windows posted an operating profit of $2.26 billion on revenue of $2.81 billion. --from Reuters via http://biz.yahoo.com/rc/031113/tech_microsoft_msn_1.html

So that's profit of over 400% of investment... with a bit more investment in Windows technology, particularly in the area of reliability, the profit percentage might go down, but so might the bugs and security problems? Seems like it would be a reasonable tradeoff. WalMart earnings are 3.4% of investment.


Reply via email to