While debugging with GDB I want to break for each function and print the PC register.

rbreak .
define hook-stop
   i r $PC

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?

  • What definition of 'function' are you using? Does it need to be something you're exporting? if you use 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.) Dec 13, 2021 at 22:58
  • @lockcmpxchg8b I looking for all the function that implement in my binary. Dec 14, 2021 at 6:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.