aboutsummaryrefslogtreecommitdiff
path: root/jerry-debugger
diff options
context:
space:
mode:
authorImre Kiss <kissi@inf.u-szeged.hu>2017-05-19 14:38:19 +0200
committerZoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>2017-05-19 14:38:19 +0200
commit833796a20ff1effdaf90369f30914e8750efcf56 (patch)
treed6f92e0bc07901b77a2779b04dfeb20653563a71 /jerry-debugger
parentffdf151387dbb2939760f7b3ac5e3ae09e0a0675 (diff)
Fix the getBreakpoint() function in the HTML Debugger client. (#1839)
There was a problem around the offset, the function tried to use some invalid object reference. JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
Diffstat (limited to 'jerry-debugger')
-rw-r--r--jerry-debugger/jerry-client-ws.html48
1 files changed, 24 insertions, 24 deletions
diff --git a/jerry-debugger/jerry-client-ws.html b/jerry-debugger/jerry-client-ws.html
index fb3c224e..d0c609cd 100644
--- a/jerry-debugger/jerry-client-ws.html
+++ b/jerry-debugger/jerry-client-ws.html
@@ -520,37 +520,37 @@ function DebuggerClient(address)
function getBreakpoint(breakpointData)
{
- var returnValue = {};
- var func = functions[breakpointData[0]];
- var offset = breakpointData[1];
+ var returnValue = {};
+ var func = functions[breakpointData[0]];
+ var offset = breakpointData[1];
- if (offset in functions)
- {
- returnValue.breakpoint = func.offsets[offset];
- returnValue.at = true;
- return returnValue;
- }
+ if (offset in func.offsets)
+ {
+ returnValue.breakpoint = func.offsets[offset];
+ returnValue.at = true;
+ return returnValue;
+ }
- if (offset < functions.firstBreakpointOffset)
- {
- returnValue.breakpoint = func.offsets[firstBreakpointOffset];
- returnValue.at = true;
- return returnValue;
- }
+ if (offset < func.firstBreakpointOffset)
+ {
+ returnValue.breakpoint = func.offsets[func.firstBreakpointOffset];
+ returnValue.at = true;
+ return returnValue;
+ }
- nearest_offset = -1;
+ nearest_offset = -1;
- for (var current_offset in func.offsets)
+ for (var current_offset in func.offsets)
+ {
+ if ((current_offset <= offset) && (current_offset > nearest_offset))
{
- if ((current_offset <= offset) && (current_offset > nearest_offset))
- {
- nearest_offset = current_offset;
- }
+ nearest_offset = current_offset;
}
+ }
- returnValue.breakpoint = func.offsets[nearest_offset];
- returnValue.at = false;
- return returnValue;
+ returnValue.breakpoint = func.offsets[nearest_offset];
+ returnValue.at = false;
+ return returnValue;
}
this.encodeMessage = encodeMessage;