View unanswered posts | View active topics It is currently Mon Sep 21, 2020 3:28 pm






Reply to topic  [ 3 posts ] 
Local variables instead of global variables in debug window 
Author Message
Rookie

Joined: Mon Jan 04, 2010 10:51 am
Posts: 15
Location: Portugal
Post Local variables instead of global variables in debug window
I am sorry if this question is repeated - I couldn't find it in the site though.

Is there any way I can see only local variables instead of global variables in the debugger window? I have a program wih several functions - and many of them use local variables with the same names. It would be very pratical to be able to see only variables in scope, instead of all the variables for all the functions.

If not, is there at least some way for me to find a specific variable in the debugger window? If not, at least to be able to sort the variables in the window would be very helpfull. Since I have many arrays the window is a bit cluttered with information...


I saw in this thead (viewtopic.php?f=8&t=858) that someone was asking for shortcut keys for the debugger. Is this planned for next releases? It would really be helpfull in my opinion.


Sat Jan 09, 2010 7:29 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Local variables instead of global variables in debug window
Perhaps it would be better to rename your local variables to something else that is not identical to the global variables. There is currently no way to filter the variables shown in the debugger window.

I tend prefix all local variables with a "_". This helps me identify the local ones very quickly.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Jan 09, 2010 7:33 am
Profile WWW
Rookie

Joined: Mon Jan 04, 2010 10:51 am
Posts: 15
Location: Portugal
Post Re: Local variables instead of global variables in debug window
Wow - that was a quick response!

My problem is not only in separating local variables from global variables, but also in separating between local variables that are in scope or not. For instance int the following code:

Code:
void Function1 ()
{
  for ( int i = 0 ; i < 10 ; i++ )
  {
    //put a breakpoint here
  }
}

void Function2 ()
{
  for ( int i = 0 ; i < 10 ; i++ )
  {
    Function1();
  }
}
task main () {
  Function2();
}
if i place a breakpoint near the comment, I will have two variables named "i" in the debugger window - wich makes it much harder to debug. Just placing (for instance) the name of the function before the variable would realy help... anyway, this is only a suggestion...

Thanks for your quick answer


Sat Jan 09, 2010 9:38 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.