Sign in to follow this  

debugging a dll

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this