New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diff to add print formatting to debugger #1059
Comments
From jbodwin@sebringring.comp sprintf "%x", $foo to print the value of $foo in hex instead of decimal. The following change the perl5db.pl allows a format option to be appended to p%x $foo or even p%8.8x $foo - Jim =========================== 1087a1088,1089
\"\%$1\", \$_/;
\"\%$1\", /;
|
From [Unknown Contact. See original ticket]Jim Bodwin writes:
a) If you want to send patches, use diff -pu or diff -p. b) If you want this, why not use aliases? Ilya |
From [Unknown Contact. See original ticket]
OK. Here it is at the bottom. b> ) If you want this, why not use aliases? Aliases don't work for arbitrary command string. I could do something like: =px p sprintf "\%x" if I just want hex output but if I want to have more generic formats like p%8x aliases won't work (unless I define every possible alias ala =p1x, Also, this seemed like a generic enough extension that even if it was - Jim ========================= $ diff -pu /tmp/perl5db.pl /perl/5.005/lib/perl5db.pl Inline Patch--- /tmp/perl5db.pl Thu Jan 20 12:50:41 2000
+++ /perl/5.005/lib/perl5db.pl Thu Jan 20 12:51:04 2000
@@ -1085,6 +1085,8 @@ EOP
unless $hist[$i] =~ /^.?$/;
};
next CMD; };
+ $cmd =~ s/^p\%([^\s]+)$/print {\$DB::OUT} sprintf
I\ Same as \\"I\\\" in current package\. \+B\ B\<\\%fmt> I\ Same as \\"I\\\" in current package\.
B\<|>I\ Run debugger command\, piping DB::OUT to current
pager\.
B\<||>I\ Same as B\<|>I\ but DB::OUT is temporarilly
select\(\)ed as well\.
B\<\\=> \[I\ I\\] Define a command alias\, or list current
aliases\.
@@ \-1887\,6 \+1890\,7 @@ I\
B\
|
From [Unknown Contact. See original ticket]On Thu, Jan 20, 2000 at 01:07:25PM -0800, Jim Bodwin wrote:
Do not they? I thought they do. If they do not, this is what need to
If you cannot alias an arbitrary string, alias 'p', and type things as p %8x $var Ilya |
From [Unknown Contact. See original ticket]
Why would you use -p for Perl code? % man 1 diff Also, -p isn't even in POSIX.2, so I don't know how you can expect people http://www.opengroup.org/onlinepubs/007908799/xcu/diff.html The following options are supported: -b Cause any amount of white space at the end of a line to be treated as a --tom |
From [Unknown Contact. See original ticket]On Thu, Jan 20, 2000 at 02:13:51PM -0700, Tom Christiansen wrote:
Because it makes it easier to read patches. Why else?
Why is it important "how do I expect" things? What is important is Ilya |
From [Unknown Contact. See original ticket]
Oh. I'd never used -p. It looks like diff -c to me. Does --tom |
From [Unknown Contact. See original ticket]On Thu, Jan 20, 2000 at 02:25:14PM -0700, Tom Christiansen wrote:
Yes. The only difference is the "global context" half-line at the Ilya |
From [Unknown Contact. See original ticket]
I should be cleared - even though the first alias string is used as a =p\%(.) p sprintf "\%$1" winds up in the alias hash with an index of "p\%(.)". Typing: p%x $foo looks at $alias{"p%x"} which doesn't match the above. A fix would be to
Same problem here. Since the LHS of the pattern is used as the alias index And this goes back to the "general usefulness" issue. Since this extends - Jim |
From @tamiasOn Thu, Jan 20, 2000 at 01:35:39PM -0800, Jim Bodwin wrote:
The space between p and [expr] is optional: DB<1> %x = (a => 1, b => 2) DB<2> p%x Ronald |
From [Unknown Contact. See original ticket]On Thu, Jan 20, 2000 at 01:35:39PM -0800, Jim Bodwin wrote:
Yes, I see that aliases are recognized via the first
No. As far as it starts with "p ", you can do an arbitrary Ilya |
From [Unknown Contact. See original ticket]
Yes, I can do an arbitrary substitution but the ONLY thing that - Jim |
From [Unknown Contact. See original ticket]
Hmm. I didn't realize that the space was optional. I guess this isn't - Jim |
From @ysthIn article <20000120161815.A29781@monk.mps.ohio-state.edu>,
perldoc perlhack: |
Migrated from rt.perl.org#2010 (status was 'resolved')
Searchable as RT2010$
The text was updated successfully, but these errors were encountered: