Evaluating expressions using Visual Studio 2005 SDK rather than automation's Debugger::GetExpression

Posted by brone on Stack Overflow See other posts from Stack Overflow or by brone
Published on 2010-02-02T22:38:33Z Indexed on 2010/05/31 8:12 UTC
Read the original article Hit count: 240

I'm looking into writing an addin (or package, if necessary) for Visual Studio 2005 that needs watch window type functionality -- evaluation of expressions and examination of the types. The automation facilities provide Debugger::GetExpression, which is useful enough, but the information provided is a bit crude.

From looking through the docs, it sounds like an IDebugExpressionContext2 would be more useful. With one of these it looks as if I can get more information from an expression -- detailed information about the type and any members and so on and so forth, without having everything come through as strings.

I can't find any way of actually getting a IDebugExpressionContext2, though! IDebugProgramProvider2 sort of looks relevant, in that I could start with IDebugProgramProvider2::GetProviderProcessData and then slowly drill down until reaching something that can supply my expression context -- but I'll need to supply a port to this, and it's not clear how to retrieve the port corresponding to the current debug session. (Even if I tried every port, it's not obvious how to tell which port is the right one...)

I'm becoming suspicious that this simply isn't a supported use case, but with any luck I've simply missed something crashingly obvious.

Can anybody help?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about debugging