Skip to content

Only one step request allowed per thread error #120

@rotemso

Description

@rotemso

When putting a breakpoint in some java file calling a constructor, and also putting a breakpoint inside the constructor (which is in another java file):
first step over - succeeded and we get 'stopped' event of reason 'breakpoint' as expected as it hit the breakpoint before completing the step operation (stack trace points to the breakpoint location inside the constructor).

With that, a second step over (to the second line in the constructor...) fails and the 'Only one step request allowed per thread' error message is returned.

Reference code:
[Main.java]
Person myPerson = new Person(12,"name1"); [ --> first breakpoint]

[Person.java]
public Person(int age,String name) {
this.name = name; [ --> second breakpoint]
this.age = age;
this.detail = new Detail();
}

Our setup:
We are using the debug.core code (without the plugin wrapping) and providing our own source provider and IDE (not VS Code).
The debugee application is a servlet, if it matters...

Request - Response communication (removed content length for readability):

[stopped at breakpoint - Main.java]

{"event":"stopped","body":{"threadId":15,"reason":"breakpoint","allThreadsStopped":false,"type":"stopped"},"seq":11,"type":"event"}

... [get stack trace, scopes, variables]

[step over request / response]

{"command":"next","type":"request","seq":"48","arguments":{"threadId":15}}

{"success":true,"request_seq":48,"command":"next","seq":53,"type":"response"}

[stopped at breakpoint - Person.java inside constructor]

{"event":"stopped","body":{"threadId":15,"reason":"breakpoint","allThreadsStopped":false,"type":"stopped"},"seq":55,"type":"event"}

... [get stack trace, scopes, variables]

[step over request / response]

{"command":"next","type":"request","seq":"90","arguments":{"threadId":15}}

{"success":false,"message":"Only one step request allowed per thread","request_seq":90,"command":"next","body":{"error":{"id":1000,"format":"Only one step request allowed per thread"}},"seq":97,"type":"response"}

(expected - success 'true' and get stopped event from 'step' reason at Person.java - in second line of constructor)

Exception:
com.sun.jdi.request.DuplicateRequestException: Only one step request allowed per thread
at com.sun.tools.jdi.EventRequestManagerImpl$StepRequestImpl.(EventRequestManagerImpl.java:591)
at com.sun.tools.jdi.EventRequestManagerImpl.createStepRequest(EventRequestManagerImpl.java:759)
at com.microsoft.java.debug.core.DebugUtility.step(DebugUtility.java:236)
at com.microsoft.java.debug.core.DebugUtility.stepOver(DebugUtility.java:201)
at com.microsoft.java.debug.core.adapter.handler.ThreadsRequestHandler.next(ThreadsRequestHandler.java:113)
at com.microsoft.java.debug.core.adapter.handler.ThreadsRequestHandler.handle(ThreadsRequestHandler.java:64)
at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:80)
at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:66)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.processData(AbstractProtocolServer.java:166)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.start(AbstractProtocolServer.java:80)
at com.microsoft.java.debug.core.adapter.ProtocolServer.start(ProtocolServer.java:53)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions