views:

270

answers:

3

Hi everyone,

Are DIA SDK & DbgEng (Not the DbgHelp) both COM based API and based on DbgHelp?

If so, how can I call DbgEng API from a C# application. I can import the DIA library to C# project using idl file (tlibimp for generated tlib file), but DbgEng doesn't have any IDL file.

I have seen an incomplete wrapper for DbgEng which manually wraps the API using Managed C++, but that misses many of the functions. Can I import DbgEng.DLL in C# automatically without writing any managed wrapper?

Secondly, does DIA SDK allows a process to be attached and memory to be investigated (and possibly evaluate an expression), like DbgEng or it is just to get the symbols from the pdb file? So far only example I got is Dia2dump which only parses the pdb file.

+1  A: 
  1. DIA SDK is only for symbols not debugging it is totality unrelated to DbgHelp.dll
  2. DbgEng.dll have some COM API but only intrfaces you still need to-do some pinvoking to get those interfaces, its better in your case to wrap what you need with Managed C++ or expose it thru COM using C++.
Shay Erlichmen
A: 

It is the other way round -- dbghelp is based on DIA.

Johannes Passing
not true, at least not directly (they may be using the same code base) but you can use DbgHelp on systems without DIA SDK
Shay Erlichmen
It is true that dbghelp.dll does not (dynamically) link against msdia80.dll, but dbghelp either statically links against DIA or uses the same code base: Just compare the output of x msdia80!*Dia* and x dbghelp!*Dia* and see what I mean.
Johannes Passing
A: 

an introduction to DIA and its relation to DbgHelp along with a C++ sample.

marc ochsenmeier

related questions