Searching \ for '[PIC] Watch window - Out of Scope?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Watch window - Out of Scope?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Watch window - Out of Scope?'
2005\12\23@213327 by Josh Koffman

face picon face
Ok, this is my first time doing a project using the ICD2, and it's
also my first using relocatable code.

My problem is that I just added a couple of watches in the watch
window for user defined symbols (ie not SFRs). All MPLAB (v7.22 btw)
will say about them is "Out of Scope" in the value column. I've tried
to find any mention of this in the help, and I've come up against a
wall.

I know this is probably a simple problem, but I'm stumped. Help!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

2005\12\23@222224 by Harold Hallikainen

face picon face
This is normally caused by your trying to watch a local variable outside
the function in which it is defined (or watch a static global variable
outside the file in which it is defined). Automatic local variables don't
even exist outside of the function since they are stored on the stack.
Static local variable exist but are protected from access outside the
function.

Hope that helps!

Harold


{Quote hidden}

> -

2005\12\23@232713 by Josh Koffman

face picon face
On 12/23/05, Harold Hallikainen <spam_OUTharoldTakeThisOuTspamhallikainen.com> wrote:
> This is normally caused by your trying to watch a local variable outside
> the function in which it is defined (or watch a static global variable
> outside the file in which it is defined). Automatic local variables don't
> even exist outside of the function since they are stored on the stack.
> Static local variable exist but are protected from access outside the
> function.

Hi Harold,

Well, it sort of helps. I think I need to study up more on variables
and relocatable code.

However, what happens if I really wanted to watch a local variable? I
just added them to the watch window - how can I tell MPLAB what
function I'm in?

Thanks!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

2005\12\23@233930 by Harold Hallikainen

face picon face

{Quote hidden}

You should be able to set a breakpoint within the function where the
variables are in scope. When the debugger stops in the function, you can
see the current values.

Harold
--
FCC Rules Updated Daily at http://www.hallikainen.com

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...