-
Couldn't load subscription status.
- Fork 728
fix debug thread not create issue #983
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,9 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, | |
| the actual main function. Directly calling main function | ||
| may cause exception thrown. */ | ||
| if ((func = wasm_runtime_lookup_wasi_start_function(module_inst))) { | ||
| #if WASM_ENABLE_DEBUG_INTERP != 0 | ||
| wasm_runtime_start_debug_instance(exec_env); | ||
| #endif | ||
| return wasm_runtime_call_wasm(exec_env, func, 0, NULL); | ||
| } | ||
| #endif /* end of WASM_ENABLE_LIBC_WASI */ | ||
|
|
@@ -186,6 +189,10 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, | |
| (uint32)wasm_runtime_addr_native_to_app(module_inst, argv_offsets); | ||
| } | ||
|
|
||
| #if WASM_ENABLE_DEBUG_INTERP != 0 | ||
| wasm_runtime_start_debug_instance(exec_env); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| #endif | ||
|
|
||
| ret = wasm_runtime_call_wasm(exec_env, func, argc1, argv1); | ||
| if (ret && func_type->result_count > 0 && argc > 0 && argv) | ||
| /* copy the return value */ | ||
|
|
@@ -570,6 +577,10 @@ wasm_application_execute_func(WASMModuleInstanceCommon *module_inst, | |
| goto fail; | ||
| } | ||
|
|
||
| #if WASM_ENABLE_DEBUG_INTERP != 0 | ||
| wasm_runtime_start_debug_instance(exec_env); | ||
| #endif | ||
|
|
||
| if (!wasm_runtime_call_wasm(exec_env, target_func, argc1, argv1)) { | ||
| goto fail; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should check the return value?
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.
And after the following wasm_runtime_call_wasm, shall we destroy the debug instance?
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 API return the actual bind port number, or 0 if the debug instance not created. We don't check the return value here, because when user execute iwasm w/o
-g={ip}:{port}, the API will return 0, but we still want the program to be executedThere 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.
We don't need to destroy the debug instance, it will be automatically destroyed when the corresponding cluster is destroyed.