debugger not hitting the break point in dll
-
2012年4月2日 21:05
I am unable to set a breakpoint in one of my app's regular dlls. Looking at the modules (Break All, then looked at Modules), I see that both the proper dll along with its symbols are loaded. The time stamps are correct. The Output pane says that the dll's symbols are loaded too.
But when I set a breakpoint in the dll and run the app, the breakpoint in the dll gets disabled. Hovering over the breadpoint, it says the symbols are NOT loaded.
I know the dll is working because I can put a dummy trace statement in it and it prints out fine to the Output pane.
How can this be? The problem has to be a setup problem on my part (I didn't write the app and it has been in production a long time), but I can't think of anything else to try. I am using VS2005.
RT
すべての返信
-
2012年4月3日 2:35By any chance is your executable in C# or C++/CLI? If so, you may need to set the Debugger Type (found under Configuration Properties, Debugging) to Native Only, or Mixed.
-
2012年4月3日 13:23The app is all native MFC. No mixed-mode. I'll check out the Debugging property though just to make sure.
RT
-
2012年4月4日 7:14モデレータ
Hello,
Did you forget to set /ASSEMBLYDEBUG option in your DLL project.
Right Click your project->Properties->Configuration properties->Linker->Debugging->Debuggable Assembly, Select Yes (/ASSEMBLYDEBUG)For more information, please check this
http://msdn.microsoft.com/en-us/library/cta4x5hc.aspxBest regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- 回答としてマーク Jesse JiangMicrosoft Contingent Staff, Moderator 2012年4月10日 5:36
- 回答としてマークされていない rtischer8277 2012年4月11日 20:06
-
2012年4月10日 5:36モデレータ
Hi,
I marked my reply as answer, if your issue have not been solved please unmark it and update more information about this issue.
Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
-
2012年4月11日 20:11
I set both the main program and the offending dll to /ASSEMBLYDEBUG, but there was no change. The dll code's breakpoint still claims that no symbols were loaded. The Output pane claims that the dll's "Symbols loaded". The pathname of the loaded dll is correct and is the same dll as is compiled and linked.
Any other ideas? Is this just a VS2005 bug?
RT
-
2012年4月11日 23:52
Check your pdb file setting .Rebuild your solution.
Thanks
Rupesh Shukla
- 編集済み Pintu ShuklaMicrosoft Community Contributor 2012年4月11日 23:52
-
2012年4月12日 18:54
Already added a PostBuild action that copies both the .dll and .pdb into the Debug folder. So, that's not it.
One thing is, the .dll has SQL odbc code in it. Other dlls work and can be breakpoint debugged in the project. Could this have anything to do with it? Also, the project is using VS2005. Maybe there is a known bug with SQL odbc and breakoints in the KB.
RT
-
2012年4月12日 20:19
I thought break point is not working but seems this is a condition with a particular dll . Instead of running exe why not you s dll itself specify the path of executable inside your dll and run your dll . So you can come to know actually what's going on make sure debug setting etc .
Thanks
Rupesh Shukla
-
2012年4月14日 14:52I am inclined at this point to quit and go along with the company's recommendation to just upgrade the compiler to VS10 or VS11.
RT
-
2012年4月25日 14:18
Well, it looks like I need to solve the problem before I get the ok to upgrade the app to VS10 or 11, so I'm back.
I see something in the output pane when I run the program that doesn't look right. Misc32.dll is an example of a file where I can't set a breakpoint when the program is running. Here is the output from the app's output pane on startup:
Does anyone know what the ...Initializing! is doing? It looks like it is initializing a Release version of the file which would explain why I can't set a breakpoint in it.
RT
-
2012年4月25日 14:30
Why not check it out with debug version . As i can see you are running release version so may be a problem of release build . Just change the setting from release to debug and try once again it will def work and if you want to debug release build you have to perform some operation .but before i tell you that just try to use debug build.
Thanks
Rupesh Shukla
-
2012年4月25日 15:07All projects were built in Debug configuration. Where are you seeing that I am running in Release?
RT
-
2012年4月25日 15:41
All projects were built in Debug configuration. Where are you seeing that I am running in Release?
RT
My Bad i read your point that release version getting loaded . Did you tried to run it from your dll . It's quite easy a minute work . because that will solve your problem What build you are running and which is getting load . Inside your dll debug option provide your executable name and try it . One more thing check out whether your dll has dependency on some other dll or not may be there is a chance that due to that it is not hitting your break point
Thanks
Rupesh Shukla
- 編集済み Pintu ShuklaMicrosoft Community Contributor 2012年4月25日 15:42
-
2012年4月26日 22:51
Doing what you suggested (executing the dll with Command arg set), I see that the debug version of the library is getting loaded, but that no symbols were loaded. This would normally tell me that the .pdb file is missing, but I copied that in too. What else could be missing?
RT
-
2012年4月27日 13:40
Doing what you suggested (executing the dll with Command arg set), I see that the debug version of the library is getting loaded, but that no symbols were loaded. This would normally tell me that the .pdb file is missing, but I copied that in too. What else could be missing?
RT
So now you can see when your pdb file is not loaded you can't debug the app. Why not load your pdb file at run time .You can do it by using load symbol==> from Module . Okay second thing did it showed that pdb file is get loaded . because i can't think more possibilities here apart from some path problem . That's why i asked you to load symbol table at run time.
Edit :- i think i missed one very important part . Do you mean to say even when you started running from dll itself at that time even it is not able to load pdb file . In That scenario check out are you generating pdb file on the right path or not.
Thanks
Rupesh Shukla
- 編集済み Pintu ShuklaMicrosoft Community Contributor 2012年4月27日 13:43
-
2012年4月27日 14:13
I looked at the Module and loaded the unloaded symbol table. My .pdb was out of date. It loads properly now, but the module is still not debuggable.
Maybe the problem is something else.
I wrote MyDll and it is callable from the module (CMisc). So, maybe it is the type of call that is making it not work. I noticed that the calls that are not working are all static calls, like:
class AFX_EXT_CLASS CMisc
{
public:
static DWORD SomeFunc(...)
Again, SomeFunc works, but is still not debuggable. Is there some rule I wonder about static functions in extension DLLs not being debuggable? Doesn't make sense.
RT
-
2012年4月27日 14:31
Beging a static function is not the problem. I just made it non-static and it is still not debuggable.
RT
-
2012年4月27日 16:01
Beging a static function is not the problem. I just made it non-static and it is still not debuggable.
RT
I am pretty sure it is not a static function problem .When you said your pdb was out of date this mean something wrong with pdb file .why not delete pdb file and rebuild your solution.if possible can you share your code with me can you zip your solution and send to me .So that i can have a look in that
Thanks
Rupesh Shukla
-
2012年4月27日 17:52
It's not the pdb. Fixed that. All symbols are loading now fine. It's not the static as you say, because I wrote a simple extension dll with a class and a static function. That all works fine. So I now have the same two functions: one that is debuggable and one that is not. That leads me to think that the stdafx.h files must be different. I know that this project was converted to VS 2005 from VC6. The stdafx.h files look quite different. The only thing to do now is confirm (or disprove) the hypoethesis by replacing the old function's stdafx.h with the new one's stdafx.h.
RT
-
2012年4月27日 18:45
Glad you solved the problem still i am not sure how you did that may be dllexport and dllimport problem .check for # define macro too. And i am sorry i was not too helpful in this case
Thanks
Rupesh Shukla
-
2012年4月27日 19:10
Thanks for the tips. They were very helpful. Once I try out the stdafx.h upgrade, I'll report back here as to whether it really did solve the debuggable problem or not.
RT
-
2012年6月5日 14:14
Still having this problem. I have two screen shots that highlight the issue:
The symbols have been added, but not added?
RT
- 編集済み rtischer8277 2012年6月5日 14:15

