开发者

Tool for debugging Borland & Visual Studio applications

sometimes I have to debug an application that was written with Borland C++ Builder. This application loads dlls compiled with Visual 开发者_JAVA百科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


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.


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


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.


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.


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).


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜