Initial version of JerryScript debugger (#1557)

The debugger supports setting breakpoints, execution control (step, next, continue)
and getting backtrace. The communication is WebSocket-based, so a browser can
communicate with JerryScript without any intermediate application.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
This commit is contained in:
Levente Orban
2017-02-14 15:03:01 +01:00
committed by Tilmann Scheller
parent 453066fcf1
commit 025a99ccbb
39 changed files with 4166 additions and 5 deletions
+35
View File
@@ -19,6 +19,10 @@
#include "ecma-helpers.h"
#include "ecma-lcache.h"
#include "ecma-property-hashmap.h"
#ifdef JERRY_DEBUGGER
#include "jcontext.h"
#include "jerry-debugger.h"
#endif /* JERRY_DEBUGGER */
#include "jrt-bit-fields.h"
#include "byte-code.h"
#include "re-compiler.h"
@@ -1470,6 +1474,37 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
ecma_bytecode_deref (bytecode_literal_p);
}
}
#ifdef JERRY_DEBUGGER
if (JERRY_CONTEXT (jerry_init_flags) & JERRY_INIT_DEBUGGER)
{
if (jerry_debugger_send_function_cp (JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP, bytecode_p))
{
/* Delay the byte code free until the debugger client is notified.
* If the connection is aborted the pointer is still freed by
* jerry_debugger_close_connection(). */
jerry_debugger_byte_code_free_t *byte_code_free_p = (jerry_debugger_byte_code_free_t *) bytecode_p;
jmem_cpointer_t byte_code_free_head = JERRY_CONTEXT (debugger_byte_code_free_head);
byte_code_free_p->prev_cp = ECMA_NULL_POINTER;
byte_code_free_p->next_cp = byte_code_free_head;
JMEM_CP_SET_NON_NULL_POINTER (JERRY_CONTEXT (debugger_byte_code_free_head),
byte_code_free_p);
if (byte_code_free_head != ECMA_NULL_POINTER)
{
jerry_debugger_byte_code_free_t *next_byte_code_free_p;
next_byte_code_free_p = JMEM_CP_GET_NON_NULL_POINTER (jerry_debugger_byte_code_free_t,
byte_code_free_head);
next_byte_code_free_p->prev_cp = JERRY_CONTEXT (debugger_byte_code_free_head);
}
return;
}
}
#endif /* JERRY_DEBUGGER */
}
else
{