-
Notifications
You must be signed in to change notification settings - Fork 603
Description
(This is just an observation, not necessarily a bug.)
perl5db.pl as of commit c60ffc1
Module: perl5db.pl
Description
Reviewing the code for _DB__handle_watch_expressions()
Line 2483 in 8cacb84
| sub _DB__handle_watch_expressions |
I found that using
join here Line 2494 in 8cacb84
| my ($val) = join( "', '", DB::eval(@_) ); |
makes
$val always defined, since join always returns a (possibly empty) defined string.
Then in the following line
Line 2495 in 8cacb84
| $val = ( ( defined $val ) ? "'$val'" : 'undef' ); |
the false branch is never applied.
So maybe watchpoint expressions with result "undefined" are not reported correctly.
======================
My main motivation for looking here, was the behavior of watchpoints with regard to package scope changes.
In my application I had
my %hash;
along with some imported modules.
When my hash was populated completely (and should be constant afterwards), I wanted to see where and when $hash{'myEntry'} changed unexpectedly. But using a watchpoint w $hash{'myEntry'} in the debugger led to a lot of unwanted breaks: each time the package/module scope changed the visibility of %hash changed also, of course.
How these visibility changes can be ignored in watchpoint breaks, I do not not know yet (should this be another bug report?).