I working in GDB to debug my program. At various breakpoints, I want to call a function that I wrote that iterates through my heap at that point in the execution. I have seen that I can call this function from within GDB like this:
(gdb) call foo()
But when I do, I get this error:
(gdb) call foo()
No symbol "foo" in current context.
The function clearly exists (and is called later on from within the program, and I know that I am not making any dumb mistakes like typos, but I don't know why it won't execute.
Am I calling this correctly? Is there somewhere that I can read about this problem? I've searched exhaustively in this, and it looks to me like this error is common for out-of-scope variables, but I don't see it explained with function calls. Maybe it thinks that I am looking for a variable? Very confused.
Thanks.