NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Access to data passed via stack in tooltips and watch window


Joined: 06 Aug 2007
Posts: 37
Location: Atlanta, Georgia USA
Reply with quote
Here I go again with yet another feature request.

In order to explain what I want I need to first explain why I want it. I have a need to debug a lot of existing code (and or write and then debug a lot of code) that looks something like this:

Code:
function foo1($param) {
   foreach(get_list_from_param($param) as $key => $item) {
      if ($param[0][$key]['field']) {
         // do stuff here
      }
   }
   return array(
      'view' => $view,
      'value' => $value,
   );
}


Unfortunately, that code it harder to debug than I would like, so I tend to (re-)write the code to look like this (which is less efficient) so that I can see what would otherwise be the intermediate values created and used by if, while, and especially the return statements:

Code:
function foo2($param) {
   $list = get_list_from_param($param);
   foreach($list as $key => $item) {
      $value = $param[0][$key]['field'];
      if ($value) {
         // do stuff here
      }
   }
   $return = array(
      'view' => $view,
      'value' => $value,
   );
   return $return;
}


What would be phenominally great would be if you could give me access to those intermediate values when I debug code like foo1() instead of me having to (re-)write the code to look like foo2().

Here's what I propose: Add an OPTION to the debugger settings that would change the debugger's behavior to single step twice on each statement that pushes the value of an evaluated expression onto the stack and then consumes the value off the stack in a "hidden" manner. So in the case of the return statement as an example, when the debugger gets to that line in single-step mode it would stop, as it currently does. With this option on, single-stepping would evaluate the expression on the return statement but stay on that line allowing the user to hover over the return statement to see a tooltip with the value that will be returned, and ideally there would be some sort of visual indicator that the return value had already been evaluated. The next single step would of course move on as it currently does when it leaves the line.

I envision the same behavior on if statements, while statements, for statements, etc.

Further to implement this feature it would be nice to be able to add into the watch window the most recent value used either by right-click or by typing in some sort of special syntax (maybe something like "@return{273}" for the return value on line 273 and @if{53} for the if statement on line 53.)

Adding this feature would really speed up my debugging process, and I hope you will consider adding it. Of course if somehow you already support this I'd be more than interested in learning how to access it.
View user's profileFind all posts by MikeSchinkelSend private messageVisit poster's website
Access to data passed via stack in tooltips and watch window
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic