Followup changes in JerryScript debugger after #1910.

* Remove 'jerry_debugger_cleaup'. Do it automatically in 'jerry_cleanup'.
* Updated the documentations.
* Updated the NuttX and Artik053 targets.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2017-09-05 10:00:30 +02:00
committed by yichoi
parent a51def40e7
commit a54427e255
12 changed files with 110 additions and 50 deletions
-7
View File
@@ -46,11 +46,4 @@ config JERRYSCRIPT_SHOW_OPCODES
config JERRYSCRIPT_DEBUGGER
bool "Jerryscript debugger"
default n
if JERRYSCRIPT_DEBUGGER
config JERRYSCRIPT_DEBUGGER_PORT
int "Jerryscript debugger port"
default 5001
endif
endif
+1 -2
View File
@@ -19,7 +19,6 @@
CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_JERRYSCRIPT_STACKSIZE ?= 16384
CONFIG_JERRYSCRIPT_HEAPSIZE ?= 107520
CONFIG_JERRY_DEBUGGER_PORT ?= 5001
APPNAME = jerry
# path to the project dir, "jerry-nuttx" by default
@@ -45,7 +44,7 @@ ifeq ($(CONFIG_JERRYSCRIPT_SHOW_OPCODES),y)
endif
ifeq ($(CONFIG_JERRYSCRIPT_DEBUGGER),y)
CFLAGS += -DJERRY_DEBUGGER '-DJERRY_DEBUGGER_PORT=$(CONFIG_JERRY_DEBUGGER_PORT)'
CFLAGS += -DJERRY_DEBUGGER
endif
# Jerryscript
+21 -1
View File
@@ -53,6 +53,7 @@ print_help (char *name)
" --mem-stats-separate\n"
" --show-opcodes\n"
" --start-debug-server\n"
" --debug-server-port [port]\n"
"\n",
name);
} /* print_help */
@@ -357,6 +358,8 @@ int jerry_main (int argc, char *argv[])
const char *file_names[JERRY_MAX_COMMAND_LINE_ARGS];
int i;
int files_counter = 0;
bool start_debug_server = false;
uint16_t debug_port = 5001;
jerry_init_flag_t flags = JERRY_INIT_EMPTY;
@@ -396,7 +399,19 @@ int jerry_main (int argc, char *argv[])
}
else if (!strcmp ("--start-debug-server", argv[i]))
{
flags |= JERRY_INIT_DEBUGGER;
start_debug_server = true;
}
else if (!strcmp ("--debug-server-port", argv[i]))
{
if (++i < argc)
{
debug_port = str_to_uint (argv[i]);
}
else
{
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: wrong format or invalid argument\n");
return JERRY_STANDALONE_EXIT_CODE_FAIL;
}
}
else
{
@@ -406,6 +421,11 @@ int jerry_main (int argc, char *argv[])
jerry_init (flags);
if (start_debug_server)
{
jerry_debugger_init (debug_port);
}
register_js_function ("assert", jerryx_handler_assert);
register_js_function ("gc", jerryx_handler_gc);
register_js_function ("print", jerryx_handler_print);
@@ -46,11 +46,4 @@ config JERRYSCRIPT_SHOW_OPCODES
config JERRYSCRIPT_DEBUGGER
bool "Jerryscript debugger"
default n
if JERRYSCRIPT_DEBUGGER
config JERRYSCRIPT_DEBUGGER_PORT
int "Jerryscript debugger port"
default 5001
endif
endif
@@ -72,7 +72,6 @@ include $(APPDIR)/Make.defs
CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_JERRYSCRIPT_STACKSIZE ?= 32768
CONFIG_JERRYSCRIPT_HEAPSIZE ?= 64000
CONFIG_JERRY_DEBUGGER_PORT ?= 5001
APPNAME = jerry
# path to the project dir, "tizenrt-artik053" by default
@@ -92,7 +91,7 @@ ifeq ($(CONFIG_JERRYSCRIPT_SHOW_OPCODES),y)
endif
ifeq ($(CONFIG_JERRYSCRIPT_DEBUGGER),y)
CFLAGS += -DJERRY_DEBUGGER '-DJERRY_DEBUGGER_PORT=$(CONFIG_JERRY_DEBUGGER_PORT)'
CFLAGS += -DJERRY_DEBUGGER
endif
@@ -333,6 +333,8 @@ jerry_cmd_main (int argc, char *argv[])
const char *file_names[JERRY_MAX_COMMAND_LINE_ARGS];
int i;
int files_counter = 0;
bool start_debug_server = false;
uint16_t debug_port = 5001;
jerry_init_flag_t flags = JERRY_INIT_EMPTY;
@@ -372,7 +374,19 @@ jerry_cmd_main (int argc, char *argv[])
}
else if (!strcmp ("--start-debug-server", argv[i]))
{
flags |= JERRY_INIT_DEBUGGER;
start_debug_server = true;
}
else if (!strcmp ("--debug-server-port", argv[i]))
{
if (++i < argc)
{
debug_port = str_to_uint (argv[i]);
}
else
{
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: wrong format or invalid argument\n");
return JERRY_STANDALONE_EXIT_CODE_FAIL;
}
}
else
{
@@ -382,6 +396,11 @@ jerry_cmd_main (int argc, char *argv[])
jerry_init (flags);
if (start_debug_server)
{
jerry_debugger_init (debug_port);
}
register_js_function ("assert", jerryx_handler_assert);
register_js_function ("gc", jerryx_handler_gc);
register_js_function ("print", jerryx_handler_print);