Add the ability to throw an error to python debugger (#2188)
This patch makes it possible to throw an error from the python debugger client using the `throw` command. JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
committed by
László Langó
parent
79289714dc
commit
8af89d951e
@@ -89,6 +89,8 @@ JERRY_DEBUGGER_FINISH = 15
|
||||
JERRY_DEBUGGER_GET_BACKTRACE = 16
|
||||
JERRY_DEBUGGER_EVAL = 17
|
||||
JERRY_DEBUGGER_EVAL_PART = 18
|
||||
JERRY_DEBUGGER_THROW = 19
|
||||
JERRY_DEBUGGER_THROW_PART = 20
|
||||
|
||||
MAX_BUFFER_SIZE = 128
|
||||
WEBSOCKET_BINARY_FRAME = 2
|
||||
@@ -449,6 +451,8 @@ class DebuggerPrompt(Cmd):
|
||||
|
||||
if message_type == JERRY_DEBUGGER_EVAL:
|
||||
message_type = JERRY_DEBUGGER_EVAL_PART
|
||||
elif message_type == JERRY_DEBUGGER_THROW:
|
||||
message_type = JERRY_DEBUGGER_THROW_PART
|
||||
else:
|
||||
message_type = JERRY_DEBUGGER_CLIENT_SOURCE_PART
|
||||
|
||||
@@ -477,6 +481,10 @@ class DebuggerPrompt(Cmd):
|
||||
|
||||
do_e = do_eval
|
||||
|
||||
def do_throw(self, args):
|
||||
""" Throw an exception """
|
||||
self._send_string(args, JERRY_DEBUGGER_THROW)
|
||||
|
||||
def do_exception(self, args):
|
||||
""" Config the exception handler module """
|
||||
if not args:
|
||||
|
||||
Reference in New Issue
Block a user