Author Topic: Memory dump Window Format  (Read 6712 times)

Offline DoaEst7

  • Single posting newcomer
  • *
  • Posts: 2
Memory dump Window Format
« on: June 05, 2018, 08:04:52 pm »
Hello,
I'm using Code::Blocks 13.12.  Running on a Raspberry Pi with Raspbian 4.9.45 OS.   In debugging my C program I wish to view a global array of floats.   I can find the array in the memory dump window but it displays hex data.   Is there any way to view the data in float format?
Thanks much

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Memory dump Window Format
« Reply #1 on: June 05, 2018, 09:25:11 pm »
No...
but why do you don't use the watches?

Offline DoaEst7

  • Single posting newcomer
  • *
  • Posts: 2
Re: Memory dump Window Format
« Reply #2 on: June 05, 2018, 11:34:49 pm »
Watches window shows the global arrays but not their contents.  Just shows a pointer to their location in memory.  Is there  a way to display the contents of  global arrays in the Watches window, (in float format)?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Memory dump Window Format
« Reply #3 on: June 05, 2018, 11:53:53 pm »
Have you tried to right click on the watch and inspect the properties?
There are options to enable display of arrays.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Memory dump Window Format
« Reply #4 on: June 06, 2018, 01:48:18 am »
Quote
Watches window shows the global arrays but not their contents.
You can add your own watches by going with the mouse over the variable you want to see->right click->Add watch
This is only available in the running debugger...

[Edit:] You can also add watches, by typing in a free row in the watches window. There you can enter nearly any valid c syntax. Like &variable will give you the address and *variable will give you the value of a pointer... You can also enter variable1+variable2 and so on...

Offline mannisp

  • Single posting newcomer
  • *
  • Posts: 6
Re: Memory dump Window Format
« Reply #5 on: December 25, 2024, 10:14:30 pm »
Yes this is an old topic but as long as Google (or other web search) finds this when trying to find help for showing floating point values in memory dump, it is still valid thread.
So, thanks to previous message I was able to add an array to watches and edit properties to show float values instead of hex values in memory dump. However, this is a strangely behaving feature, far from intuitive:

Firstly, when a pointer is a function argument, you cannot edit its properties in watches by right clicking to show it as array. It has to be added separately to watches during run-time by right-clicking the variable in c file. Only then it allows editing properties when right-clicking in watches window. This doesn't seem like a well-thought feature; there's no reason why pointer in function arguments should not directly allow showing it as array.

Then in properties it is not obvious that you have to leave the format as "undefined" in order to show the floating point value. I tried all other options until I gave up and set it undefined and to my surprise it then showed floating point value.