How can I debug a custom debugger?

I wrote my own debugger as described in perldebguts . Something is wrong with my debugger code, however, so I want to go through my routines DB::DB()and DB::sub()take turns to isolate the problem.

I suppose I can do this by setting $^Dto 1<<30, as the documentation says:

When your program reaches a point that can hold a breakpoint, the subroutine DB::DB()is called if any of the variables $DB::trace, $DB::singleor $DB::signaltrue. These variables are not localizable. This function is disabled when executed internally DB::DB(), including functions called from it if $^D & (1<<30)it is not true.

When program execution reaches a subroutine call &DB::sub (args), a call is made instead , and $DB::subis the name of the called subroutine. (This does not happen if the routine was compiled in a DB package.)

(in italics)

People on the IRC # perl-help channel said that with the help $^D & (1<<30)I can debug my debugger, but they did not know any details.

DB::DB() DB::sub() ?

UPD . $^D |= (1<<30), , DB, : DB:: DB?

+4
1

Devel:: DebugHooks, .

$^D|=(1<<30) , vars 2 $x, , DB::.

DB:: DB(), , , $^D & (1<<30)

DOC .
DB::DB(), $^D & (1<<30) .
, DB::DB(), $^D & (1<<30)

+1

All Articles