Hi

Short version:

I'm interested to interactively deactivate a bunch debugger commands like { - at least temporarily.

Is there a recommended way, except patching perl5db.pl and pointing the environment to the patch?

Long version

My motivation is to use the debugger as a REPL to automatically print evaluated values.

But many perldebug#Debugger-Commands only make sense when used while debugging

DB<50> h List/search source lines: Control script execution: l [ln|sub] List source code T Stack trace - or . List previous/current line s [expr] Single step [in +expr] v [line] View around line n [expr] Next, steps over + subs ... yadda yadda

and such pure debugger commands like { and [ at first position are interfering with Perl's syntax, such that

DB<1> { a => 1 } # not an anonym hash DB<2> { pre-debugger commands: { -- a => 1 } DB<2>

So my idea was using aliases to deactivate them, it works but runs into a a missing quotemeta bug in the debugger

DB<1> = { ;{ Unescaped left brace in regex is deprecated, passed through in regex; +marked by <-- HERE in m/s\a{ <-- HERE \a(.*)\a$/ at C:/Perl_524/lib/p +erl5db.pl line 3826. at C:/Perl_524/lib/perl5db.pl line 3826. DB::Obj::_handle_equal_sign_command(DB::Obj=HASH(0x24de098)) c +alled at C:/Perl_524/lib/perl5db.pl line 2881 DB::DB called at -e line 1 { = ;{ DB<2> { a => 1 } DB<3> { Missing right curly or square bracket at (eval 14)[C:/Perl_524/lib/per +l5db.pl:737] line 3, at end of line syntax error at (eval 14)[C:/Perl_524/lib/perl5db.pl:737] line 3, at E +OF DB<3>

My bigger concern is that defining dozens of "pseudo aliases" makes listing the user defined aliases with = unreadable.

DB<6> h = = [alias value] Define a command alias, or list current aliases. DB<7>

FWIW: I could use PadWalker to access the lexical hashes defining/dispatching the commands, but this is even messier.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice


In reply to Interactively deactivating debugger commands? by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.