Author Topic: How to set watches to Hexidecimal?  (Read 4931 times)

Offline thela_kid

  • Single posting newcomer
  • *
  • Posts: 2
How to set watches to Hexidecimal?
« on: January 24, 2015, 01:39:48 am »
Hi, I'm trying to debug my program by looking at the local variables in the watches window, however there doesn't seem to be a way to view these values as HEX or binary. How can I do this?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: How to set watches to Hexidecimal?
« Reply #1 on: January 24, 2015, 11:06:38 am »
Unfortunately this is not possible for the locals.
You have to add separate watch variables and then right click -> properties -> hexadecimal.

As far as I can see there is no way to tell gdb to list locals or args in hexadecimal format.
C::B uses 'info locals' and 'info args' commands.
(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 thela_kid

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to set watches to Hexidecimal?
« Reply #2 on: January 25, 2015, 12:27:28 am »
I see, thank you.

Offline ca1e

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to set watches to Hexidecimal?
« Reply #3 on: January 22, 2019, 01:44:59 am »
Unfortunately this is not possible for the locals.
You have to add separate watch variables and then right click -> properties -> hexadecimal.

As far as I can see there is no way to tell gdb to list locals or args in hexadecimal format.
C::B uses 'info locals' and 'info args' commands.

- i have an array of many variables
- they are memory pointers
- in this case, decimal integers are not useful
- right-clicking every single variable not possible

currently i am using windows calculator to convert from decimal to hex, because it is faster than;

- adding a new watchlist entry for a variable
- then right-clicking it
- then ticking a box in a a popup window

it is now 2019. is it possible with today's technology to display a hex number?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: How to set watches to Hexidecimal?
« Reply #4 on: January 22, 2019, 02:06:13 pm »
You select your array variable, you rightclick->Add watch
you select the watch in the watches window->right click->properties->Format->hex
Then you select start and count for the amount of array entries you want to watch

now you can view the whole array in hex...

If you are talking about c++ std::array things will get complicated. Then you will have to write some python script for gdb....
« Last Edit: January 22, 2019, 02:08:28 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: How to set watches to Hexidecimal?
« Reply #5 on: January 22, 2019, 07:37:06 pm »
He/she is talking about hex by default if I understand him/her correctly. This is currently not possible even in 2019...
(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 ca1e

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to set watches to Hexidecimal?
« Reply #6 on: February 10, 2019, 05:41:23 am »
hex by default

exactly..
is there any possible way in the universe which we live that this could be achieved?
it would make debugging much, much easier.. .. ..

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: How to set watches to Hexidecimal?
« Reply #7 on: February 10, 2019, 11:16:02 am »
Yes, patch C::B...
(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: 2417
Re: How to set watches to Hexidecimal?
« Reply #8 on: February 10, 2019, 02:43:23 pm »
or use the memory view...