Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 16, 2024, 12:47:32 12:47


Login with username, password and session length


Pages: [1]
Print
Author Topic: Proteus Format (-1) not valid for type (0x00000000). What is it?  (Read 2951 times)
0 Members and 1 Guest are viewing this topic.
alichan
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 28
-Receive: 88


« on: February 28, 2019, 05:44:47 17:44 »

Hello.

Surely when debugging with Proteus you have noticed the message "Format (-1) not valid for type (0x00000000)" in CPU variables or watch windows. I looked in the documentation, general search on Internet but couldn't find anything.


Do you know why or the reasons this message appears with some variables ?

It happens mostly with anidated structs (C language), deferencing some pointers, bitfields, etc. but not with all of them. I cannot find the reason of such message, what pattern it follows since in some cases you can see variables correctly and not in others, or any documentation about it, and doesn't help to debug since you cannot see the variable contents (and I have enough with the apparent Proteus limitation to show 32-bit variables).

As workaround after some tries, I found that if you create a (global) pointer of same type of the variable you want to see, then assign the variable address to the pointer, even if the pointer is not used (use volatile to avoid the optimizer removing it), Proteus will show the correct variable contents in any variable of the same type, even not referenced. Creepy...

Example (forget syntactic correction in example, it's not relevant here):

struct ex1
{
   ...
}

struct EX2
{
   struct ex1 test;
   int test2;
} ex2;

If you expand ex2 while debugging, it will show "Format (-1) ...". Now if you

volatile struct EX2 test * debug_test = & ex2;

It will show correctly ex2 contents (but chances are not ex1, and you have to do the same with the inner struct).


I'm insterested on any experience you had with this... Cheers mates.
« Last Edit: February 28, 2019, 05:51:49 17:51 by alichan » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC