microsoft / microsoft/ConcordExtensibilitySamples

Is it possible to run certain threads when Debug Engine stopped in "break mode"?

Open
#111 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
135
Forks
54
Avg merge
5h 58m
Merged PRs (30d)
3

Description

I need to continue execution of some threads when debugger stopped on breakpoint.
Something like calling

ContinueDebugEvent(***, ***, DBG_REPLY_LATER)

in the my Concord component. I've tried to call ContinueDebugEvent with DBG_REPLY_LATER flag in the IDkmRuntimeBreakpointNotification.OnRuntimeBreakpoint callback, but of course Concord didn't like that.

In documentation I've found this enum:

DkmStoppingEventProcessingNextAction
    // This status value is used when one or more threads are not at a safe point, so the
    // target process must be slipped. The target process is expected to hit one or more
    // stopping events (breakpoint or exception) in order to indicate that a safe point
    // has been reached.
	SlipTarget = 1,

which is used in the DkmProcess.StoppingEventProcessingContinue function. Looks like exactly what I need, but there's no any other information how to use it.
Can anyone help me with this problem?

Context:
I'm writing my own debugger with C++ and custom scripting language mixed-mode debugging support. Debugger contains two Debug Engines: my own AD7 debug engine (controls scripting language breakpoints, variables, callstack and etc), and standart Visual Studio C++ debug engine (DkmEngineId.NativeEng). They are packed and work together:

DebugLaunchSettings settings;
settings.LaunchDebugEngineGuid = DkmEngineId.NativeEng;
settings.AdditionalDebugEngines.Add(_MyScriptingDebugEngineGuid_);

To interact with scripting language VM (which is hosted inside debugged C++ program) - to set breakpoints / get callstack frames / and other stuff - I use RPC calls from my debugger to the VM service thread.
Everything is working fine. Until I stopped in the native C++ breakpoint. When this happens, all debugged process threads are frozen and I can't communicate with VM...
So, is it possible to continue executing some threads when debugger has stopped at breakpoint?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing DkmProcess.StoppingEventProcessingContinue and DkmStoppingEventProcessingNextAction, then trace the IDkmRuntimeBreakpointNotification.OnRuntimeBreakpoint callback in the two-engine setup described. Done means establishing whether selected threads can run during a native breakpoint and identifying the supported API sequence or documenting that this is not supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.