-
Notifications
You must be signed in to change notification settings - Fork 684
Add eval support for JerryScript debugger #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
print(message) | ||
|
||
prompt.cmdloop() | ||
|
||
else: | ||
raise Exception("Unknown message") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line and of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"and of the file" - not really understand this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at end of file* 😈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't get it, the file does not end there.
jerry-debugger/jerry-client-ws.py
Outdated
ord(result[1]) != 4 or | ||
ord(result[2]) != JERRY_DEBUGGER_CONFIGURATION): | ||
raise Exception("Unexpected configuration") | ||
ord(result[1]) != 4 or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This format is for the PEP8 style guide.
jerry-debugger/jerry-client-ws.py
Outdated
# 1: length of type byte | ||
# 4: length of an uint32 value | ||
message_header = 1 + 4 | ||
max_fragment = min (self.debugger.max_message_size - message_header, size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No white space before the '('.
tests/debugger/do_eval.expected
Outdated
@@ -0,0 +1,14 @@ | |||
Address setup: localhost:5001 | |||
Stopped at /home/hzoli/SamsungJS/Jerry/tests/debugger/do_eval.js:15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hzoli/..?
jerry-debugger/jerry-client-ws.html
Outdated
|
||
if (message[0] == JERRY_DEBUGGER_EVAL_ERROR_END) | ||
{ | ||
appendLog("ERROR: " + cesu8ToString(evalResult)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using "Uncaught: " here, and just going with to_string
in case of error objects where you send the result? It would also signal that the thrown value is an object, and not just a thrown string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the error message processing looks like this:
if (is_object(result))
if (has_message_property(as_object(result)))
send(as_object(result).message)
else
send(get_class_name(object))
else
send(to_string(result))
My problem was with to_string is that it can throw another error...
jerry-debugger/jerry-client-ws.py
Outdated
raise Exception("Eval result expected") | ||
|
||
if buffer_type == JERRY_DEBUGGER_EVAL_ERROR_END: | ||
print("ERROR: %s" % (message)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And same here?
The server can accept a string, execute it with eval, and returns with the result converted to string. In case of exception it returns with the exception message. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.