Question: In gdb 'p /t' shows values of variables or registers in binary format. When an uint16\_t or uint32\_t register is read, it's hard to find the bit that I want to look at. Is there a way of formatting the output better? For example, grouping 4 digits and adding spaces, like '0000 0000 0100 0101'?

Answer: 
Well... I just found a way, though it's not beautiful. 

'x/' shows values in variables. It has some useful formatting options.

For example, if you want to read a 32-bit register that stores the following value.

```
 (gdb) p /t register_name
 11111111111011111111100010101010

```

Then, you can see them byte by byte like the example below. Note that the order of the bytes are reversed. 

```
 (gdb) x/4bt &register_name
 0x40022020:  10101010    11111000    11101111    11111111

```
There is no built-in way to do this. It seems like a reasonable feature to request (in gdb bugzilla).