Recently, I have been studying Delphi 6. dll is used in the code written by my predecessors, and static and dynamic reading is available. The internal debugging method of DLL Code cannot be found during debugging, after trying for a few days, I also referred to a lot of methods on the Internet and finally found them on a foreign language website. Below I will summarize the methods. I would like to sum up the half of the translation. It should be said that 100% can be used for debugging, the following describes the detailed debugging steps for dynamic DLL reading:
DLL program settings:
Run-> pararneters: set local-> Host application to the application that calls the DLL.
Then start to debug the DLL or app
After the Debugging starts, break the point after loadlibrary. Note that
After the breakpoint arrives, view-> debug windows-> modules, right-click your EXE, select Add modules, and select your debug DLL.
At the end of the modules list, find the newly added DLL, right-click the menu, and select reload symbol table ..., select the DLL you have compiled and run it. OK. Then, you can see that the DLL code has been breakpoint debugged.
The debugging method for reading DLL in static mode is similar. When the app is started, it can directly find modules and reload symbol table.
Notes:
First, the DLL output directory should be set to your program running Directory, which is not easy to confuse.
Second, the DLL selected by reload symbol table must be the DLL you output, so that the debugging symbol will be correct.
Now, you are an absolute beginner in Delphi. Thank you for making a brick!
Bored customers
2008.1.15