简体   繁体   English

监控一个DLL

[英]monitoring a dll

I am working with two programs that make use of the same dll file. 我正在使用两个使用相同dll文件的程序。 Code of the first program is lost, and the second program is what i am writing. 第一个程序的代码丢失了,第二个程序就是我写的。 The dll in question is used as some kind of wrapper dll 有问题的dll用作某种包装器dll

Well the two programs go most of the time fine together. 那么这两个项目大部分时间都很好。 However sometimes there is a conflict, and so the programs halts. 然而,有时会发生冲突,因此程序会停止。 By trial and error i am now convinced that it has something to do with those 2 programs calling this dll (just for the record there is also a third program using the dll but we disabled that program). 通过反复试验,我现在确信它与调用这个dll的那两个程序有关(只是为了记录,还有第三个使用dll的程序,但是我们禁用了该程序)。 It must have something to do with how both programs use the dll. 它必须与两个程序如何使用dll有关。

So i was wondering, is there some tool that would allow me to monitor a dll And show me how it is called; 所以我想知道,是否有一些工具可以让我监控一个dll并告诉我它是如何调用的;
what functions was called; 叫什么功能; showing the parameters; 显示参数; and if it wasnt a void what the returned type and result was. 如果它不是返回的类型和结果的空白。

Normally i would do this through visual studio tracing step by step through the code. 通常我会通过视觉工作室跟踪逐步完成代码。 But since code for the first program (including that dll) got lost. 但是因为第一个程序(包括那个dll)的代码丢失了。 i cannt trace it, i'd like to debug what happens and then if i know the error situation then build something in my new program to prevent this from happening again. 我无法追踪它,我想调试发生的事情,然后如果我知道错误情况,然后在我的新程序中构建一些东西,以防止再次发生这种情况。

If this DLL is a .NET one then you can use .NET Reflector or dotPeek (www.jetbrains.com) to decompile it. 如果此DLL是.NET,那么您可以使用.NET Reflector或dotPeek(www.jetbrains.com)对其进行反编译。 Then you can add your trace code and compile it again. 然后,您可以添加跟踪代码并再次编译。 You can also add trace code by using PostSharp ( http://www.sharpcrafters.com ). 您还可以使用PostSharp( http://www.sharpcrafters.com )添加跟踪代码。

If it's not a .NET dll then you can still debug it using any other assembler debugger ie http://www.ollydbg.de 如果它不是.NET dll,那么你仍然可以使用任何其他汇编程序调试器调试它,即http://www.ollydbg.de

If you have the source code, and the .pdb files in your BIN directory, then you can debug through that code. 如果您的BIN目录中有源代码和.pdb文件,那么您可以通过该代码进行调试。 However, You will need to enable external code debugging in Visual Studio. 但是,您需要在Visual Studio中启用外部代码调试。

You can then check on the dll in the menu Debug--> Windows --> Modules. 然后,您可以在菜单Debug - > Windows - > Modules中检查dll。

Navigate to the dll and see if there are any issues with the symbol file. 导航到dll,查看符号文件是否有任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM