EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Symbols refusing to update in Watch Window while debugging

Started by Jason Hsu May 19, 2008
I'm using MPLAB SIM to debug an Assembly language program. I'm able
to get it to build and run, but I can't get the symbols to update.
The symbols refuse to update in the Watch Window, and View->File
Registers->Symbolic also shows the symbols that should update but
utterly refuse to do so.

What's wrong with my configuration? I'm pretty sure that it's just
one little thing that's screwing everything up.
Jason

MPLAB SIM does not update the values in the watch window when the simulation
is running, only when you have reached a breakpoint. However, if you select
"Animate" rather than "Run", it wil stop and update the display after each
instruction. In "Debugger->Settings..." there is a tab that allows you to
adjust how long the simulator pauses between instructions.

Also, be sure you understand the term "symbol". The watch window can be a
bit misleading.

A SYMBOL is a creature of the assembler. It is nothing more than a string
that has some value attached to it. At runtime, it is a constant. A symbol
is something we use to make our program more readable. If you recall in our
discussion of incfsz, the symbols F and W were simply ways to make the
destination bit of the instruction more readable. We might define a symbol
like maxwait that we would use in a movlw instruction to set the number of
times we want to go through a loop, for example.

Now frequently, we define symbols to refer to the addresses of general
purpose registers. Typically we define these with res statements and allow
the linker to assign values, but in the learning stages, we might use an equ
to assign a specific memory cell, for example

var equ 0x24

Now, in the watch window, there is this "Add Symbol" dropdown. The watch
window looks at the file register address space, and uses that Symbol as the
address of a file register location whose contents are to be watched. Note
that the address MUST be implemented. There are lots and lots of possible
values for a symbol, but only a relatively few of them represent
implemented RAM. The simulator knows what RAM is implemented for your
processor, and if the symbol has a value that represents unimplemented RAM,
then the simulated instructions won't change that value of that location,
and thus changes won't be reflected in the watch window. Check your
datasheet to be sure that the symbols you are watching have values that
correspond to RAM locations in the processor you have selected.

Also, when you are debugging a more involved program, certain locations
might be "out of scope" and the watch window won't display those. In that
case, the watch window will display "Out of Scope" for the value.

72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: "Jason Hsu"
To:
Sent: Monday, May 19, 2008 1:25 AM
Subject: [piclist] Symbols refusing to update in Watch Window while
debugging
> I'm using MPLAB SIM to debug an Assembly language program. I'm able
> to get it to build and run, but I can't get the symbols to update.
> The symbols refuse to update in the Watch Window, and View->File
> Registers->Symbolic also shows the symbols that should update but
> utterly refuse to do so.
>
> What's wrong with my configuration? I'm pretty sure that it's just
> one little thing that's screwing everything up.
>
OK, I realize the problem. I didn't put in enough breakpoints to see
the changes before the next reset.

Memfault Beyond the Launch