Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Using debugger breakpoints in Test::Class code

by belden (Friar)
on Nov 13, 2008 at 23:42 UTC ( [id://723526]=note: print w/replies, xml ) Need Help??


in reply to Using debugger breakpoints in Test::Class code

Why don't you want to add the $DB::single line?

At work we have a key-binding in our editor that drops these two lines at the cursor:

local $MY::var = 1; # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX $DB::single = 1 if $MY::var; # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
When debugging code, we'll generally drop the $MY::var = 1 line into some test block, and stick the $DB::single line into whatever method we're debugging. Works fine.

Replies are listed 'Best First'.
Re^2: Using debugger breakpoints in Test::Class code
by secondturtle (Initiate) on Nov 14, 2008 at 17:00 UTC

    > Why don't you want to add the $DB::single line?
    For all the same reasons the debugger supports adding breakpoints while debugging.

    Also, many times when I'm debugging is when I decide where I want to add a breakpoint. I don't want to have to restart the debugger and lose my position in the executing program's call stack just to add a break point. That's annoying.

    Adding a $DB::single=1 code works, but it's far from ideal.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-25 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found