0

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!

talonmies
72.7k35 gold badges204 silver badges296 bronze badges
asked Sep 17, 2018 at 8:39
1
  • 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? Commented Sep 17, 2018 at 16:45

1 Answer 1

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:

  1. The thread (there is no parent/child relationship between threads) is blocked in some libc or libpthread function and
  2. 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.

answered Sep 18, 2018 at 1:12
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.