I am debugging a networking code and want to print ip addresses which are declared as int32
.
when i print it using gdb print command, i get some values which is not much meaningful.
How can i possibly print them in meaningful format?
I am debugging a networking code and want to print ip addresses which are declared as int32
.
when i print it using gdb print command, i get some values which is not much meaningful.
How can i possibly print them in meaningful format?
Make a function that calls inet_ntoa, and then call it with the 'p' command in gdb on your int.
Just use inet_ntoa(3)
as so:
(gdb) p (char*)inet_ntoa(0x01234567) # Replace with your IP address
$1 = 0xa000b660 "103.69.35.1"