Skip to content
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

Merged
merged 3 commits into from Oct 31, 2016
Merged

Conversation

polaroi8d
Copy link
Owner

@polaroi8d polaroi8d commented Oct 26, 2016

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

@zherczeg
Copy link

This patch clearly needs a description about why this is needed.

@polaroi8d polaroi8d force-pushed the lexical-env branch 2 times, most recently from 0ee6b7a to c95a2fe Compare October 27, 2016 14:31
Add LEXICAL_ENV option to the build system.

JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
@@ -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

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)

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?")

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

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_

Levente Orban added 2 commits October 28, 2016 10:57
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
@polaroi8d
Copy link
Owner Author

Thanks for the review @zherczeg, I've updated the PR.

@zherczeg
Copy link

LGTM

@polaroi8d polaroi8d merged commit e93f005 into remote-debugger Oct 31, 2016
@polaroi8d polaroi8d deleted the lexical-env branch October 31, 2016 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants