Hi.

When from debugger we evaluate some expression the user's context pragma is not 
applyed.

This patch fixes that: 
https://github.com/KES777/perl/tree/apply_users_context_pragma


Need help with one problem, can not watch variables when the debugging 
script.pl has 'use strict' in effect.

Variable "$x" is not imported at (eval 10)[./perl5db.pl:740] line 1.
 at (eval 10)[./perl5db.pl:740] line 1.
        eval 'BEGIN{ ( $^H, ${^WARNING_BITS} ) =  @DB::saved[7,8]; }($@, $!, 
$^E, $,, $/, $\\, $^W) = @DB::saved;package main; $x;
' called at ./perl5db.pl line 740
        DB::eval called at ./perl5db.pl line 6051
        DB::_add_watch_expr("\$x") called at ./perl5db.pl line 6071
        DB::cmd_w("w", "\$x", 6) called at ./perl5db.pl line 4488
        DB::cmd_wrapper("w", "\$x", 6) called at ./perl5db.pl line 3999
        DB::Obj::_handle_cmd_wrapper_commands(DB::Obj=HASH(0x26593c0)) called 
at ./perl5db.pl line 2881
        DB::DB called at /home/kes/tmp/t3.pl line 6
Global symbol "$x" requires explicit package name (did you forget to declare 
"my $x"?) at (eval 10)[./perl5db.pl:740] line 1.

But here the design problem because of next:
An eval '' executed within a subroutine defined in the DB package doesn't see 
the usual surrounding lexical scope, but rather the scope of the first non-DB 
piece of code that called it

As we can see from stacktrace the 'first non-DB piece of code' is 
        DB::Obj::_handle_cmd_wrapper_commands(DB::Obj=HASH(0x26593c0)) called 
at ./perl5db.pl line 2881

So if we want $x be evaled at user's context the DB::DB *SHOULD NOT* call to 
DB::Obj namespace.

Reply via email to