microsoft / DbgShell

A PowerShell front-end for the Windows debugger engine.
MIT License
675 stars 89 forks source link

Need some rails to prevent dbgeng-unsupported scenarios like mixed dump + live proc #74

Closed jazzdelightsme closed 5 years ago

jazzdelightsme commented 5 years ago

DbgEng.dll has a concept of "context": what is the current "system", the current process within that system, the current thread within that process, and the current frame within that thread. (See the DbgEngContext class.) DbgShell exposes this via its namespace. It supports switching between contexts, such as between threads, or between multiple processes in a live debugging scenario.

However, some combinations of context just don't work together. For instance, if you are attached to a dump, and then try to launch a new, live process under the debugger, dbgeng context gets completely discombobulated.

DbgShell needs to add some guard rails so that you don't end up in situations that don't work.