|
-
February 16th, 2011, 02:33 AM
#1
How do I step through the source code of a DLL that is loaded on the fly?
How do I step through the source code of a DLL that is loaded on the fly?
I have a SLN that was automatically created by loading a BIN file into Visual Studio 2008. It uses a command line interface feature and on this command line, I can give a command to load a DLL. The DLL I load has been built from source code. So I should be able to step through this source code.
Do I need to somehow load mdb or somehow tell the Integrated Development Environment how to handle the source code? Currently, I cannot put any breakpoints in the source code.
-
February 16th, 2011, 03:06 AM
#2
Re: How do I step through the source code of a DLL that is loaded on the fly?
You won't be able to step through source code from a compiled binary (a DLL). The best you'll be able to manage is to get disassembly ("decompiling" it and reading the assembly code) or trying to read the (mangled) code with a reflector. To be honest, I have not had significant experience with this. If you're still interested, I might see if I can find, but you might simply try debugging by other means.
Good luck!
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
-
February 16th, 2011, 10:43 AM
#3
Re: How do I step through the source code of a DLL that is loaded on the fly?
 Originally Posted by Complete
How do I step through the source code of a DLL that is loaded on the fly?
I have a SLN that was automatically created by loading a BIN file into Visual Studio 2008. It uses a command line interface feature and on this command line, I can give a command to load a DLL. The DLL I load has been built from source code. So I should be able to step through this source code.
Do I need to somehow load mdb or somehow tell the Integrated Development Environment how to handle the source code? Currently, I cannot put any breakpoints in the source code.
The only way you're going to be able to step through the DLL source-code is to load the source project for the DLL into Visual Studio. If you have both it and the program calling it, put both into a solution and work with it that way. If the executable that calls the DLL is only available as an EXE but the DLL source project is available, you'll be able to "attach" to the EXE once it's running, from the DLL project in the IDE.
-Max
-
February 16th, 2011, 11:24 AM
#4
Re: How do I step through the source code of a DLL that is loaded on the fly?
if you have the dll, and the source code, and the dll was built in debug mode, and you have the debug symbols, you can load the assembly using the Assembly.Load method that takes both the assembly and debug symbol files (*.pdb) and you will be able to step through the dynamically loaded dll just like you do any other dll you link in from visual studio.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|