SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: elvin-nnov on July 17, 2020, 06:06:11 am

Title: rounding of floating point variables during watching of them in Linux/gdb
Post by: elvin-nnov on July 17, 2020, 06:06:11 am
I am using Slickedit on Ubuntu(16/18/20) and on all linux platforms Slickedit (Pro 2018/2019) does not show floating point numbers in watch window for C/C++ apps, it rounds them only to the integer part. I was looking for description of such kind of issues in internet and was able to find only one report dated of 2012 year mentioning that SL2007 showed numbers well, but 2012 does not. Unfortunately it was no solution in that topic.
I set def_debug_loggin macro variable and looked into the logs - gdb expectedly returned correct value. Something wrong happened during processing of the response or visualization of it.
Does anyone have such kind of behaviour or you can see floating point numbers correctly during debugging of native apps on Linux(Ubuntu)?
Title: Re: rounding of floating point variables during watching of them in Linux/gdb
Post by: Dennis on July 18, 2020, 12:14:12 am
I'll do some testing and get back to you next week on this.

There is some room for error there, we parse the number GDB gives us, put it in a double, then format it with "%g" to display it.  Well, that is what is supposed to happen anyway.

I did a quick test on macOS, and that worked correctly.  Would you mind putting up some example code?  Maybe my test cases were too simple.
Title: Re: rounding of floating point variables during watching of them in Linux/gdb
Post by: elvin-nnov on July 19, 2020, 07:03:01 pm
No special example is required. I cannot see any float pointing value correctly. like
float a = 1.234;
printf("%f", a); <- put breakpoint on this line and add a to the watch or move mouse pointer over variable to see floating window with content

I believe that this functionality must work somewhere (You verified on MacOS and I saw that floating point variable was shown in correctly in some advertisement picture of new Slickedit features on Windwos). At the same time, I am using Ubuntu and only Ubuntu, I verified on just installed OS and on OS having many additional stuff, no difference. The latest Slickedit that I have - 2018Pro, but I tried eval license for 2019 as well and do not see correct values. That is weird. Again, it might be not only due to problems with gdb coexistence, it might be issues with visualization library, with python version, with locality (that must be again weird since it is not a Windows and on Linux there should be the only delimiter - point).
Title: Re: rounding of floating point variables during watching of them in Linux/gdb
Post by: Dennis on July 20, 2020, 07:50:26 pm
I tested on my Linux Mint 19.3 box, and it worked fine with SlickEdit 2019 (24.0.2).

Do the following to start SlickEdit with a default configuration:

Code: [Select]
vs +new -sc /tmp/debugtest42/
Then open the sample C++ project.  (Project > All Workspaces > Sample Workspaces > cpp.vpw).
Add your test case code, build it, then start the debugger and stop at that line.
If you have made changes to C/C++ color coding, or debugging options, it is possible that is the reason you are not getting good results.

If you look at the Locals tool window, does 'd' show up correctly?  How about if you right-click and look at the submenu for how to view 'd', maybe you are forcing it to be displayed as an integer?