I have both the parent and the child thread in the same file. When following the main thread, gdb has no issues: it correctly displays the source code with the "layout src" command and values of variables with "disp val" command. However, as soon as I switch to a different thread ( with command "thread 5" ), "layout" cannot display source code and says "No Source Available" and "disp var" says "No Symbol var in current context".
- the child thread is not detatched
- the parent thread waits for the child thread to terminate with the "pthread_join" function
- I am using c++11 and cuda 9.2
Edit:
I am suspecting that I am not using the correct "libthread_db" file. However, I have no knowledge of what "libthread_db" is nor what the choices are. If you believe this could be the source of the problem, then could you please recommend a few libthread_db files that would be compatible?
I would really appreciate your help!
-
Does the "no source available" error occur for more than one function in the call stack of the child thread, or just for the function at the top of the stack?Mark Plotnick– Mark Plotnick2018年09月17日 16:45:21 +00:00Commented Sep 17, 2018 at 16:45
1 Answer 1
"layout" cannot display source code and says "No Source Available" and "disp var" says "No Symbol var in current context".
This likely means that:
- The thread (there is no parent/child relationship between threads) is blocked in some
libcorlibpthreadfunction and - You don't have debuginfo for GLIBC installed.
Try to step up from wherever the thread is blocked, and you should gain back the source once you are at the application level.