1

一、problem description

1.(gdb) disas main (partial assembly code)

   0x000000000000066e <+0>: push   %rbp
   0x000000000000066f <+1>: mov    %rsp,%rbp
   0x0000000000000672 <+4>: sub    $0x10,%rsp

2.b *(main+0), r

Breakpoint 1, 0x000055555555466e in main ()

二、Why do the addresses display differently? (gdb)

①0x000000000000066e <+0>: push %rbp

②0x000055555555466e in main ()

ks1322
  • 33,961
  • 14
  • 109
  • 164
Forrest
  • 63
  • 4
  • PIE executables don't have an address until after they start running. Do `disas` *after* `start` or `starti`. (`start` is a shortcut for setting a breakpoint in main and running, starti stops before executing any instructions in user-space in the new process.) – Peter Cordes Dec 28 '20 at 09:44

0 Answers0