Opened 8 years ago

Closed 8 years ago

#1412 closed enhancement (fixed)

Evaluate Expression in the debugger

Reported by: szabgab Owned by: bowtie
Priority: trivial Milestone:
Component: Debugger for Perl 5 Version: 0.94
Keywords: Cc:


The p|x is button is basically evaluating an arbitrary expression and displaying it.
IMHO if there is a selection in the editor it should default to evaluate that expression so I can easily check the value of a variable by highlighting it and clicking on p|x.

Currently if the expression is $something it uses 'p' and if it is @something it uses 'x'. This isn't good if $something is already a reference. Probably this should behave in a clever way and first check if $something is a reference or not. If it is a reference it should use x.

Probably it should also be renamed to "Evaluate expression" and have a nice icon. The mouse-over explanation can be extended to explain the way it behaves.

Change History (4)

comment:1 Changed 8 years ago by bowtie

  • Priority changed from major to minor
  • Status changed from new to assigned

At present

$ -> p
@ -> x
% -> x

and it needs to be chained to

$ -> ref $ ? x : p;

As for p|x -> icon ( "Evaluate expression" ) is cool, plus tool tip

comment:2 Changed 8 years ago by bowtie

Debug2 has not got a Scooby-Doo as to whether $var_name is a var or a ref.
It's just a string prefixed with $.

I suggest that you just enable y=0 and click on the variable you wish to view

which will be displayed in it's corresponding colour in Debug-Output

correct as of Padre 0.95

comment:3 Changed 8 years ago by bowtie

  • Priority changed from minor to trivial

if $string = one and $string_ref = \$string


if you enter '$string_ref' you will get
$string_ref = SCALAR(0xa0e6680)

then I suggest that you enter '${$string_ref}'
${$string_ref} = one

x $string_ref and click <Raw>

as for p|x it dose what it say's in wiki

Last edited 8 years ago by bowtie (previous) (diff)

comment:4 Changed 8 years ago by bowtie

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.