GDB prints leading zeros binary

I am trying to print a 32 bit register in GDB with the command:

define gpioa_moder print /t *(uint32_t*)0x48000000 end 

This is what I get:

+101000000000000000010010100000

However, I would like the two leading zeros to be absent as follows:

00 101000000000000000010010100000

thanks

+5
source share
1 answer

You can try the x (view) command .

Then use it as follows:

 x /w 0x48000000 ---> 0x48000000: 00101000000000000000010010100000 

You can use other b , h and g format options to print in different sizes.

+2
source

Source: https://habr.com/ru/post/1233137/


All Articles