Tool for debugging Borland & Visual Studio applications
Asked Answered
S

6

13

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

Steere answered 23/9, 2011 at 7:26 Comment(2)
Googling "tds to pdb converter" showed hopeful hits.Overview
Is it possible to compile both parts of your application in Visual C++ or Borland?Bengurion
E
3

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.

Explication answered 26/9, 2011 at 7:34 Comment(2)
is OllyDbg able to load both debugging symbol types?Steere
OllyDbg 2 had some problems when debugging the application so it did not work for me. Perhaps it works for others.Steere
I
2

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

Interfile answered 26/9, 2011 at 12:32 Comment(3)
where can cdb32 be downloaded? google is turning nothing useful up.Bengurion
since it's still in its alpha stage its unavailable yet for free download but I can mail it to you if you wantInterfile
first public beta v 7.3 releasedInterfile
S
1

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.

Scene answered 23/9, 2011 at 17:25 Comment(1)
Thanks, this is a great tip! !:)Autotrophic
V
1

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.

Vespucci answered 27/9, 2011 at 5:44 Comment(0)
I
1

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

Istria answered 28/9, 2011 at 14:37 Comment(0)
E
1

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

Erastus answered 2/10, 2011 at 19:8 Comment(1)
interesting link: openwatcom.org/index.php/Debugging_Format_InteroperabilityErastus

© 2022 - 2024 — McMap. All rights reserved.