pkg/proc: set stop reason for step instruction (#2828)

* service/dap: move presentationHint to frame from source

* pkg/proc: set stop reason for step instruction
This commit is contained in:
Suzy Mueller 2022-01-06 10:01:47 -07:00 committed by GitHub
parent 21bdb466f1
commit 66478f21e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

@ -144,7 +144,7 @@ const (
StopBreakpoint // The target process hit one or more software breakpoints
StopHardcodedBreakpoint // The target process hit a hardcoded breakpoint (for example runtime.Breakpoint())
StopManual // A manual stop was requested
StopNextFinished // The next/step/stepout command terminated
StopNextFinished // The next/step/stepout/stepInstruction command terminated
StopCallReturned // An injected call completed
StopWatchpoint // The target process hit one or more watchpoints
)

@ -457,6 +457,7 @@ func (dbp *Target) StepInstruction() (err error) {
if tg, _ := GetG(thread); tg != nil {
dbp.selectedGoroutine = tg
}
dbp.StopReason = StopNextFinished
return nil
}

@ -4494,7 +4494,10 @@ func TestStepInstruction(t *testing.T) {
// Next instruction.
client.NextInstructionRequest(1)
client.ExpectNextResponse(t)
client.ExpectStoppedEvent(t)
se := client.ExpectStoppedEvent(t)
if se.Body.ThreadId != 1 || se.Body.Reason != "step" {
t.Errorf("\ngot %#v\nwant ThreadId=1 Reason=\"step\"", se)
}
verifyExpectedLocation()
nextPC, err := getPC(t, client, 1)
if err != nil {
@ -4508,7 +4511,10 @@ func TestStepInstruction(t *testing.T) {
pc = nextPC
client.StepInInstructionRequest(1)
client.ExpectStepInResponse(t)
client.ExpectStoppedEvent(t)
se = client.ExpectStoppedEvent(t)
if se.Body.ThreadId != 1 || se.Body.Reason != "step" {
t.Errorf("\ngot %#v\nwant ThreadId=1 Reason=\"step\"", se)
}
verifyExpectedLocation()
nextPC, err = getPC(t, client, 1)
if err != nil {
@ -4522,7 +4528,10 @@ func TestStepInstruction(t *testing.T) {
pc = nextPC
client.StepOutInstructionRequest(1)
client.ExpectStepOutResponse(t)
client.ExpectStoppedEvent(t)
se = client.ExpectStoppedEvent(t)
if se.Body.ThreadId != 1 || se.Body.Reason != "step" {
t.Errorf("\ngot %#v\nwant ThreadId=1 Reason=\"step\"", se)
}
verifyExpectedLocation()
nextPC, err = getPC(t, client, 1)
if err != nil {