Skip to content

Commit

Permalink
When suspended on node return, provide position after end of the sour…
Browse files Browse the repository at this point in the history
…ce section. (GR-40940)
  • Loading branch information
entlicher committed Sep 11, 2022
1 parent eadce78 commit 8c770c8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public void testStepping() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"10\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":19,\"lineNumber\":2}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":20,\"lineNumber\":2}," +
"\"url\":\"" + slTestURI + "\"}]}}\n"
));
tester.sendMessage("{\"id\":100,\"method\":\"Debugger.stepOut\"}");
Expand Down Expand Up @@ -537,7 +537,7 @@ public void testBreakpointDeactivation() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"24\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":15,\"lineNumber\":4}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":16,\"lineNumber\":4}," +
"\"url\":\"" + srcURL + "\"}]}}\n"
));
// Deactivate the breakpoints again:
Expand Down Expand Up @@ -903,7 +903,7 @@ public void testNoInternalSources() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"6\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":0,\"lineNumber\":10}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":1,\"lineNumber\":10}," +
"\"url\":\"" + publicSourceURI + "\"}]}}\n"));
tester.sendMessage("{\"id\":51,\"method\":\"Debugger.stepOver\"}");
// at public:1 again (main -> public)
Expand Down Expand Up @@ -995,7 +995,7 @@ public void testNoInternalSources() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"22\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":0,\"lineNumber\":10}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":1,\"lineNumber\":10}," +
"\"url\":\"" + publicSourceURI + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"public\"," +
"\"scopeChain\":[{\"name\":\"public\",\"type\":\"local\",\"object\":{\"description\":\"public\",\"type\":\"object\",\"objectId\":\"23\"}}," +
Expand All @@ -1015,7 +1015,7 @@ public void testNoInternalSources() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"26\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":26,\"lineNumber\":7}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":27,\"lineNumber\":7}," +
"\"url\":\"" + publicSourceURI + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"public\"," +
"\"scopeChain\":[{\"name\":\"public\",\"type\":\"local\",\"object\":{\"description\":\"public\",\"type\":\"object\",\"objectId\":\"27\"}}," +
Expand All @@ -1035,7 +1035,7 @@ public void testNoInternalSources() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"30\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":0,\"lineNumber\":10}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":1,\"lineNumber\":10}," +
"\"url\":\"" + publicSourceURI + "\"}]}}\n"));
tester.sendMessage("{\"id\":13,\"method\":\"Debugger.stepInto\"}");
// No more suspension (we're in internal sources)
Expand Down Expand Up @@ -1294,7 +1294,7 @@ public void testRestartFrame() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"10\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":4}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":27,\"lineNumber\":8}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":28,\"lineNumber\":8}," +
"\"url\":\"" + srcURL + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"factorial\"," +
"\"scopeChain\":[{\"name\":\"factorial\",\"type\":\"local\",\"object\":{\"description\":\"factorial\",\"type\":\"object\",\"objectId\":\"11\"}}," +
Expand All @@ -1319,7 +1319,7 @@ public void testRestartFrame() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"16\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":0}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":13,\"lineNumber\":2}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":14,\"lineNumber\":2}," +
"\"url\":\"" + srcURL + "\"}]}," +
"\"id\":5}\n"));
tester.sendMessage("{\"id\":6,\"method\":\"Debugger.resume\"}");
Expand Down Expand Up @@ -1449,7 +1449,7 @@ public void testReturnValue() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"14\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":10}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":0,\"lineNumber\":12}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":1,\"lineNumber\":12}," +
"\"url\":\"" + slTestURI + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"addThem\"," +
"\"scopeChain\":[{\"name\":\"addThem\",\"type\":\"local\",\"object\":{\"description\":\"addThem\",\"type\":\"object\",\"objectId\":\"15\"}}," +
Expand All @@ -1476,7 +1476,7 @@ public void testReturnValue() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"20\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":4}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":10,\"lineNumber\":5}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":11,\"lineNumber\":5}," +
"\"url\":\"" + slTestURI + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"main\"," +
"\"scopeChain\":[{\"name\":\"main\",\"type\":\"local\",\"object\":{\"description\":\"main\",\"type\":\"object\",\"objectId\":\"21\"}}," +
Expand Down Expand Up @@ -1550,7 +1550,7 @@ public void testReturnValue() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"34\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":4}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":10,\"lineNumber\":6}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":11,\"lineNumber\":6}," +
"\"url\":\"" + slTestURI + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"main\"," +
"\"scopeChain\":[{\"name\":\"main\",\"type\":\"local\",\"object\":{\"description\":\"main\",\"type\":\"object\",\"objectId\":\"35\"}}," +
Expand Down Expand Up @@ -1751,7 +1751,7 @@ public void testThrown() throws Exception {
"{\"name\":\"global\",\"type\":\"global\",\"object\":{\"description\":\"global\",\"type\":\"object\",\"objectId\":\"2\"}}]," +
"\"this\":null," +
"\"functionLocation\":{\"scriptId\":\"1\",\"columnNumber\":9,\"lineNumber\":4}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":11,\"lineNumber\":5}," +
"\"location\":{\"scriptId\":\"1\",\"columnNumber\":12,\"lineNumber\":5}," +
"\"url\":\"" + srcURL + "\"}," +
"{\"callFrameId\":\"1\",\"functionName\":\"main\"," +
"\"scopeChain\":[{\"name\":\"main\",\"type\":\"local\",\"object\":{\"description\":\"main\",\"type\":\"object\",\"objectId\":\"3\"}}," +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CallFrame(DebugStackFrame frame, int depth, Script script, SourceSection
if (anchor == SuspendAnchor.BEFORE) {
this.location = new Location(script.getId(), sourceSection.getStartLine(), sourceSection.getStartColumn());
} else {
this.location = new Location(script.getId(), sourceSection.getEndLine(), sourceSection.getEndColumn());
this.location = new Location(script.getId(), sourceSection.getEndLine(), sourceSection.getEndColumn() + 1);
}
if (functionSourceSection != null) {
this.functionLocation = new Location(script.getId(), functionSourceSection.getStartLine(), functionSourceSection.getStartColumn());
Expand Down
Loading

0 comments on commit 8c770c8

Please sign in to comment.