STVD (/w COMSIC Compiler) not able to debug double / float datatype
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-09-10 11:20 PM
Posted on September 11, 2014 at 08:20
Hello all,
I`m having some issues using the double or float datatype in STVD with the COSMIC C compiler. I am able to declare those data types but when i start debugging and would like to watch the varibles, STVD shows weird values. for example the simple division 5.0 / 3.0 resolutes in 1,...E-37 which is something like 0. Using float data type has the same effect. I was using break points and the command 'quick watch'. Dennis
This discussion is locked. Please start a new topic to ask your question.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-09-11 9:35 PM
Posted on September 12, 2014 at 06:35 Hello , Please try this(Image atached). and Display item :Standard(After right click on the Display item in WATCH). Thanks& Regards, Balmukund Prasad
________________
Attachments : stvd1.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htrk&d=%2Fa%2F0X0000000aY5%2FVR2TZqKCIJtg3UcZDOz0t2NM9NJXh0bBk8kEaBOuQF8&asPdf=false
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-09-14 11:07 PM
Posted on September 15, 2014 at 08:07
Hey,
thanks. Yeah this doesn`t work :( DennisOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-09-15 12:49 AM
Posted on September 15, 2014 at 09:49 if you post a small bit of code I can take a look with another debugger: that will allow to determine if it's an issue with the code (or the linker file / linked libraries), the compiler, or the debugger. Regards, Luca (Cosmic)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-10-09 7:09 AM
Posted on October 09, 2014 at 16:09
Hello Luca,
not even simple programs work. For example: main(){ double test = 0.0; test = 5 / 3; } And watching this variable test shows the same ... Thanks.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-10-10 1:59 AM
Posted on October 10, 2014 at 10:59 Hello, as it is posted, your division will return 1.0, as it makes 5/3 as an integer division and then assigns the result to a float variable. If you add a cast, implicit or explicit
test = 5.0 / 3.0;
it works ok on my simulator/debugger. Also take care of the fact that, with very simple examples, some variables that are never used later are just optimized away by the compiler. I suggest you try the followingmain(){
volatile float test = 0.0; test = 5.0 / 3.0; } It works ok on my PC (zap debugger): if it still does not work for you I can try to get a copy of STVD and see where it goes wrong.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-11-04 4:02 AM
Posted on November 04, 2014 at 13:02
Hi Luca,
thanks for your reply. In this case it was my fault and everything is going fine. Thanks!