从C#应用程序调试VC ++代码 [英] Debug VC++ code from C# application

查看:76
本文介绍了从C#应用程序调试VC ++代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有C#应用程序引用VC ++ dll。

引用是通过接口(Interop.some.dll)



我必须通过运行C#应用程序调试VC ++代码我该如何实现呢?



我无法从VC ++代码附加进程,因为C#代码引用了Interop.Some。 dll因此它不会打扰调用VC ++代码.... !!!

I have C# application which is referencing VC++ dll.
The reference is through interface(Interop.some.dll)

I have to debug the VC++ code by running C# application how do i achieve this?

I cannot attach the process from VC++ code because the C# code is referencing Interop.Some.dll and hence it will not bother to call the VC++ code....!!!

推荐答案

简答:你不能。

因为说法技术人员不问,而且请求没有技能的人适用。一个简单的技巧不足以为你提供技能。



长答案:

1)你可以轻松地使用你的调试器调用dll时分析参数和结果的C#代码。这是你的能力范围。



2)如果你有dll的源代码,最简单的调试方法是制作一个不会的测试床被包含在最后的dll中。这个测试床是你用来调试dll的地方。



3)如果你没有源代码,你可以随时调试机器代码但它需要先进的调试技巧,只有经验会给你技能,这种技能只有通过了解你的失败才能获得。



对于案例3,我建议使用简单参数和结果的函数构建一个虚拟dll,并查看它在debuger上的外观。
Short answer: you can't.
Because the saying The one skilled don't ask, and the one who ask don't have skills to do it applies. A simply trick will not be enough to give you the skills.

Long answer:
1) You can easily use the debugger in your C# code to analyse arguments and results when you call the dll. this is within your reach.

2) If you have the source code for the dll, the easiest way to debug it, is to make a test bed that will not be included in the final dll. This test bed is the place you use to debug what will be the dll.

3) if you don't have source code, you can always debug the machine code but it require advanced skills in debugging, and only experience will give you the skills, this kind of skills is only gained by learning of your failures.

For case 3, I recommend to build a dummy dll with functions that use simple arguments and results and see how it look on debuger.


这篇关于从C#应用程序调试VC ++代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆