While debugging with GDB I want to break for each function and print the PC register.
rbreak .
define hook-stop
i r $PC
c
end
The problem is that is stop on functions that imported like printf
and memcpy
.
How can I stop only on functions in my binary that not imported?
readelf -s <target>
does the symbol table contain the functions you want to find, or are you just looking for anything reached by a 'call' instruction during execution? (I ask because the optimizer can do funny things to functions, including merging the tail of several similar functions into a single set of instructions shared by all.)