How to Print in Binary Mode in Gdb?

I tried b but seem not:

(gdb) p/b 0x0000000000400398
Size letters are meaningless in "print" command.

Is there such a switch?

2 Answers

You need the /t switch which works with both p and x:

(gdb) p /t 0x0000000000400398
$1 = 10000000000001110011000

See help x for more info on the FMT (format) switches.

4

x/4tb 0x0000000000400398 will let you analyze the Memory Address with Binary Values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest