Borland & 调试工具视觉工作室应用程序

发布于 2024-12-06 06:16:13 字数 217 浏览 0 评论 0原文

有时我必须调试用 Borland C++ Builder 编写的应用程序。该应用程序加载用 Visual C++ 编译的 dll。是否有一个调试器可以调试应用程序的两个部分?目前我必须做出决定 - 要么我可以轻松设置断点并在 Visual Studio 中查看源代码,要么我必须启动 Borland C++,但我无法使用 Visual-Studio 编译的 dll 中的源代码。

感谢您的帮助, 托比亚斯

sometimes I have to debug an application that was written with Borland C++ Builder. This application loads dlls compiled with Visual C++. Is there a debugger that can debug both parts of the application? Currently I have to decide - either I can easily set break points and see the source in Visual Studio or I have to start Borland C++, but I can't work with the source from the Visual-Studio compiled dll.

thank you for your help,
Tobias

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

小帐篷 2024-12-13 06:16:13

你可以尝试 OllyDbg - 版本 1.x 似乎不支持最新的 Win 版本,但也有 2.0尽管它仍处于 alpha 状态(我自己还没有尝试过)。

编辑 - 澄清:

源码调试 OllyDbg读取Borland中的调试信息并
微软格式。此信息包括源代码和名称
函数、标签、全局变量和静态变量。支持动态
(堆栈)变量和结构非常有限。

以上摘自此处

更新:

我不熟悉 Borland C++ Builder,但在 此链接 您可以找到一些文章,解释如何处理 Borland 和 MS 之间的一些互操作性问题,这可能会有所帮助。

You could try OllyDbg - version 1.x does not seem to support the latest Win version but there is also the 2.0 although it's still in alpha state(haven't tried myself that one yet).

EDIT - clarification:

Source debugging OllyDbg reads debugging information in Borland and
Microsoft formats. This information includes source code and names of
functions, labels, global and static variables. Support for dynamical
(stack) variables and structures is very limited.

The above is take from here.

UPDATE:

I'm not familiar with the Borland C++ Builder but at this link you can find some articles explaining how to deal with some interoperability issues between Borland and MS that might be of help.

夜清冷一曲。 2024-12-13 06:16:13

如果两个部分都使用 ulink 链接器构建并具有调试信息,您可以尝试 cdb32 调试器(来自 ulink 链接器作者)

cdb32 仍处于 alpha 阶段,我个人从未尝试过这种“混合”调试

if both parts built using ulink linker and have debug info you could try cdb32 debugger (from the ulink linker author)

cdb32 is still in its alpha stage though and I personally never tried such "mixed" debugging

你不是我要的菜∠ 2024-12-13 06:16:13

您是否尝试过在 VS 中加载 DLL 代码,在 BCB 中加载应用程序代码,并将两个调试器同时附加到同一个正在运行的进程?不确定 Windows 是否允许这样做,但可能值得一试。

Have you tried loading the DLL code in VS, loading the app code in BCB, and having both debuggers attached to the same running process at the same time? Not sure if Windows will allow that, but it might be worth a try.

要走就滚别墨迹 2024-12-13 06:16:13

我怀疑你的问题没有完美的答案,你将不得不以某种方式妥协,正如我确信你已经在做的那样。

我在工作中也遇到了和你类似的问题。我工作的应用程序是用 Python 而不是 Borland C++ 编写的,但与您的情况一样,这些应用程序依赖于相当大的 Visual Studio 编译的 DLL 来实现某些功能。

我调试这些应用程序的方法涉及两种调试策略的组合:使用交互式调试器和所谓的“printf”调试技术。

我基本上所做的就是选择两个区域之一作为我的主要调试焦点,这决定了我的调试方法:

  • 如果对于给定情况,我决定需要更详细地调试 DLL,那么我会使用VS调试器。我将可执行文件设置为在 DLL 项目中作为我的 python 脚本运行,这样就可以对 DLL 代码进行全面调试。如果我需要 Python 端的调试支持,那么我会添加打印语句。如果我需要在 Python 端设置一个断点来检查某些值,我只需打印所有这些值,然后在调用一个不执行任何操作但在 VS 中设置了断点的 C++ 函数后立即打印。

  • 当我需要更多地关注 Python 方面时,我使用 Python 交互式调试器,但是我有 VS 并在侧面加载了 DLL 项目,这样我就可以快速在 DLL 上添加任何必要的 printfs 并重新编译,所以本质上与上面相反。

我知道这不是您期望的答案,但在我看来这是一个不错的解决方案。

I suspect there is no perfect answer to your question, you are going to have to compromise in some way, as I'm sure you are already doing.

I have a similar problem to yours at work. The applications that I work on are written in Python instead of Borland C++, but like your situation, these apps rely on a rather large Visual Studio compiled DLL for some functions.

My method of debugging these applications involves a combination of two debugging strategies: the use of an interactive debugger and the so called "printf" debugging technique.

What I basically do is pick one of the two areas as my main debug focus, and that determines my debugging approach:

  • If for a given situation I decide that I need to debug the DLL with greater detail, then I work with the VS debugger. I set the executable to run in the DLL project as my python script and that enables full debugging of the DLL code. If I need debugging support from the Python side, then I add print statements. If I need a breakpoint on the Python side to inspect some values, I just print all those values and immediately after call a C++ function that does nothing, but that has a breakpoint set in VS.

  • When I need to concentrate more on the Python side more I use a Python interactive debugger, but I have VS with the DLL project loaded on the side so that I can quickly add any necessary printfs on the DLL and recompile, so essentially the reverse of the above.

I know it's not the answer you expect, but it is a decent solution in my opinion.

〃安静 2024-12-13 06:16:13

看来可以将 C++ Builder 生成的调试信息转换为 WinDbg 可以理解的格式(讨论链接)。如果是这样,您可以使用它来调试应用程序的两个部分(不过我还没有尝试过)。

It looks that it is possible to convert the debugging information generated by C++ Builder to a format understood by WinDbg (link to discussion). If so you could use it to debug both parts of your application (I haven't tried this though).

可遇━不可求 2024-12-13 06:16:13

您可以将 .map 文件转换为 Microsoft 的调试文件格式
http://code.google.com/p/map2dbg/

现在您可以使用 Windebug 了;还有一个提到转换为pdb格式的工具,所以你可以尝试vc++调试器

you can convert the .map files to Microsoft's debug file format
http://code.google.com/p/map2dbg/

now you can use Windebug; there is also a tool mentioned to convert to pdb format, so you could try the vc++ debugger

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文