gdb debug issue about "main.cpp No such file or directory."

I just start learning to use gdb. I am debugging a program using gdb. I firstly start the program then attach the gdb with the process as

gdb excuteFile pid

Then gdb starts normally. Then I can see the process is paused. The first thing I try is command : list

But the gdb doesn't show the codes in my main.cpp file, instead, it gave message:

"main.cpp No such file or directory"

why ?

Thank you.
Last edited on
Topic archived. No new replies allowed.