0

I am a little new to GDB, and I was wondering if it is possible for me to stop an input process while the executable runs and find out what is the function of that input to disassemble the function

for example, imagine I run the file and give these lines

blah blah blah
some prints here
some print there

enter a number:

can I stop the process when this input type a number: appear and find out what is the function that performs it?

Vinni Marcon
  • 606
  • 1
  • 4
  • 18
  • 1
    Yes. You can press ctrl+c as normal, then backtrace. – Jester Sep 17 '20 at 11:03
  • 1
    @JesterI tried that, and tried that `backtrace` command that informed me, but it all just takes me to a memory address with no function, for example: `0x000000000050a151 in ?? () `, and probably this memory address has no connection with the input because I tried to use a `break` but it doesn’t stop during execution – Vinni Marcon Sep 17 '20 at 11:11
  • 1
    You need to build the binary with debug info enabled. – ks1322 Sep 17 '20 at 11:16
  • 1
    @ks1322 How can I do this? I have only the binary file – Vinni Marcon Sep 17 '20 at 11:28
  • 1
    If you can rebuild the binary, you should build it with `-g` option. But it seems that you can't, if you only have the binary file. – ks1322 Sep 17 '20 at 11:32

0 Answers0