• AVR Freaks

Helpful ReplyHot!MPLAB X debugger does not recognize assembler variable names / can't show in watch window

Page: 12 > Showing page 1 of 2
Author
crashpilot
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2009/12/31 04:28:35
  • Location: 0
  • Status: offline
2012/07/29 07:38:57 (permalink)
0

MPLAB X debugger does not recognize assembler variable names / can't show in watch window

Hi all,
I found that the MPLAB X debugger has a problem with assembler variable names that are simply declared by "equ" directives. You can find a workaround for this problem below.
Example code:

...
var1   equ   0x08
var2   equ   0x09
; begin of program code
...

With this code it is not possible to add the "variables" var1 and var2 to a watch / variables window. In MPLAB 8 there was no problem to do so.
Workaround:
Use an udata segment to define the variables. Then you can add them to the variables / watch window without problems:

...
variables udata
var1 res 1
var2 res 1
   code
; begin of program code
...

I hope this will help if someone experiences the same problem.
#1
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2012/07/29 08:28:38 (permalink)
0
It was the same in MPLAB 8 IIRC.
It is not exactly a bug, rather the fact that "EQUs" are just labels, while memory that was REServed is known to the linker etc.

GENOVA :D :D ! GODO
#2
Guest
Super Member
  • Total Posts : 80500
  • Reward points : 0
  • Joined: 2003/01/01 00:00:00
  • Location: 0
  • Status: online
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2012/08/20 07:10:45 (permalink)
0
ok, so it is no longer possible to watch a variable declared as EQU????
What happen if i want to impose the address of my register in my code (with EQU) and then i want to watch it during the simulation?
 
Thanks
 
#3
koen_asm
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2013/09/18 01:29:56
  • Location: 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2013/09/18 01:45:30 (permalink)
0
I experience this also as a "bug" since I use the "EQU" directive over 15 years in assembly.  After "upgrading" to MPLAB X, my legacy can't be debugged...thats a "bug" to me...
#4
Laz7
Junior Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2013/05/23 10:15:07
  • Location: West of Philly
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2013/09/18 06:54:09 (permalink)
+2 (2)
EQU is the same as #define in C.  There is nothing to watch, as it's not a variable, it's a constant.  The resulting machine code is usually "load immediate".
 
As Dario says, there is no bug here.  If you have used an IDE that will show you the value of a named constant, that's a nice feature, but not typical.  I know some editors that will give you the value of a constant when you right-click or hover over them, but I don't think I've ever seen this in a debugger.
 
You should still be able to monitor your SFRs, though this code is suspect:
   SFR1 EQU 0x5A
 
It should be more like (generic asm syntax):
CONST1 EQU 0x5A


   mov SFR1, CONST1 


#5
rpuskarcik
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2003/11/07 12:52:07
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/21 12:28:13 (permalink)
+1 (1)
Perhaps it is okay that the use of "equ" to define variables in MPLAB X is no longer acceptable.
However, I tried "set", and that doesn't work either. That is a bug for sure, since "set" is defining an assembler variable, and not an assembler constant as is "equ".
 
Also, the "variable" directive, which is supposed to declare variables, does not work in MPLAB X. (the X stands for "doesn't work).
 
Does anyone know how to write a script that would run at build time to convert variable declarations to udata?
 
#6
JorgeF
Super Member
  • Total Posts : 3341
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: PT/EU @ Third rock from the Sun
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/21 12:49:23 (permalink)
+2 (2)
Hi
 
This is old news, but...
For the debugger in MPlabX to recognise declared constants as RAM alocations in absolutely located assembler, one must declare them using "cblock/endc" construct.
 
Anyhow, the use of "equ" for the purpose of declaring RAM allocation for variables is a bit outdated.
 
 
 
Best regards
Jorge
 
 
 
 
#7
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/21 13:18:54 (permalink)
+2 (2)
If you're working in absolute assembler mode in MPLABX, you must edit the project properties to say it is "absolute" mode, otherwise it defaults to linking mode.
#8
CinziaG
die fucking humans
  • Total Posts : 3145
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/23 14:33:09 (permalink) ☄ Helpfulby _dex 2019/05/28 14:29:47
+2 (4)
It only takes a few hours of work with X, once in a long while, to wish that microchip had never been founded ;)

in 2018 you signed for your annihilation. in 2019 it will come ;) I promise
my most wonderful creations here
https://www.youtube.com/c...dPFRvtwsbSTXp6Sk6azGOQ
#9
vloki
Jo, alla!
  • Total Posts : 6815
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/25 02:30:01 (permalink)
+1 (1)
rpuskarcik
Also, the "variable" directive, which is supposed to declare variables, does not work in MPLAB X. (the X stands for "doesn't work).

This has nothing to do with X. You possibly should read the assembler's user guide!

Uffbasse !
#10
RISC
Super Member
  • Total Posts : 5381
  • Reward points : 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/25 12:12:19 (permalink)
+3 (3)
Hi,
Like in C language, the definition of labels and the declarations of global variables in ASM are 2 separate things where the parser does different tests and the linker also different memory allocations.
equ (ASM) <==> #define (C)
res (ASM) <==> global declaration   char var
So for assembly aficionados, there is at least way to see variables which is  res ...
regards
 
#11
1and0
Access is Denied
  • Total Posts : 10346
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/06/25 14:09:30 (permalink)
+1 (1)
@qhb has already posted the solution in Post #8.
 
Anyway, absolute code "variables" assigned using CBLOCK, EQU, and SET directives will appear in the Watch window when MPLAB is setup for absolute mode.
#12
Abdul_Wahid
Starting Member
  • Total Posts : 41
  • Reward points : 0
  • Joined: 2014/04/22 04:19:10
  • Location: 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/07 07:35:03 (permalink)
0
I am using MPLABX 3.55 , assembler mpasm (v5.72) and simulator
I am also suffering from same problem 
I have read all above but still in trouble
I am trying the following code to see variables in variable window but in van.

 


LIST P=16F73
#INCLUDE P16F73.INC
 
cblock 0x20
var1
endc

var2 equ 0x21
var3 set 0x22

org 0

MOVLW 0x23
MOVWF var1
MOVWF var2
MOVWF var3
GOTO $
 
END
 

 
It is compiled and runs but variables are only visible at their addresses in File Register window.
I can't see any variable in Variable window. I have tried MPLABX in absolute mode and without it.
post edited by Abdul_Wahid - 2017/07/07 07:57:44
#13
1and0
Access is Denied
  • Total Posts : 10346
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/07 13:26:38 (permalink)
+1 (3)
For some stupid reasons, the variable names in absolute mode are not listed in the New Watch window of MPLAB X. So, either manually type the name in New Watch, or right click on top of the name in the source code and select New Watch to add it to the Variables and Watches windows.
 
#14
Abdul_Wahid
Starting Member
  • Total Posts : 41
  • Reward points : 0
  • Joined: 2014/04/22 04:19:10
  • Location: 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/07 21:14:45 (permalink)
+1 (1)
Thanks 1and0 . Problem is solved. 
Now it is possible to see all variables var1, var2, var3 . only in absolute mode.
I have to add one by one. ( if all variables could be added once that was great).
MPLABX developers should clear this problem so that all variables should be listed in variables window automatically without clicking and without absolute mode.
#15
1and0
Access is Denied
  • Total Posts : 10346
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/08 08:42:03 (permalink)
+2 (2)
Wahid Abdul
I have to add one by one. ( if all variables could be added once that was great).
MPLABX developers should clear this problem so that all variables should be listed in variables window automatically without clicking and without absolute mode.

Yep, it would be great if they fix the bugs in MPLAB X. LoL: LoL  A checkbox in front of each variable and a global checkbox at the top that select all variables would be great too. It's also nice if all local variables are automatically added when execution is in scope. But I think that's just dreaming ... Smile: Smile
#16
vloki
Jo, alla!
  • Total Posts : 6815
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/09 03:12:18 (permalink)
+3 (3)
If I where a developer I possibly would not support the use of absolute code in MPLABX at all.
If one wants to code in absolute mode or maintain old projects written in absolute mode, they can use MPLAB 8.

Uffbasse !
#17
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3663
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/07/09 09:06:12 (permalink)
+1 (1)
I hate the pic 8bit directives.
16bit is more logical.
 
That is true.
Mplab x will fight you all the way to hell and back.
 
Everyone knows it except Microchip.
 
 
Another re-occuring bug has come back today.
Select in projects.  Not working again on a file.
 
I know what it is, it is a newly created file.  This bug occurs eveytime.
You know, you create a file, it is in the projects folder view.
Restart mplabx, it is gone, select source files, add existing item, it's back, restart it is gone.
 
There is a fix to make it non-volatile, I've got into the habit of doing this.
1. Restart mplax
2. Do not edit any files
3. immediately add existing item
4. it is now permanent and other files are back, problem is, you get the Select in projects bug.
 
It's even worst if the file is a library file because calling that file from a main file will flag an error from the linker telling you that it does not exit.  That could happen a month later.
 
99 times out of 100, the bug is with mplab x and not the user.
#18
Marc_PicUser
New Member
  • Total Posts : 10
  • Reward points : 0
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/12/13 13:04:17 (permalink)
0
Configuration
On version mplabx 4.05
Target PIC16F88
Absolute programming mode set
variable aliases declared with CBLOCK
 
BUG DESCRIPTION
 
In editing mode I can add a SFR watch as well as a Global Symbol.
As soon as the debugger is invoked the Global Symbols disappear.
 
 
No of the solutions mentioned here are working properly.
 
The old MPLAB IDE v8.92 just works better in almost every aspect concerning tools that support assembler programming!
 
Other bugs
On entering debug mode using (original Microchip) PikKit3 random error:
Device not found (and other error’s).
Tested with 2 different original Microchip PIKKIT3 devices.
Tested on powerfull desktop with up to date windows 10 PC.
Tested on labtop with up to date windows 10 Medion erazer.
Tested on labtop with up to date windows 10 ASUS.
 
The stopwatch is unusable for assembler programmers writing
and debuging timing critical code.
 
Conclusion
Mplabx 4.5 is not usable as assembler development tool.
 
Marc
#19
mbrowning
USNA79
  • Total Posts : 1628
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: offline
Re:MPLAB X debugger does not recognize assembler variable names / can't show in watch wind 2017/12/13 13:37:17 (permalink)
+1 (1)
Mplabx 4.5 is not usable as assembler development tool.

of course not. It hasn't been released yet :)
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5