Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a code in c++ dll(I am not still aware wat it does)
and there are to application which has attached to this.
But the breakpoints I have given is showing message sysmbols are not loaded.
when I go to Modules to load symbol there is no dll with the c++ dll.
and the other two exe I attached also not in list.

SO basic question is how to debug c++ code in VS 2010
Posted
Comments
Sergey Alexandrovich Kryukov 26-Aug-11 1:39am    
Not clear. Do you have source code? If you do, symbols will be generated for you if you build the project.
--SA
snehalgb 26-Aug-11 5:30am    
hi there i have source code and i am rebuilding it but its not generating symbols. to do it mannually i went to modules abut the dll is not listed in the list.
Eugen Podsypalnikov 26-Aug-11 1:43am    
How is the Dll "attached", please ? :)
snehalgb 26-Aug-11 5:31am    
c++ dll is a code which i need to debug.
Eugen Podsypalnikov 26-Aug-11 5:35am    
Are you
using the LoadLibrary(..) function
or linking the DLL directly ? :)

1 solution

Your question was somewhat hard to understand for me. I will restate it so you can see I understand you correctly (or not). Please let me know if my understanding is wrong on any point:

1. You want to debug a DLL
2. You have the C++ source code for that DLL
3. You are using VS 2010
4. You have two applications (exe files)
5. Both applications use that DLL (call functions from it)
6. You've set Breakpoints in the source code of the DLL, using VS 2010
7. You started one or both of your applications (did you start one or both?)
8. You attached the VS 2010 debugger to an application (did you?)
9. You got a message saying that 'symbols are not loaded' (how? where?)
10. Breakpoints did not work

You furthermore mention a list and that you can't find the applications in it - what list do you mean?

As a general advice I would like to point you to this link: http://msdn.microsoft.com/en-us/library/x54fht41.aspx[^]

Furthermore the error message 'symbols are not loaded' might hint at one of two possible causes:

1. You do not have the symbol file (the *.pdb file or *.dbg for older applications), or VS 2010 can not locate it

2. The DLL is not loaded as a debug version, but as a release version. In that case the symbol information might not be loaded (this depends on compiler settings used to create the release build)

Please check if any of these two is the case.
 
Share this answer
 
Comments
mbue 26-Aug-11 8:59am    
There is another case too (in visual studio 6). I dont know if the problem still exist:
if youre loading a dll (ie: x.dll) that has debug informations, and you load another dll with the same name (x.dll) without debug information (the dll will possibly contain only resources) the debugger will discard all informations from the first dll.
Regards.
snehalgb 29-Aug-11 1:17am    
till point 6 i have done same step. I am running one process whose source code i have the reference get hit and after that it should hit the dll breakpoint as i have attached the main process to it. But it doesnt get hit at all.
I tried with the general link as u gave didnt work at all :(.

@mbue - I am using VS 2010 and there is only one dll.
Stefan_Lang 29-Aug-11 5:43am    
What do you mean when you said 'the general link [...] didn't work at all' ? The link itself works for me, and the website it links to lists a lot of things that you should be able to do. What is your problem?
snehalgb 29-Aug-11 6:27am    
when try to debug application the exe which i have given in project properties ->debugging->command starts. in thta i am refering this dll which will not get hit as the breakpoints i have set are hollow circle with warning 'symbols are not loaded'
Stefan_Lang 29-Aug-11 6:38am    
Ah, I see. There are some possibilities:
1. The executable calls a different version of the DLL than the one you loaded the source code of into VS (unlikely, but possible)
2. The executable calls a version of the DLL that was not built with symbol information. By default the release versions of any project are not built with symbol information, so make sure your exe calls the Debug version!
3. No symbol information was provided or found - make sure the *.pdb file for your DLL exists and can be found (you can copy it to the same folder as your exe to make sure VS finds it)

You can also try this:

Load the project of the DLL into your VS, not the project of your executable.
Then under properties ->debugging->command you enter the path and name of your exe. Then start the debugging session by pressing F5.

This makes sure the symbol information for the DLL is provided and loaded into the debugger.

Of course, this only works if you have not only the source code but also the project files for your DLL.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900