This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_magic_setdbline() should clear and set read-only OP slabs.
authorNicholas Clark <nick@ccl4.org>
Mon, 3 Sep 2012 14:47:15 +0000 (16:47 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 4 Sep 2012 09:08:38 +0000 (11:08 +0200)
commit7bbbc3c08a8830fe5d44ce7a6056cfba6fb67c22
tree17d3ee1a96dba24e2464607b7075ab64f9701717
parent83519873101c5088b6e33e85da400d6f575c0ceb
Perl_magic_setdbline() should clear and set read-only OP slabs.

The debugger implements breakpoints by setting/clearing OPf_SPECIAL on
OP_DBSTATE ops. This means that it is writing to the optree at runtime,
and it falls foul of the enforced read-only OP slabs when debugging with
-DPERL_DEBUG_READONLY_OPS

Avoid this by removing static from Slab_to_rw(), and using it and Slab_to_ro()
in Perl_magic_setdbline() to temporarily make the slab re-write whilst
changing the breakpoint flag.

With this all tests pass with -DPERL_DEBUG_READONLY_OPS (on this system)
embed.fnc
embed.h
mg.c
op.c
proto.h