views:

63

answers:

2

I am using VS.NET to attach to a process, the process has a lot of DLL loaded, I built one of the DLL and try to set a breakpoint inside my DLL. I click "New Breakpoint" and type my function name Func_A and checked the "Use Intellisense to verify" box. Then I click OK but the VS.net complains that it can't find the function.

When the process is attached I checked the output of VS.NET, it didn't has a "can't load symbol" message behind my DLL line, so I think it has successfully located my PDB file. I don't know why I can't set the break point.

My project is C# managed project. Note that for all the DLLs, some has debug informations, some don't, but I believe VS.Net has identified my debug informations.

Please suggest other ways to try...

Another question is is there any tool to see the functions that can set breakpoint in an assembly DLL file?

+1  A: 

Could do with some more details really, but here goes...

Do you have the source for the DLL? If so, just open the code and add the breakpoint wherever you want.

If you don't, then you're pretty much relying on Intellisense which isn't always reliable I've found, particularly if managed C++ assemblies are involved. To help, you could look at the DLLs using Reflector to get the full namespaced function name and try that, ignoring Intellisense.

Using reflector will also let you see if the DLL is obfuscated (if 3rd party).

Hope this helps give you some new ideas of how to tackle it.

K

Kev
+1  A: 

If you see a lot of DLLs loaded then it is likely that you are running the debugger in native mode. It is an option in the Tools + Attach to Process dialog, be sure to pick Managed.

By far the easiest way to avoid trouble like this is to load the source code file and set the breakpoint by clicking in the left rail of the editor window. Also, don't use Attach to Process. Use Project + Properties, Debug tab, select "Start external program" and select the .exe that loads your assembly. You can now start debugging by simply pressing F5. Beware that this option is not available in the Express edition.

Hans Passant