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
Add lexical enviroment for the Debugger #3
Conversation
This patch clearly needs a description about why this is needed. |
0ee6b7a
to
c95a2fe
Compare
Add LEXICAL_ENV option to the build system. JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
4d559b8
to
7cef41d
Compare
@@ -9,6 +9,7 @@ Enum that contains the following elements: | |||
- JERRY_INIT_SHOW_REGEXP_OPCODES - dump regexp byte-code to log after compilation | |||
- JERRY_INIT_MEM_STATS - dump memory statistics | |||
- JERRY_INIT_MEM_STATS_SEPARATE - dump memory statistics and reset peak values after parse | |||
- JERRY_INIT_LEXICAL_ENV - enable the lexical environment for the debugger |
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 should be JERRY_INIT_DEBUGGER, and enables all features required by debugging. Otherwise this would be a too complex api.
@@ -1558,6 +1558,14 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ | |||
parser_stack_push_uint8 (context_p, PARSER_STATEMENT_START); | |||
parser_stack_iterator_init (context_p, &context_p->last_statement); | |||
|
|||
#ifdef DEBUGGER | |||
/* Set lexical enviroment for the debugger*/ | |||
if (JERRY_INIT_LEXICAL_ENV) |
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 is incorrect, you need to test the flag with the & operator. Check other jerry_init_flag_t flags.
@@ -23,6 +23,7 @@ set(FEATURE_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?") | |||
set(FEATURE_VALGRIND OFF CACHE BOOL "Enable Valgrind support?") | |||
set(FEATURE_VALGRIND_FREYA OFF CACHE BOOL "Enable Valgrind-Freya support?") | |||
set(FEATURE_CPOINTER_32_BIT OFF CACHE BOOL "Enable 32 bit compressed pointers?") | |||
set(FEATURE_LEXICAL_ENV OFF CACHE BOOL "Enable lexical environment?") |
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 should not be a build time option. The debugger is the build tiem option.
@@ -1558,6 +1558,14 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ | |||
parser_stack_push_uint8 (context_p, PARSER_STATEMENT_START); | |||
parser_stack_iterator_init (context_p, &context_p->last_statement); | |||
|
|||
#ifdef DEBUGGER |
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.
DEBUGGER should be JERRY_DEBUGGER, since we need to prefix all defines with JERRY_
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
Thanks for the review @zherczeg, I've updated the PR. |
LGTM |
When the debugger is used all lexical environments with all bindings are created. This allows inspecting all bindings runtime.
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu