Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22117

Why do I get the same address every time I build + disassemble a function inside GDB?

$
0
0

Every time when I disassemble a function, why do I always get the same instruction address and constants' address?

For example, after executing the following commands,

gcc -o hello hello.c -ggdb
gdb hello
(gdb) disassemble main

the dump code would be:

dump code

When I quit gdb and re-disassemble the main function, I will get the same result as before. The instruction address and even the address of constants are always the same for each disassemble command in gdb. Why is that? Does the compiled file hello contain certain information about the address of each assembly instruction as well as the constants' addresses?


Viewing all articles
Browse latest Browse all 22117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>