debugging a dll

Started by
5 comments, last by Acid-Chris 19 years, 7 months ago
I'm having some problems getting a dll to recognize a break point. The dll is dynamically loaded and a breakpoint is set on a log function, the log is made so I know the line is being executed but it doesn' break...and then it crashes. I've copied the latest dll and pdb into the directory where the application is. I really don't know what else to do, I tried searching the forum and found a couple of results but nothing that helped me. I really don't want to go through every line of that dll, it's already over 2000 lines.
Advertisement
Have a look in the solution properties (I assume you're using MSVS.NET) under "Debug Symbol Files". Try adding in the path to the PDB file in there. Also make sure that everything is indeed being built with debug info.

cheers
sam
I am using MSVS, and that seemed like a great idea, but it had absolutely no affect.
If the DLL is built by a project in the current workspace, just add it to the 'additional DLLs' bit of the Debug config for the main project. It should magically work.

In fact, it may work even if it's not in the current workspace, but that's the only way I've ever done it. Also, this was with VC6, so .NET might be different.
An easy way to stop in the debugger no matter what platform you are on, is to put a "sleep", and connect with debugger. On windows under VC6.0, you'll have to press pause button, on any Unix system, at that point the process pauses.

Than you set your break points, and now the process will stop.

If you don't want to wait for the "sleep" to finish, which gets annoying if you have to reconnect multiple times, than use a stat call, like so:

struct stat st;
while (stat("/tmp/myfile", &st) == 0)
{
sleep (2);
}

Now create the file /tmp/myfile, and the process will run until you delete the file. So you have a lot of time to connect to process, and then once you delete the file you only have 2 seconds to wait to get control.

http://www.mildspring.com - developing android games

or

__asm int 3;

:)

Everything is better with Metal.

Hi.

Why so difficult? If you build your dll within your project, eg. GameCode = DLL, Engine = EXE, just set your dll as "active project" and use your exe as debug-executable. Set the right paths in your debug environment and everything should work fine.

hope it helps.
cu

This topic is closed to new replies.

Advertisement