> yes, it's still unclear for me if you want to step thru or run an automatic trace.

I think stepping thru the code would imply an interactive session. I am looking for an automatic trace, it would be nice to indicate which lines/variables should be printed, but having something that prints all of the variables modified and statements run would suffice. (huge output, but that isn't a problem!) There are some autotrace modules that may work, but I would like to accomplish this without additional modules. (lets make believe we are air gapped and getting to cpan is a problem)

> At least in .perldb with afterinit
sub afterinit { push @DB::typeahead, "b 4", "b 6"; }

So this isn't exactly thru the $ENV{PERLDB_OPTS} environment variable but using a file .perldb is easy enough to do. (though, @DB::typeahead is not a supported interface and is subject to change in future releases.)

I attempted the following:
echo "sub afterinit { push @DB::typeahead, \"a 119 p \$var\"; }" > .perldb

I see:

29: main(); auto(-1) DB<1> a 199 p __DB<2> (some program output) and then it shows 6556 segmentation fault with exit code 139.

not sure what is causing the seg fault and I again lose the automatic printing of all the statements, but I see some of the program output. Hopefully the above typeahead gives you an idea of what I'm trying to accomplish.


Thanks again for all the thought and replies.


In reply to Re^4: How can I print variable contents from the debugger non-interactively? (@DB::typeahead) by davehorner
in thread How can I print variable contents from the debugger non-interactively? by davehorner

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.