I added one .cu file to cuda project in nsight on Mac OS. When I tried to ctrl+click the variable or functions, the indexer reports the bug as below: (by the way, the highlight seems not be activated in this file)
open declaration has encountered a problem. An internal error occurred during open declaration: An internal error occurred during: “Open Declaration”. org.eclipse.cdt.internal.core.dom.parser.ProblemBinding cannot be cast to org.eclipse.cdt.internal.core.index.IIndexFragmentBinding
It only happened in several methods and the other functions or methods can work normally. It confused me for a few days and I tried to rebuild the indexer and enlarge the indexer space size. But all of them didn’t work a t all. Could any one give me some clues about this question. Thanks a lot.
I can’t reproduce the issue on my side. CTRL+Click will open the declaration correctly.
I think this is probally a eclipse issue and not related to nsight.
Also you can share me the file you use if you want me to try again to reproduce.
Thanks for you reply.
And I think I found the reason why it didn’t jump to the declaration while ctrl+clicking the variable or function. In the .cu file, I defined one variable of the type stl::vector. And after some try, I found if I delete this variable, it can work well. So, I think there maybe some conflict while the indexer parsing the type variable. And now, I changed it with the thrust::host_vector type, and it works well.
Thanks again for you kind reply.
I found a workaround for anyone having the same issue in Nsight 220.127.116.11701130639.
While working with some example project with various namespaces, I found that using the ‘<<’ operator with std::cerr and std::cout broke the Open Declaration functionality.
I only had to replace the statements using that operator with std::cerr.write() and std::cout.write() and opening declarations worked again.