Skip to content

Fix inserting pending breakpoints. #2163

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

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

zherczeg
Copy link
Member

@zherczeg zherczeg commented Jan 9, 2018

Before this patch the JS execution is started right after the parsing is completed. The problem is that some parts of the JS code is executed before the debugger had any chance to insert pending breakpoints due to network latency. This patch adds a delay after parsing when at least one pendding breakpoint is available.

@zherczeg zherczeg force-pushed the pending_bkpt_fix branch 2 times, most recently from d6e52e3 to bc874cb Compare January 11, 2018 07:09
JERRY_DEBUGGER_WAIT_FOR_SOURCE = 23, /**< engine waiting for a source code */
JERRY_DEBUGGER_OUTPUT_RESULT = 24, /**< output sent by the program to the debugger */
JERRY_DEBUGGER_OUTPUT_RESULT_END = 25, /**< last output result data */
JERRY_DEBUGGER_WAITING_AFTER_PARSE = 13, /**< engine waiting for a parser resume */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to add the enum value here? Can't we just add it to the end of the values? That way we don't need to renumber a lot of values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #2166 should solve this issue.

The problem is that there are message groups, and you cannot break them. The message numbers are not random numbers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, so they are grouped together. I see.

JERRY_DEBUGGER_CLIENT_SOURCE_PART = 7, /**< next message of client source */
JERRY_DEBUGGER_NO_MORE_SOURCES = 8, /**< no more sources notification */
JERRY_DEBUGGER_CONTEXT_RESET = 9, /**< context reset request */
JERRY_DEBUGGER_PARSER_CONFIG = 4, /**< parser config */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: it would be better to have the new values at the end of the existing ones.

/* The following four messages are only available in client switch mode. */
JERRY_DEBUGGER_CLIENT_SOURCE = 8, /**< first message of client source */
JERRY_DEBUGGER_CLIENT_SOURCE_PART = 9, /**< next message of client source */
JERRY_DEBUGGER_NO_MORE_SOURCES = 10, /**< no more sources notification */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: it would be better to have the new values at the end of the existing ones.

Copy link
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

/**
* Set debugger flags.
*/
#define SET_DEBUGGER_FLAGS(flags) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the JERRY_ prefix in this header. Same to CLEAR_DEBUGGER_FLAGS and SET_CLEAR_DEBUGGER_FLAGS

Before this patch the JS execution is started right after the parsing
is completed. The problem is that some parts of the JS code is executed
before the debugger had any chance to insert pending breakpoints due
to network latency. This patch adds a delay after parsing when at least
one pendding breakpoint is available.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zherczeg zherczeg merged commit 1c64c1a into jerryscript-project:master Jan 23, 2018
@zherczeg zherczeg deleted the pending_bkpt_fix branch January 23, 2018 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants