Is it possible to communicate with the Visual Stud

2019-01-19 22:37发布

I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger.

This relates to another question of mine on controlling when to break on exceptions.

2条回答
不美不萌又怎样
2楼-- · 2019-01-19 23:12

I know that you can do it with WinDBG and OutputDebugString, but for Visual Studio, I think you have to spool off another process, pipe commands to that, and have that manipulate the Debugger API.

查看更多
孤傲高冷的网名
3楼-- · 2019-01-19 23:17

You can write Visual Studio macros that can do anything the GUI can, but they can get rather involved. See the MSDN documentation on Automation and Extensibility for Visual Studio

Doing this from the code being debugged would be tricky, you would definitely need some new form of communication with VS, maybe a custom add-in. I don't think an independent service would fundamentally help here. The biggest problem is that your code will stop running when the debugger breaks.

查看更多
登录 后发表回答