Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/06 18:04
Read: times


 
#122925 - for ICE and other debugger users
This, since it was discovered using the Cygnal ICE, is posted at the SILabs forum as well

I have, for who knows how long, always prefaced local variables with a 3 letter 'abbreviation' of the function they were in, that has served me well here is an example:
void ConvertColor(void)
{
U8  CVCCcolor;
now I was inserting some debugging code and ignored my 'rule' since the code was "fast and temporary, to be discarded".
Well I spent too long time in the debugger till I found out that if two funtions have an identically named variable, you can get caught in a real quagmire: If you set a watch of variable 'ralph' in func1 and func 2 also has a variable 'ralph' and you watch 'ralph' in func2, you are screwed.
I would NOT consider this an error in the debugger.

Coming to think of it, I guess I developed the naming convention running into a similar problem with another debugger in the days when Cygnal still "was a glint in the founders eye"

So, I will adhere religously to my 'standard' and if you want to pick it up, you are welcome. At least now you are aware of the potential trap from identically named local variables.

Erik

List of 11 messages in thread
TopicAuthorDate
for ICE and other debugger users            01/01/70 00:00      
   I would say            01/01/70 00:00      
      Old ICE problem            01/01/70 00:00      
         variable kept in a register            01/01/70 00:00      
         The problem with free stuff            01/01/70 00:00      
   HORRIBLE SILabs local variable problem            01/01/70 00:00      
      inexpensive? horrible?            01/01/70 00:00      
         HORRIBLE SILabs local variable problem            01/01/70 00:00      
            that is not just a debug adapter            01/01/70 00:00      
      Symbols View Tab            01/01/70 00:00      
         S I Labs Symbols View Tab            01/01/70 00:00      

Back to Subject List