When disassembling functions, gdb will display memory addresses in base 16, but will shift it in base 10.
Example:
(gdb) disassemble unregister_sysctl_table
Dump of assembler code for function unregister_sysctl_table:
0x00037080 <+0>: push %ebp
0x00037081 <+1>: mov %esp,%ebp
0x00037083 <+3>: sub $0x14,%esp
0x00037086 <+6>: mov %ebx,-0xc(%ebp)
0x00037089 <+9>: mov %esi,-0x8(%ebp)
0x0003708c <+12>:mov %eax,%ebx
0x0003708e <+14>:mov %edi,-0x4(%ebp)
Function offsets are <+N>next to the address, and as you can see, they are in base 10.
When the Linux kernel crashes, it displays a back trace using base 16:
[ 0.524380] [<c10381d5>] unregister_sysctl_table+0x65/0x70
It is very annoying to need to convert the return return addresses from base 16 to base 10 in order to be able to find the right command.
Can gdb show disassembly output with 16 base offsets?
source
share