From 778a46874952de72534a0930b2043ba5bb02b61c Mon Sep 17 00:00:00 2001 From: oh_ci Date: Mon, 30 Jun 2025 08:13:47 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!1160=20?= =?UTF-8?q?:=20add=201.2=20Debugger'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BUILD.gn | 12 +- build/core/gn/BUILD.gn | 6 +- inspector/BUILD.gn | 2 +- inspector/connect_inspector.cpp | 2 +- inspector/inspector.cpp | 25 +- inspector/test/BUILD.gn | 2 +- .../BUILD.gn | 2 +- ...pprofileraddinspectedheapobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../heapprofilercollectgarbage_fuzzer.cpp | 2 +- .../heapprofilerdisable_fuzzer/BUILD.gn | 2 +- .../heapprofilerdisable_fuzzer.cpp | 2 +- .../heapprofilerdispatch_fuzzer/BUILD.gn | 2 +- .../heapprofilerdispatch_fuzzer.cpp | 2 +- .../heapprofilerenable_fuzzer/BUILD.gn | 2 +- .../heapprofilerenable_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../heapprofilergetheapobjectid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...profilergetobjectbyheapobjectid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../heapprofilergetsamplingprofile_fuzzer.cpp | 2 +- .../heapprofilerstartsampling_fuzzer/BUILD.gn | 2 +- .../heapprofilerstartsampling_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...rofilerstarttrackingheapobjects_fuzzer.cpp | 2 +- .../heapprofilerstopsampling_fuzzer/BUILD.gn | 2 +- .../heapprofilerstopsampling_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...profilerstoptrackingheapobjects_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../heapprofilertakeheapsnapshot_fuzzer.cpp | 2 +- .../backend/backendbreakpoint_fuzzer/BUILD.gn | 2 +- .../backendbreakpoint_fuzzer.cpp | 2 +- .../backend/backendexception_fuzzer/BUILD.gn | 2 +- .../backendexception_fuzzer.cpp | 2 +- .../backend/backendloadmodule_fuzzer/BUILD.gn | 2 +- .../backendloadmodule_fuzzer.cpp | 2 +- .../backendnativecalling_fuzzer/BUILD.gn | 2 +- .../backendnativecalling_fuzzer.cpp | 2 +- .../backend/backendsinglestep_fuzzer/BUILD.gn | 2 +- .../backendsinglestep_fuzzer.cpp | 2 +- .../baseptbase64decode_fuzzer/BUILD.gn | 2 +- .../baseptbase64decode_fuzzer.cpp | 4 +- .../baseptbase64encode_fuzzer/BUILD.gn | 2 +- .../baseptbase64encode_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- ...aseptsbreakpointgetbreakpointid_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptsbreakpointgetlocation_fuzzer.cpp | 4 +- .../baseptsbreakpointgetname_fuzzer/BUILD.gn | 2 +- .../baseptsbreakpointgetname_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- ...aseptsbreakpointsetbreakpointid_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptsbreakpointsetlocation_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedgetcallframes_fuzzer.cpp | 4 +- .../baseptspausedgetdata_fuzzer/BUILD.gn | 2 +- .../baseptspausedgetdata_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedgethitbreakpoints_fuzzer.cpp | 4 +- .../baseptspausedgetname_fuzzer/BUILD.gn | 2 +- .../baseptspausedgetname_fuzzer.cpp | 4 +- .../baseptspausedgetreason_fuzzer/BUILD.gn | 2 +- .../baseptspausedgetreason_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedgetreasonstring_fuzzer.cpp | 4 +- .../baseptspausedhasdata_fuzzer/BUILD.gn | 2 +- .../baseptspausedhasdata_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedhashitbreakpoints_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedsetcallframes_fuzzer.cpp | 4 +- .../baseptspausedsetdata_fuzzer/BUILD.gn | 2 +- .../baseptspausedsetdata_fuzzer.cpp | 4 +- .../BUILD.gn | 2 +- .../baseptspausedsethitbreakpoints_fuzzer.cpp | 4 +- .../baseptspausedsetreason_fuzzer/BUILD.gn | 2 +- .../baseptspausedsetreason_fuzzer.cpp | 4 +- .../connectserversendmessage_fuzzer/BUILD.gn | 2 +- .../BUILD.gn | 2 +- .../dispatchresponsecreatecode_fuzzer.cpp | 2 +- .../dispatchprotocolmessage_fuzzer/BUILD.gn | 2 +- .../dispatchprotocolmessage_fuzzer.cpp | 2 +- .../initializedebugger_fuzzer/BUILD.gn | 2 +- .../initializedebugger_fuzzer.cpp | 2 +- test/fuzztest/protocolhandler_fuzzer/BUILD.gn | 2 +- .../protocolhandler_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...protocolhandlercreateerrorreply_fuzzer.cpp | 2 +- .../protocolhandlerdispatch_fuzzer/BUILD.gn | 2 +- .../protocolhandlerdispatch_fuzzer.cpp | 2 +- .../protocolhandlerget_fuzzer/BUILD.gn | 2 +- .../protocolhandlerget_fuzzer.cpp | 2 +- .../protocolhandlernotif_fuzzer/BUILD.gn | 2 +- .../protocolhandlernotif_fuzzer.cpp | 2 +- .../protocolhandlerprocess_fuzzer/BUILD.gn | 2 +- .../protocolhandlerprocess_fuzzer.cpp | 2 +- .../protocolhandlerresponse_fuzzer/BUILD.gn | 2 +- .../protocolhandlerresponse_fuzzer.cpp | 2 +- .../protocolhandlerrun_fuzzer/BUILD.gn | 2 +- .../protocolhandlerrun_fuzzer.cpp | 2 +- .../protocolhandlersendreply_fuzzer/BUILD.gn | 2 +- .../protocolhandlersendreply_fuzzer.cpp | 2 +- .../protocolhandlerwait_fuzzer/BUILD.gn | 2 +- .../protocolhandlerwait_fuzzer.cpp | 2 +- .../pttypesbreakpointparseid_fuzzer/BUILD.gn | 2 +- .../pttypesbreakpointparseid_fuzzer.cpp | 2 +- .../pttypesbreakpointtostring_fuzzer/BUILD.gn | 2 +- .../pttypesbreakpointtostring_fuzzer.cpp | 2 +- .../pttypesexceptiondetails_fuzzer/BUILD.gn | 2 +- .../pttypesexceptiondetails_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailscolumn_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailscreate_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...ttypesexceptiondetailsexception_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...ypesexceptiondetailsexceptionid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...eptiondetailsexecutioncontextid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailsline_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesexceptiondetailsscriptid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailstext_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailstojson_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesexceptiondetailsurl_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesfunctionremoteobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...esgeneratorfunctionremoteobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesinternalpropertydesp_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...typesinternalpropertydespcreate_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesinternalpropertydespname_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...typesinternalpropertydesptojson_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...ttypesinternalpropertydespvalue_fuzzer.cpp | 2 +- .../pttypesobjectremoteobject_fuzzer/BUILD.gn | 2 +- .../pttypesobjectremoteobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesprimitiveremoteobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesprivatepropertydesp_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...ttypesprivatepropertydespcreate_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesprivatepropertydespget_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesprivatepropertydespname_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesprivatepropertydespset_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...ttypesprivatepropertydesptojson_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesprivatepropertydespvalue_fuzzer.cpp | 2 +- .../pttypesremoteobject_fuzzer/BUILD.gn | 2 +- .../pttypesremoteobject_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectdescription_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesremoteobjectgetclassname_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectgetsubtype_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectgettype_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectgetvalue_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesremoteobjecthasclassname_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjecthassubtype_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectobjectid_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...pttypesremoteobjectsetclassname_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectsetsubtype_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectsettype_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- .../pttypesremoteobjectsetvalue_fuzzer.cpp | 2 +- .../BUILD.gn | 2 +- ...remoteobjectunserializablevalue_fuzzer.cpp | 2 +- .../pttypesstringremoteobject_fuzzer/BUILD.gn | 2 +- .../pttypesstringremoteobject_fuzzer.cpp | 2 +- .../pttypessymbolremoteobject_fuzzer/BUILD.gn | 2 +- .../pttypessymbolremoteobject_fuzzer.cpp | 2 +- .../wsserversendreply_fuzzer/BUILD.gn | 2 +- test/resource/tooling/ohos_test.xml | 174 +-- tooling/BUILD.gn | 162 ++- .../{dynamic => }/agent/animation_impl.cpp | 0 tooling/{dynamic => }/agent/animation_impl.h | 0 tooling/{dynamic => }/agent/css_impl.cpp | 0 tooling/{dynamic => }/agent/css_impl.h | 0 tooling/{dynamic => }/agent/debugger_impl.cpp | 2 +- tooling/{dynamic => }/agent/debugger_impl.h | 2 +- tooling/{dynamic => }/agent/dom_impl.cpp | 0 tooling/{dynamic => }/agent/dom_impl.h | 0 .../{dynamic => }/agent/heapprofiler_impl.cpp | 0 .../{dynamic => }/agent/heapprofiler_impl.h | 6 +- tooling/{dynamic => }/agent/overlay_impl.cpp | 0 tooling/{dynamic => }/agent/overlay_impl.h | 0 tooling/{dynamic => }/agent/page_impl.cpp | 0 tooling/{dynamic => }/agent/page_impl.h | 0 tooling/{dynamic => }/agent/profiler_impl.cpp | 0 tooling/{dynamic => }/agent/profiler_impl.h | 4 +- tooling/{dynamic => }/agent/runtime_impl.cpp | 0 tooling/{dynamic => }/agent/runtime_impl.h | 2 +- tooling/{dynamic => }/agent/target_impl.cpp | 0 tooling/{dynamic => }/agent/target_impl.h | 0 tooling/{dynamic => }/agent/tracing_impl.cpp | 0 tooling/{dynamic => }/agent/tracing_impl.h | 4 +- .../backend/debugger_executor.cpp | 2 +- .../{dynamic => }/backend/debugger_executor.h | 0 tooling/{dynamic => }/backend/js_pt_hooks.cpp | 0 tooling/{dynamic => }/backend/js_pt_hooks.h | 4 +- .../backend/js_single_stepper.cpp | 0 .../{dynamic => }/backend/js_single_stepper.h | 0 tooling/{dynamic => }/base/pt_base64.cpp | 2 +- tooling/{dynamic => }/base/pt_base64.h | 0 tooling/{dynamic => }/base/pt_events.cpp | 2 +- tooling/{dynamic => }/base/pt_events.h | 4 +- tooling/{dynamic => }/base/pt_json.cpp | 2 +- tooling/{dynamic => }/base/pt_json.h | 0 tooling/{dynamic => }/base/pt_params.cpp | 2 +- tooling/{dynamic => }/base/pt_params.h | 2 +- tooling/{dynamic => }/base/pt_returns.cpp | 2 +- tooling/{dynamic => }/base/pt_returns.h | 2 +- tooling/{dynamic => }/base/pt_script.cpp | 2 +- tooling/{dynamic => }/base/pt_script.h | 2 +- tooling/{dynamic => }/base/pt_types.cpp | 2 +- tooling/{dynamic => }/base/pt_types.h | 4 +- tooling/{dynamic => }/client/BUILD.gn | 12 +- tooling/{dynamic => }/client/ark_cli/BUILD.gn | 13 +- tooling/{dynamic => }/client/ark_cli/main.cpp | 4 +- .../{dynamic => }/client/ark_multi/BUILD.gn | 2 +- .../{dynamic => }/client/ark_multi/ReadMe.md | 0 .../client/ark_multi/ReadMe_Zh.md | 0 .../{dynamic => }/client/ark_multi/main.cpp | 2 +- .../client/domain/debugger_client.cpp | 4 +- .../client/domain/debugger_client.h | 2 +- .../client/domain/heapprofiler_client.cpp | 4 +- .../client/domain/heapprofiler_client.h | 2 +- .../client/domain/profiler_client.cpp | 4 +- .../client/domain/profiler_client.h | 2 +- .../client/domain/runtime_client.cpp | 4 +- .../client/domain/runtime_client.h | 2 +- .../client/domain/test_client.cpp | 4 +- .../{dynamic => }/client/domain/test_client.h | 2 +- .../client/manager/breakpoint_manager.cpp | 4 +- .../client/manager/breakpoint_manager.h | 4 +- .../client/manager/domain_manager.cpp | 2 +- .../client/manager/domain_manager.h | 10 +- .../client/manager/message_manager.h | 0 .../client/manager/source_manager.cpp | 4 +- .../client/manager/source_manager.h | 4 +- .../client/manager/stack_manager.cpp | 2 +- .../client/manager/stack_manager.h | 4 +- .../client/manager/variable_manager.cpp | 2 +- .../client/manager/variable_manager.h | 8 +- .../client/manager/watch_manager.cpp | 4 +- .../client/manager/watch_manager.h | 6 +- .../{dynamic => }/client/session/session.cpp | 4 +- .../{dynamic => }/client/session/session.h | 12 +- .../client/tcpServer/tcp_server.cpp | 4 +- .../client/tcpServer/tcp_server.h | 0 .../client/tcpServer/test/config.py | 0 .../client/tcpServer/test/js_test_base.py | 0 .../tcpServer/test/js_test_case/__init__.py | 0 .../tcpServer/test/js_test_case/js_test.py | 0 .../client/tcpServer/test/runtest.py | 0 .../client/utils/cli_command.cpp | 2 +- .../{dynamic => }/client/utils/cli_command.h | 10 +- tooling/{dynamic => }/debugger_service.cpp | 0 tooling/{dynamic => }/debugger_service.h | 0 tooling/{dynamic => }/dispatcher.cpp | 0 tooling/{dynamic => }/dispatcher.h | 2 +- tooling/dynamic/BUILD.gn | 180 --- tooling/{dynamic => }/protocol_channel.h | 4 +- tooling/{dynamic => }/protocol_handler.cpp | 0 tooling/{dynamic => }/protocol_handler.h | 0 tooling/static/BUILD.gn | 75 -- tooling/static/CMakeLists.txt | 135 --- tooling/static/common.h | 25 - tooling/static/connection/asio/asio_config.h | 43 - .../static/connection/asio/asio_server.cpp | 182 --- tooling/static/connection/asio/asio_server.h | 46 - .../connection/asio/server_endpoint-inl.h | 67 -- .../static/connection/asio/server_endpoint.h | 75 -- tooling/static/connection/asio/ws_logger.cpp | 89 -- tooling/static/connection/asio/ws_logger.h | 60 - tooling/static/connection/endpoint_base.cpp | 104 -- tooling/static/connection/endpoint_base.h | 118 -- tooling/static/connection/event_loop.cpp | 35 - tooling/static/connection/event_loop.h | 53 - .../connection/ohos_ws/ohos_ws_server.cpp | 94 -- .../connection/ohos_ws/ohos_ws_server.h | 41 - .../ohos_ws/ohos_ws_server_endpoint.cpp | 31 - .../ohos_ws/ohos_ws_server_endpoint.h | 50 - tooling/static/connection/server.h | 66 - .../connection/server_endpoint_base.cpp | 63 - .../static/connection/server_endpoint_base.h | 62 - tooling/static/debugger/breakpoint.cpp | 69 -- tooling/static/debugger/breakpoint.h | 80 -- tooling/static/debugger/breakpoint_base.h | 113 -- .../static/debugger/breakpoint_storage.cpp | 147 --- tooling/static/debugger/breakpoint_storage.h | 107 -- .../debugger/conditional_breakpoint.cpp | 97 -- .../static/debugger/conditional_breakpoint.h | 67 -- tooling/static/debugger/debug_info_cache.cpp | 422 ------- tooling/static/debugger/debug_info_cache.h | 112 -- tooling/static/debugger/debuggable_thread.cpp | 289 ----- tooling/static/debugger/debuggable_thread.h | 149 --- tooling/static/debugger/object_repository.cpp | 222 ---- tooling/static/debugger/object_repository.h | 65 - tooling/static/debugger/thread_state.cpp | 247 ---- tooling/static/debugger/thread_state.h | 131 -- tooling/static/debugger_arkapi.cpp | 88 -- tooling/static/debugger_arkapi.h | 43 - tooling/static/error.cpp | 29 - tooling/static/error.h | 27 - tooling/static/evaluation/base64.h | 151 --- .../static/evaluation/evaluation_engine.cpp | 51 - tooling/static/evaluation/evaluation_engine.h | 81 -- tooling/static/init.cpp | 106 -- tooling/static/inspector.cpp | 819 ------------- tooling/static/inspector.h | 179 --- tooling/static/inspector_server.cpp | 1072 ----------------- tooling/static/inspector_server.h | 159 --- .../static/json_serialization/jrpc_error.cpp | 28 - .../static/json_serialization/jrpc_error.h | 60 - .../static/json_serialization/serializable.h | 47 - tooling/static/session_manager.cpp | 66 - tooling/static/session_manager.h | 44 - tooling/static/source_manager.cpp | 53 - tooling/static/source_manager.h | 50 - tooling/static/tests/base64.cpp | 58 - tooling/static/tests/common.h | 40 - tooling/static/tests/debug_info_cache.cpp | 206 ---- tooling/static/tests/inspector_server.cpp | 910 -------------- tooling/static/tests/json_object_matcher.cpp | 44 - tooling/static/tests/json_object_matcher.h | 238 ---- tooling/static/tests/object_repository.cpp | 212 ---- tooling/static/tests/session_manager.cpp | 111 -- tooling/static/tests/source_manager.cpp | 96 -- tooling/static/tests/test_frame.h | 170 --- tooling/static/tests/thread_state.cpp | 198 --- .../types/custom_url_breakpoint_response.cpp | 41 - .../types/custom_url_breakpoint_response.h | 92 -- .../debugger_call_function_on_request.cpp | 57 - .../types/debugger_call_function_on_request.h | 78 -- .../types/debugger_evaluation_request.cpp | 58 - .../types/debugger_evaluation_request.h | 64 - tooling/static/types/evaluation_result.h | 56 - tooling/static/types/exception_details.cpp | 43 - tooling/static/types/exception_details.h | 138 --- tooling/static/types/location.cpp | 60 - tooling/static/types/location.h | 78 -- tooling/static/types/numeric_id.h | 70 -- tooling/static/types/object_preview.cpp | 98 -- tooling/static/types/object_preview.h | 42 - .../static/types/pause_on_exceptions_state.h | 23 - .../types/possible_breakpoints_response.h | 49 - tooling/static/types/profile_result.cpp | 105 -- tooling/static/types/profile_result.h | 43 - tooling/static/types/property_descriptor.h | 138 --- tooling/static/types/property_preview.h | 55 - tooling/static/types/remote_object.cpp | 161 --- tooling/static/types/remote_object.h | 154 --- tooling/static/types/remote_object_type.h | 87 -- tooling/static/types/scope.cpp | 47 - tooling/static/types/scope.h | 45 - tooling/static/types/script_source_response.h | 47 - .../static/types/url_breakpoint_request.cpp | 52 - tooling/static/types/url_breakpoint_request.h | 72 -- .../static/types/url_breakpoint_response.cpp | 44 - .../static/types/url_breakpoint_response.h | 82 -- tooling/{dynamic => }/test/BUILD.gn | 13 +- .../test/animation_impl_test.cpp | 0 .../test/client_utils/test_actions.h | 0 .../test/client_utils/test_list.cpp | 112 +- .../test/client_utils/test_list.h | 0 .../test/client_utils/test_util.cpp | 10 +- .../test/client_utils/test_util.h | 8 +- .../test/debugger_cint_client_test.cpp | 4 +- .../test/debugger_cinterp_test.cpp | 2 +- .../test/debugger_client_test.cpp | 4 +- .../test/debugger_commands_test.cpp | 4 +- .../test/debugger_entry_test.cpp | 2 +- .../test/debugger_events_test.cpp | 4 +- .../{dynamic => }/test/debugger_impl_test.cpp | 0 .../test/debugger_params_test.cpp | 4 +- .../test/debugger_returns_test.cpp | 4 +- .../test/debugger_script_test.cpp | 6 +- .../test/debugger_service_test.cpp | 0 .../test/debugger_types_test.cpp | 2 +- .../{dynamic => }/test/dispatcher_test.cpp | 0 tooling/{dynamic => }/test/dom_impl_test.cpp | 0 .../test/entry/test_debugger_entry.cpp | 2 +- .../test/heapprofiler_impl_test.cpp | 0 .../{dynamic => }/test/js_pt_hooks_test.cpp | 4 +- .../{dynamic => }/test/overlay_impl_test.cpp | 0 tooling/{dynamic => }/test/page_impl_test.cpp | 0 .../{dynamic => }/test/profiler_impl_test.cpp | 0 .../test/protocol_handler_test.cpp | 0 tooling/{dynamic => }/test/pt_base64_test.cpp | 2 +- tooling/{dynamic => }/test/pt_json_test.cpp | 2 +- tooling/{dynamic => }/test/pt_params_test.cpp | 2 +- .../{dynamic => }/test/pt_returns_test.cpp | 4 +- tooling/{dynamic => }/test/pt_types_test.cpp | 2 +- .../{dynamic => }/test/runtime_impl_test.cpp | 2 +- .../{dynamic => }/test/target_impl_test.cpp | 0 .../test/testcases/js/arrow_func.js | 0 .../test/testcases/js/async_func.js | 0 .../{dynamic => }/test/testcases/js/branch.js | 0 .../test/testcases/js/closure_scope.js | 0 .../test/testcases/js/closure_variable.js | 0 .../test/testcases/js/common_func.js | 0 .../test/testcases/js/container.js | 0 .../test/testcases/js/dropframe.js | 0 .../test/testcases/js/exception.js | 0 .../testcases/js/export_variable_first.js | 0 .../testcases/js/export_variable_second.js | 0 .../test/testcases/js/local_variable_scope.js | 0 .../test/testcases/js/module_variable.js | 0 .../test/testcases/js/range_error.js | 0 .../{dynamic => }/test/testcases/js/sample.js | 0 .../test/testcases/js/smart_stepInto.js | 0 .../{dynamic => }/test/testcases/js/step.js | 0 .../test/testcases/js/syntax_exception.js | 0 .../test/testcases/js/throw_exception.js | 0 .../test/testcases/js/variable_first.js | 0 .../test/testcases/js/variable_second.js | 0 .../test/testcases/js/watch_variable.js | 0 .../testcases/js_accelerate_launch_test.h | 2 +- .../testcases/js_allocationtrack_loop_test.h | 2 +- .../js_allocationtrack_recursion_test.h | 2 +- .../test/testcases/js_allocationtrack_test.h | 2 +- .../test/testcases/js_breakpoint_arrow_test.h | 2 +- .../test/testcases/js_breakpoint_async_test.h | 2 +- .../testcases/js_breakpoint_cannot_hit_test.h | 2 +- .../js_breakpoint_in_different_branch.h | 2 +- .../test/testcases/js_breakpoint_loop_test.h | 2 +- .../testcases/js_breakpoint_recursion_test.h | 2 +- .../testcases/js_breakpoint_switch_test.h | 2 +- .../test/testcases/js_breakpoint_test.h | 2 +- .../test/testcases/js_closure_scope_test.h | 2 +- .../test/testcases/js_container_test.h | 2 +- .../test/testcases/js_cpuprofile_async_test.h | 2 +- .../test/testcases/js_cpuprofile_loop_test.h | 2 +- .../testcases/js_cpuprofile_recursion_test.h | 2 +- .../test/testcases/js_cpuprofile_step_test.h | 2 +- .../test/testcases/js_cpuprofile_test.h | 2 +- .../test/testcases/js_dropframe_test.h | 0 .../test/testcases/js_exception_test.h | 2 +- .../test/testcases/js_heapdump_loop_test.h | 2 +- .../test/testcases/js_heapdump_test.h | 2 +- .../testcases/js_heapprofiler_dump_test.h | 2 +- .../testcases/js_heapsampling_loop_test.h | 2 +- .../test/testcases/js_heapsampling_test.h | 2 +- .../test/testcases/js_heapusage_async_test.h | 2 +- .../test/testcases/js_heapusage_loop_test.h | 2 +- .../testcases/js_heapusage_recursion_test.h | 2 +- .../test/testcases/js_heapusage_step_test.h | 2 +- .../test/testcases/js_heapusage_test.h | 2 +- .../testcases/js_local_variable_scope_test.h | 2 +- .../test/testcases/js_module_variable_test.h | 2 +- .../js_multiple_breakpoint_in_function_test.h | 2 +- .../js_multiple_common_breakpoint_test.h | 2 +- .../test/testcases/js_range_error_test.h | 0 .../test/testcases/js_single_step_test.h | 0 .../test/testcases/js_smart_stepInto_test.h | 2 +- .../test/testcases/js_source_test.h | 2 +- .../js_special_location_breakpoint_test.h | 2 +- .../test/testcases/js_step_into_test.h | 0 .../test/testcases/js_step_out_test.h | 0 .../test/testcases/js_step_over_test.h | 0 .../testcases/js_stepinto_and_stepout_test.h | 2 +- .../test/testcases/js_stepinto_arrow_test.h | 2 +- .../test/testcases/js_stepinto_async_test.h | 2 +- .../test/testcases/js_stepinto_loop_test.h | 2 +- .../testcases/js_stepinto_recursion_test.h | 2 +- .../test/testcases/js_stepinto_switch_test.h | 2 +- .../test/testcases/js_stepinto_test.h | 2 +- .../test/testcases/js_stepout_arrow_test.h | 2 +- .../test/testcases/js_stepout_async_test.h | 2 +- .../js_stepout_before_function_test.h | 2 +- .../test/testcases/js_stepout_loop_test.h | 2 +- .../testcases/js_stepout_recursion_test.h | 2 +- .../test/testcases/js_stepout_switch_test.h | 2 +- .../test/testcases/js_stepout_test.h | 2 +- .../test/testcases/js_stepover_loop_test.h | 2 +- .../testcases/js_stepover_recursion_test.h | 2 +- .../test/testcases/js_stepover_switch_test.h | 2 +- .../test/testcases/js_stepover_test.h | 2 +- .../test/testcases/js_syntax_exception_test.h | 0 .../test/testcases/js_throw_exception_test.h | 0 .../test/testcases/js_tracing_test.h | 2 +- .../test/testcases/js_variable_first_test.h | 0 .../test/testcases/js_variable_second_test.h | 0 .../test/testcases/js_watch_basic_type_test.h | 2 +- .../js_watch_closure_variable_test.h | 2 +- .../test/testcases/js_watch_other_type_test.h | 2 +- .../test/testcases/js_watch_set_type_test.h | 2 +- .../test/testcases/js_watch_test.h | 2 +- .../test/testcases/js_watch_variable_test.h | 2 +- .../{dynamic => }/test/tracing_impl_test.cpp | 0 .../{dynamic => }/test/utils/test_channel.h | 2 +- .../{dynamic => }/test/utils/test_entry.cpp | 0 tooling/{dynamic => }/test/utils/test_entry.h | 0 .../{dynamic => }/test/utils/test_events.h | 0 .../test/utils/test_extractor.cpp | 0 .../{dynamic => }/test/utils/test_extractor.h | 0 tooling/{dynamic => }/test/utils/test_hooks.h | 0 .../{dynamic => }/test/utils/test_list.cpp | 0 tooling/{dynamic => }/test/utils/test_list.h | 0 .../{dynamic => }/test/utils/test_util.cpp | 0 tooling/{dynamic => }/test/utils/test_util.h | 0 tooling/{dynamic => }/utils/utils.cpp | 2 +- tooling/{dynamic => }/utils/utils.h | 0 websocket/client/websocket_client.h | 1 + websocket/test/BUILD.gn | 2 +- 532 files changed, 729 insertions(+), 12243 deletions(-) rename tooling/{dynamic => }/agent/animation_impl.cpp (100%) rename tooling/{dynamic => }/agent/animation_impl.h (100%) rename tooling/{dynamic => }/agent/css_impl.cpp (100%) rename tooling/{dynamic => }/agent/css_impl.h (100%) rename tooling/{dynamic => }/agent/debugger_impl.cpp (99%) rename tooling/{dynamic => }/agent/debugger_impl.h (99%) rename tooling/{dynamic => }/agent/dom_impl.cpp (100%) rename tooling/{dynamic => }/agent/dom_impl.h (100%) rename tooling/{dynamic => }/agent/heapprofiler_impl.cpp (100%) rename tooling/{dynamic => }/agent/heapprofiler_impl.h (98%) rename tooling/{dynamic => }/agent/overlay_impl.cpp (100%) rename tooling/{dynamic => }/agent/overlay_impl.h (100%) rename tooling/{dynamic => }/agent/page_impl.cpp (100%) rename tooling/{dynamic => }/agent/page_impl.h (100%) rename tooling/{dynamic => }/agent/profiler_impl.cpp (100%) rename tooling/{dynamic => }/agent/profiler_impl.h (97%) rename tooling/{dynamic => }/agent/runtime_impl.cpp (100%) rename tooling/{dynamic => }/agent/runtime_impl.h (99%) rename tooling/{dynamic => }/agent/target_impl.cpp (100%) rename tooling/{dynamic => }/agent/target_impl.h (100%) rename tooling/{dynamic => }/agent/tracing_impl.cpp (100%) rename tooling/{dynamic => }/agent/tracing_impl.h (97%) rename tooling/{dynamic => }/backend/debugger_executor.cpp (99%) rename tooling/{dynamic => }/backend/debugger_executor.h (100%) rename tooling/{dynamic => }/backend/js_pt_hooks.cpp (100%) rename tooling/{dynamic => }/backend/js_pt_hooks.h (95%) rename tooling/{dynamic => }/backend/js_single_stepper.cpp (100%) rename tooling/{dynamic => }/backend/js_single_stepper.h (100%) rename tooling/{dynamic => }/base/pt_base64.cpp (99%) rename tooling/{dynamic => }/base/pt_base64.h (100%) rename tooling/{dynamic => }/base/pt_events.cpp (99%) rename tooling/{dynamic => }/base/pt_events.h (99%) rename tooling/{dynamic => }/base/pt_json.cpp (99%) rename tooling/{dynamic => }/base/pt_json.h (100%) rename tooling/{dynamic => }/base/pt_params.cpp (97%) rename tooling/{dynamic => }/base/pt_params.h (99%) rename tooling/{dynamic => }/base/pt_returns.cpp (99%) rename tooling/{dynamic => }/base/pt_returns.h (99%) rename tooling/{dynamic => }/base/pt_script.cpp (95%) rename tooling/{dynamic => }/base/pt_script.h (98%) rename tooling/{dynamic => }/base/pt_types.cpp (99%) rename tooling/{dynamic => }/base/pt_types.h (99%) rename tooling/{dynamic => }/client/BUILD.gn (91%) rename tooling/{dynamic => }/client/ark_cli/BUILD.gn (87%) rename tooling/{dynamic => }/client/ark_cli/main.cpp (98%) rename tooling/{dynamic => }/client/ark_multi/BUILD.gn (97%) rename tooling/{dynamic => }/client/ark_multi/ReadMe.md (100%) rename tooling/{dynamic => }/client/ark_multi/ReadMe_Zh.md (100%) rename tooling/{dynamic => }/client/ark_multi/main.cpp (99%) rename tooling/{dynamic => }/client/domain/debugger_client.cpp (99%) rename tooling/{dynamic => }/client/domain/debugger_client.h (98%) rename tooling/{dynamic => }/client/domain/heapprofiler_client.cpp (99%) rename tooling/{dynamic => }/client/domain/heapprofiler_client.h (97%) rename tooling/{dynamic => }/client/domain/profiler_client.cpp (98%) rename tooling/{dynamic => }/client/domain/profiler_client.h (98%) rename tooling/{dynamic => }/client/domain/runtime_client.cpp (98%) rename tooling/{dynamic => }/client/domain/runtime_client.h (97%) rename tooling/{dynamic => }/client/domain/test_client.cpp (95%) rename tooling/{dynamic => }/client/domain/test_client.h (96%) rename tooling/{dynamic => }/client/manager/breakpoint_manager.cpp (95%) rename tooling/{dynamic => }/client/manager/breakpoint_manager.h (95%) rename tooling/{dynamic => }/client/manager/domain_manager.cpp (97%) rename tooling/{dynamic => }/client/manager/domain_manager.h (88%) rename tooling/{dynamic => }/client/manager/message_manager.h (100%) rename tooling/{dynamic => }/client/manager/source_manager.cpp (98%) rename tooling/{dynamic => }/client/manager/source_manager.h (95%) rename tooling/{dynamic => }/client/manager/stack_manager.cpp (97%) rename tooling/{dynamic => }/client/manager/stack_manager.h (95%) rename tooling/{dynamic => }/client/manager/variable_manager.cpp (99%) rename tooling/{dynamic => }/client/manager/variable_manager.h (95%) rename tooling/{dynamic => }/client/manager/watch_manager.cpp (98%) rename tooling/{dynamic => }/client/manager/watch_manager.h (93%) rename tooling/{dynamic => }/client/session/session.cpp (98%) rename tooling/{dynamic => }/client/session/session.h (92%) rename tooling/{dynamic => }/client/tcpServer/tcp_server.cpp (98%) rename tooling/{dynamic => }/client/tcpServer/tcp_server.h (100%) rename tooling/{dynamic => }/client/tcpServer/test/config.py (100%) rename tooling/{dynamic => }/client/tcpServer/test/js_test_base.py (100%) rename tooling/{dynamic => }/client/tcpServer/test/js_test_case/__init__.py (100%) rename tooling/{dynamic => }/client/tcpServer/test/js_test_case/js_test.py (100%) rename tooling/{dynamic => }/client/tcpServer/test/runtest.py (100%) rename tooling/{dynamic => }/client/utils/cli_command.cpp (99%) rename tooling/{dynamic => }/client/utils/cli_command.h (91%) rename tooling/{dynamic => }/debugger_service.cpp (100%) rename tooling/{dynamic => }/debugger_service.h (100%) rename tooling/{dynamic => }/dispatcher.cpp (100%) rename tooling/{dynamic => }/dispatcher.h (98%) delete mode 100644 tooling/dynamic/BUILD.gn rename tooling/{dynamic => }/protocol_channel.h (94%) rename tooling/{dynamic => }/protocol_handler.cpp (100%) rename tooling/{dynamic => }/protocol_handler.h (100%) delete mode 100644 tooling/static/BUILD.gn delete mode 100644 tooling/static/CMakeLists.txt delete mode 100644 tooling/static/common.h delete mode 100644 tooling/static/connection/asio/asio_config.h delete mode 100644 tooling/static/connection/asio/asio_server.cpp delete mode 100644 tooling/static/connection/asio/asio_server.h delete mode 100644 tooling/static/connection/asio/server_endpoint-inl.h delete mode 100644 tooling/static/connection/asio/server_endpoint.h delete mode 100644 tooling/static/connection/asio/ws_logger.cpp delete mode 100644 tooling/static/connection/asio/ws_logger.h delete mode 100644 tooling/static/connection/endpoint_base.cpp delete mode 100644 tooling/static/connection/endpoint_base.h delete mode 100644 tooling/static/connection/event_loop.cpp delete mode 100644 tooling/static/connection/event_loop.h delete mode 100644 tooling/static/connection/ohos_ws/ohos_ws_server.cpp delete mode 100644 tooling/static/connection/ohos_ws/ohos_ws_server.h delete mode 100644 tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.cpp delete mode 100644 tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.h delete mode 100644 tooling/static/connection/server.h delete mode 100644 tooling/static/connection/server_endpoint_base.cpp delete mode 100644 tooling/static/connection/server_endpoint_base.h delete mode 100644 tooling/static/debugger/breakpoint.cpp delete mode 100644 tooling/static/debugger/breakpoint.h delete mode 100644 tooling/static/debugger/breakpoint_base.h delete mode 100644 tooling/static/debugger/breakpoint_storage.cpp delete mode 100644 tooling/static/debugger/breakpoint_storage.h delete mode 100644 tooling/static/debugger/conditional_breakpoint.cpp delete mode 100644 tooling/static/debugger/conditional_breakpoint.h delete mode 100644 tooling/static/debugger/debug_info_cache.cpp delete mode 100644 tooling/static/debugger/debug_info_cache.h delete mode 100644 tooling/static/debugger/debuggable_thread.cpp delete mode 100644 tooling/static/debugger/debuggable_thread.h delete mode 100644 tooling/static/debugger/object_repository.cpp delete mode 100644 tooling/static/debugger/object_repository.h delete mode 100644 tooling/static/debugger/thread_state.cpp delete mode 100644 tooling/static/debugger/thread_state.h delete mode 100644 tooling/static/debugger_arkapi.cpp delete mode 100644 tooling/static/debugger_arkapi.h delete mode 100644 tooling/static/error.cpp delete mode 100644 tooling/static/error.h delete mode 100644 tooling/static/evaluation/base64.h delete mode 100644 tooling/static/evaluation/evaluation_engine.cpp delete mode 100644 tooling/static/evaluation/evaluation_engine.h delete mode 100644 tooling/static/init.cpp delete mode 100644 tooling/static/inspector.cpp delete mode 100644 tooling/static/inspector.h delete mode 100644 tooling/static/inspector_server.cpp delete mode 100644 tooling/static/inspector_server.h delete mode 100644 tooling/static/json_serialization/jrpc_error.cpp delete mode 100644 tooling/static/json_serialization/jrpc_error.h delete mode 100644 tooling/static/json_serialization/serializable.h delete mode 100644 tooling/static/session_manager.cpp delete mode 100644 tooling/static/session_manager.h delete mode 100644 tooling/static/source_manager.cpp delete mode 100644 tooling/static/source_manager.h delete mode 100644 tooling/static/tests/base64.cpp delete mode 100644 tooling/static/tests/common.h delete mode 100644 tooling/static/tests/debug_info_cache.cpp delete mode 100644 tooling/static/tests/inspector_server.cpp delete mode 100644 tooling/static/tests/json_object_matcher.cpp delete mode 100644 tooling/static/tests/json_object_matcher.h delete mode 100644 tooling/static/tests/object_repository.cpp delete mode 100644 tooling/static/tests/session_manager.cpp delete mode 100644 tooling/static/tests/source_manager.cpp delete mode 100644 tooling/static/tests/test_frame.h delete mode 100644 tooling/static/tests/thread_state.cpp delete mode 100644 tooling/static/types/custom_url_breakpoint_response.cpp delete mode 100644 tooling/static/types/custom_url_breakpoint_response.h delete mode 100644 tooling/static/types/debugger_call_function_on_request.cpp delete mode 100644 tooling/static/types/debugger_call_function_on_request.h delete mode 100644 tooling/static/types/debugger_evaluation_request.cpp delete mode 100644 tooling/static/types/debugger_evaluation_request.h delete mode 100644 tooling/static/types/evaluation_result.h delete mode 100644 tooling/static/types/exception_details.cpp delete mode 100644 tooling/static/types/exception_details.h delete mode 100644 tooling/static/types/location.cpp delete mode 100644 tooling/static/types/location.h delete mode 100644 tooling/static/types/numeric_id.h delete mode 100644 tooling/static/types/object_preview.cpp delete mode 100644 tooling/static/types/object_preview.h delete mode 100644 tooling/static/types/pause_on_exceptions_state.h delete mode 100644 tooling/static/types/possible_breakpoints_response.h delete mode 100644 tooling/static/types/profile_result.cpp delete mode 100644 tooling/static/types/profile_result.h delete mode 100644 tooling/static/types/property_descriptor.h delete mode 100644 tooling/static/types/property_preview.h delete mode 100644 tooling/static/types/remote_object.cpp delete mode 100644 tooling/static/types/remote_object.h delete mode 100644 tooling/static/types/remote_object_type.h delete mode 100644 tooling/static/types/scope.cpp delete mode 100644 tooling/static/types/scope.h delete mode 100644 tooling/static/types/script_source_response.h delete mode 100644 tooling/static/types/url_breakpoint_request.cpp delete mode 100644 tooling/static/types/url_breakpoint_request.h delete mode 100644 tooling/static/types/url_breakpoint_response.cpp delete mode 100644 tooling/static/types/url_breakpoint_response.h rename tooling/{dynamic => }/test/BUILD.gn (96%) rename tooling/{dynamic => }/test/animation_impl_test.cpp (100%) rename tooling/{dynamic => }/test/client_utils/test_actions.h (100%) rename tooling/{dynamic => }/test/client_utils/test_list.cpp (60%) rename tooling/{dynamic => }/test/client_utils/test_list.h (100%) rename tooling/{dynamic => }/test/client_utils/test_util.cpp (96%) rename tooling/{dynamic => }/test/client_utils/test_util.h (91%) rename tooling/{dynamic => }/test/debugger_cint_client_test.cpp (95%) rename tooling/{dynamic => }/test/debugger_cinterp_test.cpp (97%) rename tooling/{dynamic => }/test/debugger_client_test.cpp (95%) rename tooling/{dynamic => }/test/debugger_commands_test.cpp (95%) rename tooling/{dynamic => }/test/debugger_entry_test.cpp (97%) rename tooling/{dynamic => }/test/debugger_events_test.cpp (99%) rename tooling/{dynamic => }/test/debugger_impl_test.cpp (100%) rename tooling/{dynamic => }/test/debugger_params_test.cpp (97%) rename tooling/{dynamic => }/test/debugger_returns_test.cpp (99%) rename tooling/{dynamic => }/test/debugger_script_test.cpp (96%) rename tooling/{dynamic => }/test/debugger_service_test.cpp (100%) rename tooling/{dynamic => }/test/debugger_types_test.cpp (99%) rename tooling/{dynamic => }/test/dispatcher_test.cpp (100%) rename tooling/{dynamic => }/test/dom_impl_test.cpp (100%) rename tooling/{dynamic => }/test/entry/test_debugger_entry.cpp (94%) rename tooling/{dynamic => }/test/heapprofiler_impl_test.cpp (100%) rename tooling/{dynamic => }/test/js_pt_hooks_test.cpp (97%) rename tooling/{dynamic => }/test/overlay_impl_test.cpp (100%) rename tooling/{dynamic => }/test/page_impl_test.cpp (100%) rename tooling/{dynamic => }/test/profiler_impl_test.cpp (100%) rename tooling/{dynamic => }/test/protocol_handler_test.cpp (100%) rename tooling/{dynamic => }/test/pt_base64_test.cpp (99%) rename tooling/{dynamic => }/test/pt_json_test.cpp (99%) rename tooling/{dynamic => }/test/pt_params_test.cpp (99%) rename tooling/{dynamic => }/test/pt_returns_test.cpp (99%) rename tooling/{dynamic => }/test/pt_types_test.cpp (99%) rename tooling/{dynamic => }/test/runtime_impl_test.cpp (96%) rename tooling/{dynamic => }/test/target_impl_test.cpp (100%) rename tooling/{dynamic => }/test/testcases/js/arrow_func.js (100%) rename tooling/{dynamic => }/test/testcases/js/async_func.js (100%) rename tooling/{dynamic => }/test/testcases/js/branch.js (100%) rename tooling/{dynamic => }/test/testcases/js/closure_scope.js (100%) rename tooling/{dynamic => }/test/testcases/js/closure_variable.js (100%) rename tooling/{dynamic => }/test/testcases/js/common_func.js (100%) rename tooling/{dynamic => }/test/testcases/js/container.js (100%) rename tooling/{dynamic => }/test/testcases/js/dropframe.js (100%) rename tooling/{dynamic => }/test/testcases/js/exception.js (100%) rename tooling/{dynamic => }/test/testcases/js/export_variable_first.js (100%) rename tooling/{dynamic => }/test/testcases/js/export_variable_second.js (100%) rename tooling/{dynamic => }/test/testcases/js/local_variable_scope.js (100%) rename tooling/{dynamic => }/test/testcases/js/module_variable.js (100%) rename tooling/{dynamic => }/test/testcases/js/range_error.js (100%) rename tooling/{dynamic => }/test/testcases/js/sample.js (100%) rename tooling/{dynamic => }/test/testcases/js/smart_stepInto.js (100%) rename tooling/{dynamic => }/test/testcases/js/step.js (100%) rename tooling/{dynamic => }/test/testcases/js/syntax_exception.js (100%) rename tooling/{dynamic => }/test/testcases/js/throw_exception.js (100%) rename tooling/{dynamic => }/test/testcases/js/variable_first.js (100%) rename tooling/{dynamic => }/test/testcases/js/variable_second.js (100%) rename tooling/{dynamic => }/test/testcases/js/watch_variable.js (100%) rename tooling/{dynamic => }/test/testcases/js_accelerate_launch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_allocationtrack_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_allocationtrack_recursion_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_allocationtrack_test.h (96%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_arrow_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_async_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_cannot_hit_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_in_different_branch.h (98%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_recursion_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_switch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_breakpoint_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_closure_scope_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_container_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_cpuprofile_async_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_cpuprofile_loop_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_cpuprofile_recursion_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_cpuprofile_step_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_cpuprofile_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_dropframe_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_exception_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_heapdump_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_heapdump_test.h (96%) rename tooling/{dynamic => }/test/testcases/js_heapprofiler_dump_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapsampling_loop_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapsampling_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapusage_async_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapusage_loop_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapusage_recursion_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_heapusage_step_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_heapusage_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_local_variable_scope_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_module_variable_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_multiple_breakpoint_in_function_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_multiple_common_breakpoint_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_range_error_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_single_step_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_smart_stepInto_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_source_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_special_location_breakpoint_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_step_into_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_step_out_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_step_over_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_stepinto_and_stepout_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_arrow_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_async_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_recursion_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_switch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepinto_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_arrow_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_async_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_before_function_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_recursion_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_switch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepout_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepover_loop_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepover_recursion_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepover_switch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_stepover_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_syntax_exception_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_throw_exception_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_tracing_test.h (98%) rename tooling/{dynamic => }/test/testcases/js_variable_first_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_variable_second_test.h (100%) rename tooling/{dynamic => }/test/testcases/js_watch_basic_type_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_watch_closure_variable_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_watch_other_type_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_watch_set_type_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_watch_test.h (99%) rename tooling/{dynamic => }/test/testcases/js_watch_variable_test.h (99%) rename tooling/{dynamic => }/test/tracing_impl_test.cpp (100%) rename tooling/{dynamic => }/test/utils/test_channel.h (97%) rename tooling/{dynamic => }/test/utils/test_entry.cpp (100%) rename tooling/{dynamic => }/test/utils/test_entry.h (100%) rename tooling/{dynamic => }/test/utils/test_events.h (100%) rename tooling/{dynamic => }/test/utils/test_extractor.cpp (100%) rename tooling/{dynamic => }/test/utils/test_extractor.h (100%) rename tooling/{dynamic => }/test/utils/test_hooks.h (100%) rename tooling/{dynamic => }/test/utils/test_list.cpp (100%) rename tooling/{dynamic => }/test/utils/test_list.h (100%) rename tooling/{dynamic => }/test/utils/test_util.cpp (100%) rename tooling/{dynamic => }/test/utils/test_util.h (100%) rename tooling/{dynamic => }/utils/utils.cpp (99%) rename tooling/{dynamic => }/utils/utils.h (100%) diff --git a/BUILD.gn b/BUILD.gn index fcb21702..999796cf 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -244,7 +244,7 @@ config("toolchain_test_config") { visibility = [ "./inspector/test/*", "./test/fuzztest/*", - "./tooling/dynamic/test/*", + "./tooling/test/*", "./websocket/test/*", ] @@ -261,9 +261,9 @@ group("ark_toolchain_packages") { "./inspector:ark_debugger", "./inspector:connectserver_debugger", "./tooling:libark_ecma_debugger", - "./tooling/dynamic/client:libark_client", - "./tooling/dynamic/client/ark_cli:arkdb", - "./tooling/dynamic/client/ark_multi:ark_multi", + "./tooling/client:libark_client", + "./tooling/client/ark_cli:arkdb", + "./tooling/client/ark_multi:ark_multi", ] } @@ -272,7 +272,7 @@ group("ark_toolchain_unittest") { deps = [] deps += [ "./inspector/test:unittest", - "./tooling/dynamic/test:unittest", + "./tooling/test:unittest", "./websocket/test:unittest", ] if (is_ohos && is_standard_system) { @@ -287,7 +287,7 @@ group("ark_toolchain_host_unittest") { # js unittest deps += [ "./inspector/test:host_unittest", - "./tooling/dynamic/test:host_unittest", + "./tooling/test:host_unittest", "./websocket/test:host_unittest", ] } diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index e7f0c607..99c30b2a 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -132,9 +132,9 @@ group("toolchain") { } if (target_os != "mingw") { deps += [ - "$toolchain_root/tooling/dynamic/client:libark_client", - "$toolchain_root/tooling/dynamic/client/ark_cli:arkdb", - "$toolchain_root/tooling/dynamic/client/ark_multi:ark_multi", + "$toolchain_root/tooling/client:libark_client", + "$toolchain_root/tooling/client/ark_cli:arkdb", + "$toolchain_root/tooling/client/ark_multi:ark_multi", ] } } diff --git a/inspector/BUILD.gn b/inspector/BUILD.gn index 7680a36a..33149f55 100644 --- a/inspector/BUILD.gn +++ b/inspector/BUILD.gn @@ -99,7 +99,7 @@ ohos_source_set("connectserver_debugger_static") { deps = [ "../websocket:websocket_server" ] sources = [ "../common/log_wrapper.cpp", - "../tooling/dynamic/base/pt_json.cpp", + "../tooling/base/pt_json.cpp", "connect_inspector.cpp", "connect_server.cpp", ] diff --git a/inspector/connect_inspector.cpp b/inspector/connect_inspector.cpp index 1d975852..a51f4973 100644 --- a/inspector/connect_inspector.cpp +++ b/inspector/connect_inspector.cpp @@ -18,7 +18,7 @@ #include #include "common/log_wrapper.h" -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" #include "ws_server.h" namespace OHOS::ArkCompiler::Toolchain { diff --git a/inspector/inspector.cpp b/inspector/inspector.cpp index ddf78723..0988b350 100644 --- a/inspector/inspector.cpp +++ b/inspector/inspector.cpp @@ -28,7 +28,7 @@ #include "library_loader.h" #if defined(IOS_PLATFORM) -#include "tooling/dynamic/debugger_service.h" +#include "tooling/debugger_service.h" #endif #if defined(ENABLE_FFRT_INTERFACES) @@ -50,7 +50,6 @@ using OnMessage = void(*)(void*, std::string&&); using ProcessMessage = void(*)(void*); using GetDispatchStatus = int32_t(*)(void*); using GetCallFrames = char*(*)(void*); -using OperateDebugMessage = char*(*)(void*, const char*); OnMessage g_onMessage = nullptr; InitializeDebugger g_initializeDebugger = nullptr; @@ -59,7 +58,6 @@ WaitForDebugger g_waitForDebugger = nullptr; ProcessMessage g_processMessage = nullptr; GetDispatchStatus g_getDispatchStatus = nullptr; GetCallFrames g_getCallFrames = nullptr; -OperateDebugMessage g_operateDebugMessage = nullptr; std::atomic g_hasArkFuncsInited = false; std::unordered_map g_inspectors; @@ -224,12 +222,6 @@ bool InitializeArkFunctionsOthers() ResetServiceLocked(g_vm, true); return false; } - g_operateDebugMessage = reinterpret_cast( - GetArkDynFunction("OperateDebugMessage")); - if (g_operateDebugMessage == nullptr) { - ResetServiceLocked(g_vm, true); - return false; - } return true; } #else @@ -243,7 +235,6 @@ bool InitializeArkFunctionsIOS() g_getDispatchStatus = reinterpret_cast(&tooling::GetDispatchStatus); g_processMessage = reinterpret_cast(&tooling::ProcessMessage); g_getCallFrames = reinterpret_cast(&tooling::GetCallFrames); - g_operateDebugMessage = reinterpret_cast(&tooling::OperateDebugMessage); return true; } #endif @@ -488,18 +479,4 @@ const char* GetJsBacktrace() return ""; #endif } - -const char* OperateJsDebugMessage([[maybe_unused]] const char* message) -{ -#if defined(OHOS_PLATFORM) - void* vm = GetEcmaVM(Inspector::GetThreadOrTaskId()); - if (g_operateDebugMessage == nullptr) { - LOGE("OperateDebugMessage symbol resolve failed"); - return ""; - } - return g_operateDebugMessage(vm, message); -#else - return ""; -#endif -} } // namespace OHOS::ArkCompiler::Toolchain diff --git a/inspector/test/BUILD.gn b/inspector/test/BUILD.gn index 81fe4e91..f8073d01 100644 --- a/inspector/test/BUILD.gn +++ b/inspector/test/BUILD.gn @@ -14,7 +14,7 @@ import("//arkcompiler/toolchain/test/test_helper.gni") import("//arkcompiler/toolchain/toolchain.gni") -module_output_path = "toolchain/toolchain" +module_output_path = "toolchain" host_unittest_action("InspectorConnectTest") { module_out_path = module_output_path diff --git a/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/BUILD.gn index 18f24553..3e4c043a 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerAddInspectedHeapObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/heapprofileraddinspectedheapobject_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/heapprofileraddinspectedheapobject_fuzzer.cpp index 99a51698..30d5a75d 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/heapprofileraddinspectedheapobject_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofileraddinspectedheapobject_fuzzer/heapprofileraddinspectedheapobject_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofileraddinspectedheapobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/BUILD.gn index eabb5dd8..5315851e 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("HeapprofilerCollectgarbageFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/heapprofilercollectgarbage_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/heapprofilercollectgarbage_fuzzer.cpp index ed966674..32dfc129 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/heapprofilercollectgarbage_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilercollectgarbage_fuzzer/heapprofilercollectgarbage_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilercollectgarbage_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/BUILD.gn index 94bc5821..0710ee66 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerDisableFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/heapprofilerdisable_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/heapprofilerdisable_fuzzer.cpp index 0d80bd9e..da6fbf1a 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/heapprofilerdisable_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerdisable_fuzzer/heapprofilerdisable_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerdisable_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/BUILD.gn index b9407316..856a33e4 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerDispatchFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/heapprofilerdispatch_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/heapprofilerdispatch_fuzzer.cpp index 5c7c8691..b59b335a 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/heapprofilerdispatch_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerdispatch_fuzzer/heapprofilerdispatch_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerdispatch_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/BUILD.gn index 91ca56e7..6691e971 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerEnableFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/heapprofilerenable_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/heapprofilerenable_fuzzer.cpp index 5b30b35e..09d67d66 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/heapprofilerenable_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerenable_fuzzer/heapprofilerenable_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerenable_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/BUILD.gn index bc3505d6..5e753384 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerGetheapObjectIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/heapprofilergetheapobjectid_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/heapprofilergetheapobjectid_fuzzer.cpp index 84288d2b..32886181 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/heapprofilergetheapobjectid_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetheapobjectid_fuzzer/heapprofilergetheapobjectid_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilergetheapobjectid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/BUILD.gn index 4ae7f623..9c3c062d 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerGetObjectByHeapObjectIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/heapprofilergetobjectbyheapobjectid_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/heapprofilergetobjectbyheapobjectid_fuzzer.cpp index 46691209..b4bc0a18 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/heapprofilergetobjectbyheapobjectid_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetobjectbyheapobjectid_fuzzer/heapprofilergetobjectbyheapobjectid_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilergetobjectbyheapobjectid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/BUILD.gn index 6910147f..d57422f3 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerGetSamplingProfileFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/heapprofilergetsamplingprofile_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/heapprofilergetsamplingprofile_fuzzer.cpp index 520473ad..6e08b171 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/heapprofilergetsamplingprofile_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilergetsamplingprofile_fuzzer/heapprofilergetsamplingprofile_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilergetsamplingprofile_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/BUILD.gn index eb9f3070..ba8d4a35 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerStartSamplingFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/heapprofilerstartsampling_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/heapprofilerstartsampling_fuzzer.cpp index 62be4592..2a8155f4 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/heapprofilerstartsampling_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstartsampling_fuzzer/heapprofilerstartsampling_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerstartsampling_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/BUILD.gn index ebe99a24..2d460555 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("HeapprofilerStartTrackingHeapObjectsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/heapprofilerstarttrackingheapobjects_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/heapprofilerstarttrackingheapobjects_fuzzer.cpp index 7a78f7d0..266919c1 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/heapprofilerstarttrackingheapobjects_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstarttrackingheapobjects_fuzzer/heapprofilerstarttrackingheapobjects_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerstarttrackingheapobjects_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/BUILD.gn index 9b45b066..581da693 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("HeapprofilerStopSamplingFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/heapprofilerstopsampling_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/heapprofilerstopsampling_fuzzer.cpp index 9800789d..f7fc9ff5 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/heapprofilerstopsampling_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstopsampling_fuzzer/heapprofilerstopsampling_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerstopsampling_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/BUILD.gn index c185b9a8..870dbc8d 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("HeapprofilerStopTrackingHeapObjectsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/heapprofilerstoptrackingheapobjects_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/heapprofilerstoptrackingheapobjects_fuzzer.cpp index 5b05770c..5d73c2c2 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/heapprofilerstoptrackingheapobjects_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilerstoptrackingheapobjects_fuzzer/heapprofilerstoptrackingheapobjects_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilerstoptrackingheapobjects_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/BUILD.gn b/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/BUILD.gn index 6759fb72..ab388efe 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/BUILD.gn +++ b/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("HeapprofilerTakeHeapSnapshotFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/heapprofilertakeheapsnapshot_fuzzer.cpp b/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/heapprofilertakeheapsnapshot_fuzzer.cpp index e7c51991..d2013f5c 100644 --- a/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/heapprofilertakeheapsnapshot_fuzzer.cpp +++ b/test/fuzztest/agent/heapprofiler/heapprofilertakeheapsnapshot_fuzzer/heapprofilertakeheapsnapshot_fuzzer.cpp @@ -16,7 +16,7 @@ #include "heapprofilertakeheapsnapshot_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/heapprofiler_impl.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/backend/backendbreakpoint_fuzzer/BUILD.gn b/test/fuzztest/backend/backendbreakpoint_fuzzer/BUILD.gn index 2f9570ec..09f9ffe7 100644 --- a/test/fuzztest/backend/backendbreakpoint_fuzzer/BUILD.gn +++ b/test/fuzztest/backend/backendbreakpoint_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("BackendBreakpointFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/backend/backendbreakpoint_fuzzer/backendbreakpoint_fuzzer.cpp b/test/fuzztest/backend/backendbreakpoint_fuzzer/backendbreakpoint_fuzzer.cpp index 35d598f9..9a29531c 100644 --- a/test/fuzztest/backend/backendbreakpoint_fuzzer/backendbreakpoint_fuzzer.cpp +++ b/test/fuzztest/backend/backendbreakpoint_fuzzer/backendbreakpoint_fuzzer.cpp @@ -16,7 +16,7 @@ #include "backendbreakpoint_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/debugger_impl.h" -#include "tooling/dynamic/backend/js_pt_hooks.h" +#include "tooling/backend/js_pt_hooks.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/backend/backendexception_fuzzer/BUILD.gn b/test/fuzztest/backend/backendexception_fuzzer/BUILD.gn index 92b40fa8..b8035b36 100644 --- a/test/fuzztest/backend/backendexception_fuzzer/BUILD.gn +++ b/test/fuzztest/backend/backendexception_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("BackendExceptionFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/backend/backendexception_fuzzer/backendexception_fuzzer.cpp b/test/fuzztest/backend/backendexception_fuzzer/backendexception_fuzzer.cpp index 4eb5f731..21c878b3 100644 --- a/test/fuzztest/backend/backendexception_fuzzer/backendexception_fuzzer.cpp +++ b/test/fuzztest/backend/backendexception_fuzzer/backendexception_fuzzer.cpp @@ -16,7 +16,7 @@ #include "backendexception_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/debugger_impl.h" -#include "tooling/dynamic/backend/js_pt_hooks.h" +#include "tooling/backend/js_pt_hooks.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/backend/backendloadmodule_fuzzer/BUILD.gn b/test/fuzztest/backend/backendloadmodule_fuzzer/BUILD.gn index 04e6206a..0fdb8000 100644 --- a/test/fuzztest/backend/backendloadmodule_fuzzer/BUILD.gn +++ b/test/fuzztest/backend/backendloadmodule_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("BackendLoadModuleFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/backend/backendloadmodule_fuzzer/backendloadmodule_fuzzer.cpp b/test/fuzztest/backend/backendloadmodule_fuzzer/backendloadmodule_fuzzer.cpp index 1a692b1c..f9fe087d 100644 --- a/test/fuzztest/backend/backendloadmodule_fuzzer/backendloadmodule_fuzzer.cpp +++ b/test/fuzztest/backend/backendloadmodule_fuzzer/backendloadmodule_fuzzer.cpp @@ -16,7 +16,7 @@ #include "backendloadmodule_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/debugger_impl.h" -#include "tooling/dynamic/backend/js_pt_hooks.h" +#include "tooling/backend/js_pt_hooks.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/backend/backendnativecalling_fuzzer/BUILD.gn b/test/fuzztest/backend/backendnativecalling_fuzzer/BUILD.gn index f7531a8e..8717b255 100644 --- a/test/fuzztest/backend/backendnativecalling_fuzzer/BUILD.gn +++ b/test/fuzztest/backend/backendnativecalling_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("BackendNativeCallingFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/backend/backendnativecalling_fuzzer/backendnativecalling_fuzzer.cpp b/test/fuzztest/backend/backendnativecalling_fuzzer/backendnativecalling_fuzzer.cpp index 9c52e478..3732cc86 100644 --- a/test/fuzztest/backend/backendnativecalling_fuzzer/backendnativecalling_fuzzer.cpp +++ b/test/fuzztest/backend/backendnativecalling_fuzzer/backendnativecalling_fuzzer.cpp @@ -16,7 +16,7 @@ #include "backendnativecalling_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/debugger_impl.h" -#include "tooling/dynamic/backend/js_pt_hooks.h" +#include "tooling/backend/js_pt_hooks.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/backend/backendsinglestep_fuzzer/BUILD.gn b/test/fuzztest/backend/backendsinglestep_fuzzer/BUILD.gn index 202e7e76..29ff1ad2 100644 --- a/test/fuzztest/backend/backendsinglestep_fuzzer/BUILD.gn +++ b/test/fuzztest/backend/backendsinglestep_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("BackendSingleStepFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/backend/backendsinglestep_fuzzer/backendsinglestep_fuzzer.cpp b/test/fuzztest/backend/backendsinglestep_fuzzer/backendsinglestep_fuzzer.cpp index db8dcefa..b25dbc07 100644 --- a/test/fuzztest/backend/backendsinglestep_fuzzer/backendsinglestep_fuzzer.cpp +++ b/test/fuzztest/backend/backendsinglestep_fuzzer/backendsinglestep_fuzzer.cpp @@ -16,7 +16,7 @@ #include "backendsinglestep_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" #include "agent/debugger_impl.h" -#include "tooling/dynamic/backend/js_pt_hooks.h" +#include "tooling/backend/js_pt_hooks.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/BUILD.gn b/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/BUILD.gn index a2bddf05..7a23a8ea 100644 --- a/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtBase64DecodeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/baseptbase64decode_fuzzer.cpp b/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/baseptbase64decode_fuzzer.cpp index d55b01c8..33d44535 100644 --- a/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/baseptbase64decode_fuzzer.cpp +++ b/test/fuzztest/base/ptbase64/baseptbase64decode_fuzzer/baseptbase64decode_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptbase64decode_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_base64.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_base64.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/BUILD.gn b/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/BUILD.gn index 3d176fd6..8e151f12 100644 --- a/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtBase64EncodeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/baseptbase64encode_fuzzer.cpp b/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/baseptbase64encode_fuzzer.cpp index ffebe0a0..91245d81 100644 --- a/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/baseptbase64encode_fuzzer.cpp +++ b/test/fuzztest/base/ptbase64/baseptbase64encode_fuzzer/baseptbase64encode_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptbase64encode_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_base64.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_base64.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/BUILD.gn index 2ffcb786..cf0e0dc5 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsBreakpointGetBreakpointIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/baseptsbreakpointgetbreakpointid_fuzzer.cpp b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/baseptsbreakpointgetbreakpointid_fuzzer.cpp index bb40b9ab..b10ce3ee 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/baseptsbreakpointgetbreakpointid_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetbreakpointid_fuzzer/baseptsbreakpointgetbreakpointid_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptsbreakpointgetbreakpointid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/BUILD.gn index e928fc34..5b797668 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsBreakpointGetLocationFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/baseptsbreakpointgetlocation_fuzzer.cpp b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/baseptsbreakpointgetlocation_fuzzer.cpp index 89a39193..8e0defb9 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/baseptsbreakpointgetlocation_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetlocation_fuzzer/baseptsbreakpointgetlocation_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptsbreakpointgetlocation_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/BUILD.gn index 5eb489bd..1bbe450d 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsBreakpointGetNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/baseptsbreakpointgetname_fuzzer.cpp b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/baseptsbreakpointgetname_fuzzer.cpp index e058a3f7..3499d097 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/baseptsbreakpointgetname_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointgetname_fuzzer/baseptsbreakpointgetname_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptsbreakpointgetname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/BUILD.gn index c387adfd..75dfe585 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsBreakpointSetBreakpointIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/baseptsbreakpointsetbreakpointid_fuzzer.cpp b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/baseptsbreakpointsetbreakpointid_fuzzer.cpp index 65729541..98a80d50 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/baseptsbreakpointsetbreakpointid_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetbreakpointid_fuzzer/baseptsbreakpointsetbreakpointid_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptsbreakpointsetbreakpointid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/BUILD.gn index b0218c8e..edaba656 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsBreakpointSetLocationFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/baseptsbreakpointsetlocation_fuzzer.cpp b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/baseptsbreakpointsetlocation_fuzzer.cpp index 8664cafc..f5943609 100644 --- a/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/baseptsbreakpointsetlocation_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/breakpointresolved/baseptsbreakpointsetlocation_fuzzer/baseptsbreakpointsetlocation_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptsbreakpointsetlocation_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/BUILD.gn index b94a6793..6b3a6ba0 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetCallFramesFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/baseptspausedgetcallframes_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/baseptspausedgetcallframes_fuzzer.cpp index 3cef2889..3cff0a9f 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/baseptspausedgetcallframes_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetcallframes_fuzzer/baseptspausedgetcallframes_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgetcallframes_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/BUILD.gn index 3081646a..8a8107c1 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetDataFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/baseptspausedgetdata_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/baseptspausedgetdata_fuzzer.cpp index ec235aed..b596dfa8 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/baseptspausedgetdata_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetdata_fuzzer/baseptspausedgetdata_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgetdata_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/BUILD.gn index aa6d9f59..56c13195 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetHitBreakpointsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/baseptspausedgethitbreakpoints_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/baseptspausedgethitbreakpoints_fuzzer.cpp index 6237fbfc..865283e5 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/baseptspausedgethitbreakpoints_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgethitbreakpoints_fuzzer/baseptspausedgethitbreakpoints_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgethitbreakpoints_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/BUILD.gn index f133a42c..348d980e 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/baseptspausedgetname_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/baseptspausedgetname_fuzzer.cpp index 6d635812..0e254368 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/baseptspausedgetname_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetname_fuzzer/baseptspausedgetname_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgetname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/BUILD.gn index 58154026..fbcb9d4e 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetReasonFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/baseptspausedgetreason_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/baseptspausedgetreason_fuzzer.cpp index ecdd72cb..11036971 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/baseptspausedgetreason_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetreason_fuzzer/baseptspausedgetreason_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgetreason_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/BUILD.gn index f92713a4..e89e0831 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedGetReasonStringFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/baseptspausedgetreasonstring_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/baseptspausedgetreasonstring_fuzzer.cpp index 8718d7bd..677da0ff 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/baseptspausedgetreasonstring_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedgetreasonstring_fuzzer/baseptspausedgetreasonstring_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedgetreasonstring_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/BUILD.gn index 1d8df7a0..31b8b07d 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedHasDataFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/baseptspausedhasdata_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/baseptspausedhasdata_fuzzer.cpp index 7f59ca03..501c6c77 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/baseptspausedhasdata_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedhasdata_fuzzer/baseptspausedhasdata_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedhasdata_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/BUILD.gn index a89aa693..32d30296 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedHasHitBreakpointsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/baseptspausedhashitbreakpoints_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/baseptspausedhashitbreakpoints_fuzzer.cpp index b3c209ad..32e73477 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/baseptspausedhashitbreakpoints_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedhashitbreakpoints_fuzzer/baseptspausedhashitbreakpoints_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedhashitbreakpoints_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/BUILD.gn index 10602bd5..f3562513 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedSetCallFramesFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/baseptspausedsetcallframes_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/baseptspausedsetcallframes_fuzzer.cpp index 463f315c..d6ac8eb3 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/baseptspausedsetcallframes_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetcallframes_fuzzer/baseptspausedsetcallframes_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedsetcallframes_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/BUILD.gn index 7e633ca6..1cbd9505 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedSetDataFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/baseptspausedsetdata_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/baseptspausedsetdata_fuzzer.cpp index 5aa349f8..540dec7e 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/baseptspausedsetdata_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetdata_fuzzer/baseptspausedsetdata_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedsetdata_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/BUILD.gn index c3e7bdd0..a9cd5bd1 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedSetHitBreakpointsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/baseptspausedsethitbreakpoints_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/baseptspausedsethitbreakpoints_fuzzer.cpp index bfdb6969..f83b6e49 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/baseptspausedsethitbreakpoints_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsethitbreakpoints_fuzzer/baseptspausedsethitbreakpoints_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedsethitbreakpoints_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/BUILD.gn b/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/BUILD.gn index d0fbca68..6ae3ab80 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/BUILD.gn +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("BasePtsPausedSetReasonFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/baseptspausedsetreason_fuzzer.cpp b/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/baseptspausedsetreason_fuzzer.cpp index f8cd8963..45f1466f 100644 --- a/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/baseptspausedsetreason_fuzzer.cpp +++ b/test/fuzztest/base/ptevents/paused/baseptspausedsetreason_fuzzer/baseptspausedsetreason_fuzzer.cpp @@ -15,8 +15,8 @@ #include "baseptspausedsetreason_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/base/pt_events.h" +#include "tooling/dispatcher.h" #include "test/fuzztest/common_fuzzer/common_fuzzer.h" using namespace panda; diff --git a/test/fuzztest/connectserversendmessage_fuzzer/BUILD.gn b/test/fuzztest/connectserversendmessage_fuzzer/BUILD.gn index 3ba7cd16..63d33cc7 100644 --- a/test/fuzztest/connectserversendmessage_fuzzer/BUILD.gn +++ b/test/fuzztest/connectserversendmessage_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ConnectServerSendMessageFuzzTest") { deps = [ "../../../inspector:connectserver_debugger", - "../../../tooling/dynamic:libark_ecma_debugger_set", + "../../../tooling:libark_ecma_debugger_set", ] # hiviewdfx libraries diff --git a/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/BUILD.gn b/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/BUILD.gn index 09787232..f2069056 100644 --- a/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/BUILD.gn +++ b/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/BUILD.gn @@ -33,7 +33,7 @@ ohos_fuzztest("DispatchResponseCreateCodeFuzzTest") { deps = [ "$toolchain_root/inspector:ark_debugger", "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling/dynamic:libark_ecma_debugger_set", + "$toolchain_root/tooling:libark_ecma_debugger_set", ] # hiviewdfx libraries diff --git a/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/dispatchresponsecreatecode_fuzzer.cpp b/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/dispatchresponsecreatecode_fuzzer.cpp index cc8a2ce0..d7c5dc69 100644 --- a/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/dispatchresponsecreatecode_fuzzer.cpp +++ b/test/fuzztest/dispatcher/dispatchresponsecreatecode_fuzzer/dispatchresponsecreatecode_fuzzer.cpp @@ -15,7 +15,7 @@ #include "dispatchresponsecreatecode_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/dispatcher.h" +#include "tooling/dispatcher.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/dispatchprotocolmessage_fuzzer/BUILD.gn b/test/fuzztest/dispatchprotocolmessage_fuzzer/BUILD.gn index 6f503087..8672956d 100644 --- a/test/fuzztest/dispatchprotocolmessage_fuzzer/BUILD.gn +++ b/test/fuzztest/dispatchprotocolmessage_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("DispatchProtocolMessageFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/dispatchprotocolmessage_fuzzer/dispatchprotocolmessage_fuzzer.cpp b/test/fuzztest/dispatchprotocolmessage_fuzzer/dispatchprotocolmessage_fuzzer.cpp index 850aa608..5aab5385 100644 --- a/test/fuzztest/dispatchprotocolmessage_fuzzer/dispatchprotocolmessage_fuzzer.cpp +++ b/test/fuzztest/dispatchprotocolmessage_fuzzer/dispatchprotocolmessage_fuzzer.cpp @@ -15,7 +15,7 @@ #include "dispatchprotocolmessage_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/debugger_service.h" +#include "tooling/debugger_service.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/initializedebugger_fuzzer/BUILD.gn b/test/fuzztest/initializedebugger_fuzzer/BUILD.gn index 2ecc6c96..37305f26 100644 --- a/test/fuzztest/initializedebugger_fuzzer/BUILD.gn +++ b/test/fuzztest/initializedebugger_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("InitializeDebuggerFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/initializedebugger_fuzzer/initializedebugger_fuzzer.cpp b/test/fuzztest/initializedebugger_fuzzer/initializedebugger_fuzzer.cpp index e0c64a0a..82bab1cd 100644 --- a/test/fuzztest/initializedebugger_fuzzer/initializedebugger_fuzzer.cpp +++ b/test/fuzztest/initializedebugger_fuzzer/initializedebugger_fuzzer.cpp @@ -15,7 +15,7 @@ #include "initializedebugger_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/debugger_service.h" +#include "tooling/debugger_service.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandler_fuzzer/BUILD.gn b/test/fuzztest/protocolhandler_fuzzer/BUILD.gn index a1ed4cd3..c549d1e6 100644 --- a/test/fuzztest/protocolhandler_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandler_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("ProtocolHandlerFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandler_fuzzer/protocolhandler_fuzzer.cpp b/test/fuzztest/protocolhandler_fuzzer/protocolhandler_fuzzer.cpp index 90ad22a9..96d67bdc 100644 --- a/test/fuzztest/protocolhandler_fuzzer/protocolhandler_fuzzer.cpp +++ b/test/fuzztest/protocolhandler_fuzzer/protocolhandler_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandler_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/BUILD.gn index 961fdc8a..04536415 100644 --- a/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ProtocolHandlerCreateErrorReplyFuzzTest") { configs = [ "../../../:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/protocolhandlercreateerrorreply_fuzzer.cpp b/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/protocolhandlercreateerrorreply_fuzzer.cpp index fc980ed9..7cdfc194 100644 --- a/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/protocolhandlercreateerrorreply_fuzzer.cpp +++ b/test/fuzztest/protocolhandlercreateerrorreply_fuzzer/protocolhandlercreateerrorreply_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlercreateerrorreply_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerdispatch_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerdispatch_fuzzer/BUILD.gn index bb4eabfd..b83cb1a6 100644 --- a/test/fuzztest/protocolhandlerdispatch_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerdispatch_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ProtocolHandlerDispatchFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerdispatch_fuzzer/protocolhandlerdispatch_fuzzer.cpp b/test/fuzztest/protocolhandlerdispatch_fuzzer/protocolhandlerdispatch_fuzzer.cpp index cd6b4c37..684a8b66 100644 --- a/test/fuzztest/protocolhandlerdispatch_fuzzer/protocolhandlerdispatch_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerdispatch_fuzzer/protocolhandlerdispatch_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerdispatch_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerget_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerget_fuzzer/BUILD.gn index d1360d4d..af643b64 100644 --- a/test/fuzztest/protocolhandlerget_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerget_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("ProtocolHandlerGetFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerget_fuzzer/protocolhandlerget_fuzzer.cpp b/test/fuzztest/protocolhandlerget_fuzzer/protocolhandlerget_fuzzer.cpp index fd6c5100..296da959 100644 --- a/test/fuzztest/protocolhandlerget_fuzzer/protocolhandlerget_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerget_fuzzer/protocolhandlerget_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerget_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlernotif_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlernotif_fuzzer/BUILD.gn index df505ac9..14ed840b 100644 --- a/test/fuzztest/protocolhandlernotif_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlernotif_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("ProtocolHandlerNotifFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlernotif_fuzzer/protocolhandlernotif_fuzzer.cpp b/test/fuzztest/protocolhandlernotif_fuzzer/protocolhandlernotif_fuzzer.cpp index 9e99a564..1d899ad4 100644 --- a/test/fuzztest/protocolhandlernotif_fuzzer/protocolhandlernotif_fuzzer.cpp +++ b/test/fuzztest/protocolhandlernotif_fuzzer/protocolhandlernotif_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlernotif_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerprocess_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerprocess_fuzzer/BUILD.gn index 9cef7ceb..2ffb9b0f 100644 --- a/test/fuzztest/protocolhandlerprocess_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerprocess_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ProtocolHandlerProcessFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerprocess_fuzzer/protocolhandlerprocess_fuzzer.cpp b/test/fuzztest/protocolhandlerprocess_fuzzer/protocolhandlerprocess_fuzzer.cpp index 52f6c13c..9945e632 100644 --- a/test/fuzztest/protocolhandlerprocess_fuzzer/protocolhandlerprocess_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerprocess_fuzzer/protocolhandlerprocess_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerprocess_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerresponse_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerresponse_fuzzer/BUILD.gn index 6e405852..579f4ce1 100644 --- a/test/fuzztest/protocolhandlerresponse_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerresponse_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ProtocolHandlerResponseFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerresponse_fuzzer/protocolhandlerresponse_fuzzer.cpp b/test/fuzztest/protocolhandlerresponse_fuzzer/protocolhandlerresponse_fuzzer.cpp index cb1becd3..76456f6a 100644 --- a/test/fuzztest/protocolhandlerresponse_fuzzer/protocolhandlerresponse_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerresponse_fuzzer/protocolhandlerresponse_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerresponse_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerrun_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerrun_fuzzer/BUILD.gn index 2632e92b..7c7d8476 100644 --- a/test/fuzztest/protocolhandlerrun_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerrun_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("ProtocolHandlerRunFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerrun_fuzzer/protocolhandlerrun_fuzzer.cpp b/test/fuzztest/protocolhandlerrun_fuzzer/protocolhandlerrun_fuzzer.cpp index 58494b76..72a781b7 100644 --- a/test/fuzztest/protocolhandlerrun_fuzzer/protocolhandlerrun_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerrun_fuzzer/protocolhandlerrun_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerrun_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlersendreply_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlersendreply_fuzzer/BUILD.gn index 18a4d526..6da3b1f6 100644 --- a/test/fuzztest/protocolhandlersendreply_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlersendreply_fuzzer/BUILD.gn @@ -31,7 +31,7 @@ ohos_fuzztest("ProtocolHandlerSendReplyFuzzTest") { configs = [ "../../../:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlersendreply_fuzzer/protocolhandlersendreply_fuzzer.cpp b/test/fuzztest/protocolhandlersendreply_fuzzer/protocolhandlersendreply_fuzzer.cpp index c4baed1a..d650a918 100644 --- a/test/fuzztest/protocolhandlersendreply_fuzzer/protocolhandlersendreply_fuzzer.cpp +++ b/test/fuzztest/protocolhandlersendreply_fuzzer/protocolhandlersendreply_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlersendreply_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/protocolhandlerwait_fuzzer/BUILD.gn b/test/fuzztest/protocolhandlerwait_fuzzer/BUILD.gn index d30fed65..72d365a7 100644 --- a/test/fuzztest/protocolhandlerwait_fuzzer/BUILD.gn +++ b/test/fuzztest/protocolhandlerwait_fuzzer/BUILD.gn @@ -30,7 +30,7 @@ ohos_fuzztest("ProtocolHandlerWaitFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/protocolhandlerwait_fuzzer/protocolhandlerwait_fuzzer.cpp b/test/fuzztest/protocolhandlerwait_fuzzer/protocolhandlerwait_fuzzer.cpp index fddecb75..51e930e5 100644 --- a/test/fuzztest/protocolhandlerwait_fuzzer/protocolhandlerwait_fuzzer.cpp +++ b/test/fuzztest/protocolhandlerwait_fuzzer/protocolhandlerwait_fuzzer.cpp @@ -15,7 +15,7 @@ #include "protocolhandlerwait_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesbreakpointparseid_fuzzer/BUILD.gn b/test/fuzztest/pttypesbreakpointparseid_fuzzer/BUILD.gn index c4395d7c..abb9e430 100644 --- a/test/fuzztest/pttypesbreakpointparseid_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesbreakpointparseid_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesBreakpointParseIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesbreakpointparseid_fuzzer/pttypesbreakpointparseid_fuzzer.cpp b/test/fuzztest/pttypesbreakpointparseid_fuzzer/pttypesbreakpointparseid_fuzzer.cpp index 1a9fee79..956f0005 100644 --- a/test/fuzztest/pttypesbreakpointparseid_fuzzer/pttypesbreakpointparseid_fuzzer.cpp +++ b/test/fuzztest/pttypesbreakpointparseid_fuzzer/pttypesbreakpointparseid_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesbreakpointparseid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesbreakpointtostring_fuzzer/BUILD.gn b/test/fuzztest/pttypesbreakpointtostring_fuzzer/BUILD.gn index 30f528cb..048cfa5d 100644 --- a/test/fuzztest/pttypesbreakpointtostring_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesbreakpointtostring_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesBreakpointToStringFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesbreakpointtostring_fuzzer/pttypesbreakpointtostring_fuzzer.cpp b/test/fuzztest/pttypesbreakpointtostring_fuzzer/pttypesbreakpointtostring_fuzzer.cpp index 8fda95bc..c77bbd53 100644 --- a/test/fuzztest/pttypesbreakpointtostring_fuzzer/pttypesbreakpointtostring_fuzzer.cpp +++ b/test/fuzztest/pttypesbreakpointtostring_fuzzer/pttypesbreakpointtostring_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesbreakpointtostring_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetails_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetails_fuzzer/BUILD.gn index cd5a4faf..54474374 100644 --- a/test/fuzztest/pttypesexceptiondetails_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetails_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesExceptionDetailsFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetails_fuzzer/pttypesexceptiondetails_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetails_fuzzer/pttypesexceptiondetails_fuzzer.cpp index 206602c0..e6c51055 100644 --- a/test/fuzztest/pttypesexceptiondetails_fuzzer/pttypesexceptiondetails_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetails_fuzzer/pttypesexceptiondetails_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetails_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/BUILD.gn index 84f51bb6..a64d2672 100644 --- a/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsColumnFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/pttypesexceptiondetailscolumn_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/pttypesexceptiondetailscolumn_fuzzer.cpp index fe7683cf..7e27654e 100644 --- a/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/pttypesexceptiondetailscolumn_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailscolumn_fuzzer/pttypesexceptiondetailscolumn_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailscolumn_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/BUILD.gn index 31f3de75..56eee19c 100644 --- a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsCreateFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp index b678267f..1732fa11 100644 --- a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailscreate_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/BUILD.gn index 7ca4304a..218ab781 100644 --- a/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsExceptionFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/pttypesexceptiondetailsexception_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/pttypesexceptiondetailsexception_fuzzer.cpp index ba1cdc71..dd3ffb24 100644 --- a/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/pttypesexceptiondetailsexception_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsexception_fuzzer/pttypesexceptiondetailsexception_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsexception_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/BUILD.gn index a4e90435..3c7f6291 100644 --- a/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsExceptionIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/pttypesexceptiondetailsexceptionid_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/pttypesexceptiondetailsexceptionid_fuzzer.cpp index b05e1379..4cd252a9 100644 --- a/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/pttypesexceptiondetailsexceptionid_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsexceptionid_fuzzer/pttypesexceptiondetailsexceptionid_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsexceptionid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/BUILD.gn index 3714b03a..9fbea5c1 100644 --- a/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsExecutionContextIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/pttypesexceptiondetailsexecutioncontextid_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/pttypesexceptiondetailsexecutioncontextid_fuzzer.cpp index 52538961..ca7b1ea8 100644 --- a/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/pttypesexceptiondetailsexecutioncontextid_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsexecutioncontextid_fuzzer/pttypesexceptiondetailsexecutioncontextid_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsexecutioncontextid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsline_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsline_fuzzer/BUILD.gn index 200fbd85..9fafdb77 100644 --- a/test/fuzztest/pttypesexceptiondetailsline_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsline_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesExceptionDetailsLineFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsline_fuzzer/pttypesexceptiondetailsline_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsline_fuzzer/pttypesexceptiondetailsline_fuzzer.cpp index f3b7f3ac..34b5c4f6 100644 --- a/test/fuzztest/pttypesexceptiondetailsline_fuzzer/pttypesexceptiondetailsline_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsline_fuzzer/pttypesexceptiondetailsline_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsline_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/BUILD.gn index b0438acf..07b6edf8 100644 --- a/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsScriptIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/pttypesexceptiondetailsscriptid_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/pttypesexceptiondetailsscriptid_fuzzer.cpp index 9b87c842..a8e568fc 100644 --- a/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/pttypesexceptiondetailsscriptid_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsscriptid_fuzzer/pttypesexceptiondetailsscriptid_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsscriptid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailstext_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailstext_fuzzer/BUILD.gn index 43b45c5d..c1dab620 100644 --- a/test/fuzztest/pttypesexceptiondetailstext_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailstext_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesExceptionDetailsTextFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailstext_fuzzer/pttypesexceptiondetailstext_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailstext_fuzzer/pttypesexceptiondetailstext_fuzzer.cpp index 2f77fa0d..a7449f7a 100644 --- a/test/fuzztest/pttypesexceptiondetailstext_fuzzer/pttypesexceptiondetailstext_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailstext_fuzzer/pttypesexceptiondetailstext_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailstext_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/BUILD.gn index b5d83f09..ad1e8f3c 100644 --- a/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesExceptionDetailsToJsonFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/pttypesexceptiondetailstojson_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/pttypesexceptiondetailstojson_fuzzer.cpp index 251968d0..315db3fc 100644 --- a/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/pttypesexceptiondetailstojson_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailstojson_fuzzer/pttypesexceptiondetailstojson_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailstojson_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/BUILD.gn b/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/BUILD.gn index 7f8b18ae..7bb26fcb 100644 --- a/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesExceptionDetailsUrlFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/pttypesexceptiondetailsurl_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/pttypesexceptiondetailsurl_fuzzer.cpp index bd170f26..c78a8bd5 100644 --- a/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/pttypesexceptiondetailsurl_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailsurl_fuzzer/pttypesexceptiondetailsurl_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesexceptiondetailsurl_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesfunctionremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesfunctionremoteobject_fuzzer/BUILD.gn index 1d0dcbbd..ef756c4d 100644 --- a/test/fuzztest/pttypesfunctionremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesfunctionremoteobject_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesFunctionRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesfunctionremoteobject_fuzzer/pttypesfunctionremoteobject_fuzzer.cpp b/test/fuzztest/pttypesfunctionremoteobject_fuzzer/pttypesfunctionremoteobject_fuzzer.cpp index 428c0d5b..287b9cbb 100644 --- a/test/fuzztest/pttypesfunctionremoteobject_fuzzer/pttypesfunctionremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesfunctionremoteobject_fuzzer/pttypesfunctionremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesfunctionremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/BUILD.gn index bfb449dc..241d7db3 100644 --- a/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesGeneratorFunctionRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/pttypesgeneratorfunctionremoteobject_fuzzer.cpp b/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/pttypesgeneratorfunctionremoteobject_fuzzer.cpp index 7e43efed..9b37098b 100644 --- a/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/pttypesgeneratorfunctionremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesgeneratorfunctionremoteobject_fuzzer/pttypesgeneratorfunctionremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesgeneratorfunctionremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesinternalpropertydesp_fuzzer/BUILD.gn b/test/fuzztest/pttypesinternalpropertydesp_fuzzer/BUILD.gn index 44894613..89046fab 100755 --- a/test/fuzztest/pttypesinternalpropertydesp_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesinternalpropertydesp_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesInternalPropertyDespFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesinternalpropertydesp_fuzzer/pttypesinternalpropertydesp_fuzzer.cpp b/test/fuzztest/pttypesinternalpropertydesp_fuzzer/pttypesinternalpropertydesp_fuzzer.cpp index d9dbc450..17542961 100755 --- a/test/fuzztest/pttypesinternalpropertydesp_fuzzer/pttypesinternalpropertydesp_fuzzer.cpp +++ b/test/fuzztest/pttypesinternalpropertydesp_fuzzer/pttypesinternalpropertydesp_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesinternalpropertydesp_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/BUILD.gn b/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/BUILD.gn index 042cc80e..42940a0f 100755 --- a/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesInternalPropertyDespCreateFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/pttypesinternalpropertydespcreate_fuzzer.cpp b/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/pttypesinternalpropertydespcreate_fuzzer.cpp index 43c8c08b..a89e9c2d 100755 --- a/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/pttypesinternalpropertydespcreate_fuzzer.cpp +++ b/test/fuzztest/pttypesinternalpropertydespcreate_fuzzer/pttypesinternalpropertydespcreate_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesinternalpropertydespcreate_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesinternalpropertydespname_fuzzer/BUILD.gn b/test/fuzztest/pttypesinternalpropertydespname_fuzzer/BUILD.gn index 3efbe6b7..1b367cae 100755 --- a/test/fuzztest/pttypesinternalpropertydespname_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesinternalpropertydespname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesInternalPropertyDespNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesinternalpropertydespname_fuzzer/pttypesinternalpropertydespname_fuzzer.cpp b/test/fuzztest/pttypesinternalpropertydespname_fuzzer/pttypesinternalpropertydespname_fuzzer.cpp index 0493eb23..25d6bafd 100755 --- a/test/fuzztest/pttypesinternalpropertydespname_fuzzer/pttypesinternalpropertydespname_fuzzer.cpp +++ b/test/fuzztest/pttypesinternalpropertydespname_fuzzer/pttypesinternalpropertydespname_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesinternalpropertydespname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/BUILD.gn b/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/BUILD.gn index ec2bb463..f3ebb61c 100755 --- a/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesInternalPropertyDespToJsonFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/pttypesinternalpropertydesptojson_fuzzer.cpp b/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/pttypesinternalpropertydesptojson_fuzzer.cpp index 1dd66de8..86599921 100755 --- a/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/pttypesinternalpropertydesptojson_fuzzer.cpp +++ b/test/fuzztest/pttypesinternalpropertydesptojson_fuzzer/pttypesinternalpropertydesptojson_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesinternalpropertydesptojson_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/BUILD.gn b/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/BUILD.gn index 24769ea8..5d78065c 100755 --- a/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesInternalPropertyDespValueFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/pttypesinternalpropertydespvalue_fuzzer.cpp b/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/pttypesinternalpropertydespvalue_fuzzer.cpp index 5848ac5d..5e5d04d4 100755 --- a/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/pttypesinternalpropertydespvalue_fuzzer.cpp +++ b/test/fuzztest/pttypesinternalpropertydespvalue_fuzzer/pttypesinternalpropertydespvalue_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesinternalpropertydespvalue_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesobjectremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesobjectremoteobject_fuzzer/BUILD.gn index dd59e470..71594b73 100644 --- a/test/fuzztest/pttypesobjectremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesobjectremoteobject_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesObjectRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesobjectremoteobject_fuzzer/pttypesobjectremoteobject_fuzzer.cpp b/test/fuzztest/pttypesobjectremoteobject_fuzzer/pttypesobjectremoteobject_fuzzer.cpp index 9d5f27c6..b713da6a 100644 --- a/test/fuzztest/pttypesobjectremoteobject_fuzzer/pttypesobjectremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesobjectremoteobject_fuzzer/pttypesobjectremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesobjectremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/BUILD.gn index 2bc2b3d8..d0a0b24c 100644 --- a/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrimitiveRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/pttypesprimitiveremoteobject_fuzzer.cpp b/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/pttypesprimitiveremoteobject_fuzzer.cpp index 75fafb63..a3d2e19c 100644 --- a/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/pttypesprimitiveremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesprimitiveremoteobject_fuzzer/pttypesprimitiveremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprimitiveremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydesp_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydesp_fuzzer/BUILD.gn index 86560f3e..7da5dac8 100755 --- a/test/fuzztest/pttypesprivatepropertydesp_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydesp_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydesp_fuzzer/pttypesprivatepropertydesp_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydesp_fuzzer/pttypesprivatepropertydesp_fuzzer.cpp index b3378828..c8e1f660 100755 --- a/test/fuzztest/pttypesprivatepropertydesp_fuzzer/pttypesprivatepropertydesp_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydesp_fuzzer/pttypesprivatepropertydesp_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydesp_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/BUILD.gn index 40420189..95c28c4e 100755 --- a/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespCreateFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/pttypesprivatepropertydespcreate_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/pttypesprivatepropertydespcreate_fuzzer.cpp index f0a759cb..5defa7f8 100755 --- a/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/pttypesprivatepropertydespcreate_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydespcreate_fuzzer/pttypesprivatepropertydespcreate_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydespcreate_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydespget_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydespget_fuzzer/BUILD.gn index 83bd7a53..1c11f543 100755 --- a/test/fuzztest/pttypesprivatepropertydespget_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydespget_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespGetFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydespget_fuzzer/pttypesprivatepropertydespget_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydespget_fuzzer/pttypesprivatepropertydespget_fuzzer.cpp index 2ec65355..278189ee 100755 --- a/test/fuzztest/pttypesprivatepropertydespget_fuzzer/pttypesprivatepropertydespget_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydespget_fuzzer/pttypesprivatepropertydespget_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydespget_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydespname_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydespname_fuzzer/BUILD.gn index e2b43785..7175b72f 100755 --- a/test/fuzztest/pttypesprivatepropertydespname_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydespname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydespname_fuzzer/pttypesprivatepropertydespname_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydespname_fuzzer/pttypesprivatepropertydespname_fuzzer.cpp index 7151c3f4..78ba2224 100755 --- a/test/fuzztest/pttypesprivatepropertydespname_fuzzer/pttypesprivatepropertydespname_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydespname_fuzzer/pttypesprivatepropertydespname_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydespname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydespset_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydespset_fuzzer/BUILD.gn index 10dbb54c..b613f04c 100755 --- a/test/fuzztest/pttypesprivatepropertydespset_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydespset_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespSetFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydespset_fuzzer/pttypesprivatepropertydespset_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydespset_fuzzer/pttypesprivatepropertydespset_fuzzer.cpp index c37c6933..4ad99271 100755 --- a/test/fuzztest/pttypesprivatepropertydespset_fuzzer/pttypesprivatepropertydespset_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydespset_fuzzer/pttypesprivatepropertydespset_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydespset_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/BUILD.gn index 8d757c8d..f8021301 100755 --- a/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespToJsonFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/pttypesprivatepropertydesptojson_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/pttypesprivatepropertydesptojson_fuzzer.cpp index 105b8710..12e81ae5 100755 --- a/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/pttypesprivatepropertydesptojson_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydesptojson_fuzzer/pttypesprivatepropertydesptojson_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydesptojson_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/BUILD.gn b/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/BUILD.gn index d98bdbab..f1a6c91a 100755 --- a/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesPrivatePropertyDespValueFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/pttypesprivatepropertydespvalue_fuzzer.cpp b/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/pttypesprivatepropertydespvalue_fuzzer.cpp index d3e505a5..3d66d082 100755 --- a/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/pttypesprivatepropertydespvalue_fuzzer.cpp +++ b/test/fuzztest/pttypesprivatepropertydespvalue_fuzzer/pttypesprivatepropertydespvalue_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesprivatepropertydespvalue_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobject_fuzzer/BUILD.gn index fdd5ea37..d5b61116 100644 --- a/test/fuzztest/pttypesremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobject_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobject_fuzzer/pttypesremoteobject_fuzzer.cpp b/test/fuzztest/pttypesremoteobject_fuzzer/pttypesremoteobject_fuzzer.cpp index 68334f08..9662e823 100644 --- a/test/fuzztest/pttypesremoteobject_fuzzer/pttypesremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobject_fuzzer/pttypesremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectdescription_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectdescription_fuzzer/BUILD.gn index 0c46de8b..73cbd20b 100644 --- a/test/fuzztest/pttypesremoteobjectdescription_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectdescription_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectDescriptionFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectdescription_fuzzer/pttypesremoteobjectdescription_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectdescription_fuzzer/pttypesremoteobjectdescription_fuzzer.cpp index d554f61f..e9540031 100644 --- a/test/fuzztest/pttypesremoteobjectdescription_fuzzer/pttypesremoteobjectdescription_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectdescription_fuzzer/pttypesremoteobjectdescription_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectdescription_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/BUILD.gn index c8c9d1b1..4943fb74 100644 --- a/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectGetClassNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/pttypesremoteobjectgetclassname_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/pttypesremoteobjectgetclassname_fuzzer.cpp index 71b4d36d..79d5d464 100644 --- a/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/pttypesremoteobjectgetclassname_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectgetclassname_fuzzer/pttypesremoteobjectgetclassname_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectgetclassname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/BUILD.gn index 4671dace..ae118211 100644 --- a/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectGetSubTypeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/pttypesremoteobjectgetsubtype_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/pttypesremoteobjectgetsubtype_fuzzer.cpp index 8c465029..3ac620a7 100644 --- a/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/pttypesremoteobjectgetsubtype_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectgetsubtype_fuzzer/pttypesremoteobjectgetsubtype_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectgetsubtype_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectgettype_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectgettype_fuzzer/BUILD.gn index cef42cfc..e52962f2 100644 --- a/test/fuzztest/pttypesremoteobjectgettype_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectgettype_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectGetTypeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectgettype_fuzzer/pttypesremoteobjectgettype_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectgettype_fuzzer/pttypesremoteobjectgettype_fuzzer.cpp index 99cd8446..c5f7d02d 100644 --- a/test/fuzztest/pttypesremoteobjectgettype_fuzzer/pttypesremoteobjectgettype_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectgettype_fuzzer/pttypesremoteobjectgettype_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectgettype_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/BUILD.gn index f8c7d18b..586d7544 100644 --- a/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectGetValueFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/pttypesremoteobjectgetvalue_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/pttypesremoteobjectgetvalue_fuzzer.cpp index 05a55562..761a78d2 100644 --- a/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/pttypesremoteobjectgetvalue_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectgetvalue_fuzzer/pttypesremoteobjectgetvalue_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectgetvalue_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/BUILD.gn index 426b9ced..3384d912 100644 --- a/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectHasClassNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/pttypesremoteobjecthasclassname_fuzzer.cpp b/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/pttypesremoteobjecthasclassname_fuzzer.cpp index dc5d93b7..f560041e 100644 --- a/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/pttypesremoteobjecthasclassname_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjecthasclassname_fuzzer/pttypesremoteobjecthasclassname_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjecthasclassname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/BUILD.gn index 83c1a086..40c34ddc 100644 --- a/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectHasSubTypeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/pttypesremoteobjecthassubtype_fuzzer.cpp b/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/pttypesremoteobjecthassubtype_fuzzer.cpp index 691cc84e..d34ce6e5 100644 --- a/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/pttypesremoteobjecthassubtype_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjecthassubtype_fuzzer/pttypesremoteobjecthassubtype_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjecthassubtype_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/BUILD.gn index f9341543..51dd9403 100644 --- a/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectObjectIdFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/pttypesremoteobjectobjectid_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/pttypesremoteobjectobjectid_fuzzer.cpp index a6b94f71..acc9b5df 100644 --- a/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/pttypesremoteobjectobjectid_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectobjectid_fuzzer/pttypesremoteobjectobjectid_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectobjectid_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/BUILD.gn index d1ac7795..6713f370 100644 --- a/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectSetClassNameFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/pttypesremoteobjectsetclassname_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/pttypesremoteobjectsetclassname_fuzzer.cpp index 5a67820b..04321ac6 100644 --- a/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/pttypesremoteobjectsetclassname_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectsetclassname_fuzzer/pttypesremoteobjectsetclassname_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectsetclassname_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/BUILD.gn index 2170c831..f3dc9067 100644 --- a/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectSetSubTypeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/pttypesremoteobjectsetsubtype_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/pttypesremoteobjectsetsubtype_fuzzer.cpp index 98f1c221..10303309 100644 --- a/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/pttypesremoteobjectsetsubtype_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectsetsubtype_fuzzer/pttypesremoteobjectsetsubtype_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectsetsubtype_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectsettype_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectsettype_fuzzer/BUILD.gn index 31360070..7618fd32 100644 --- a/test/fuzztest/pttypesremoteobjectsettype_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectsettype_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectSetTypeFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectsettype_fuzzer/pttypesremoteobjectsettype_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectsettype_fuzzer/pttypesremoteobjectsettype_fuzzer.cpp index 18bbf0b7..bf0fcbdb 100644 --- a/test/fuzztest/pttypesremoteobjectsettype_fuzzer/pttypesremoteobjectsettype_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectsettype_fuzzer/pttypesremoteobjectsettype_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectsettype_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/BUILD.gn index bbf55d88..f9ec5017 100644 --- a/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesRemoteObjectSetValueFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/pttypesremoteobjectsetvalue_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/pttypesremoteobjectsetvalue_fuzzer.cpp index 3a007512..95f67506 100644 --- a/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/pttypesremoteobjectsetvalue_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectsetvalue_fuzzer/pttypesremoteobjectsetvalue_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectsetvalue_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/BUILD.gn b/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/BUILD.gn index c1a64213..404a77f0 100644 --- a/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/BUILD.gn @@ -27,7 +27,7 @@ ohos_fuzztest("PtTypesRemoteObjectUnserializableValueFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/pttypesremoteobjectunserializablevalue_fuzzer.cpp b/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/pttypesremoteobjectunserializablevalue_fuzzer.cpp index 616cf507..bdb58e7b 100644 --- a/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/pttypesremoteobjectunserializablevalue_fuzzer.cpp +++ b/test/fuzztest/pttypesremoteobjectunserializablevalue_fuzzer/pttypesremoteobjectunserializablevalue_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesremoteobjectunserializablevalue_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypesstringremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypesstringremoteobject_fuzzer/BUILD.gn index 51a77f79..ea1de604 100644 --- a/test/fuzztest/pttypesstringremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypesstringremoteobject_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesStringRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypesstringremoteobject_fuzzer/pttypesstringremoteobject_fuzzer.cpp b/test/fuzztest/pttypesstringremoteobject_fuzzer/pttypesstringremoteobject_fuzzer.cpp index 7406438f..e2243648 100644 --- a/test/fuzztest/pttypesstringremoteobject_fuzzer/pttypesstringremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypesstringremoteobject_fuzzer/pttypesstringremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypesstringremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/pttypessymbolremoteobject_fuzzer/BUILD.gn b/test/fuzztest/pttypessymbolremoteobject_fuzzer/BUILD.gn index 8a972645..958ffd8b 100644 --- a/test/fuzztest/pttypessymbolremoteobject_fuzzer/BUILD.gn +++ b/test/fuzztest/pttypessymbolremoteobject_fuzzer/BUILD.gn @@ -28,7 +28,7 @@ ohos_fuzztest("PtTypesSymbolRemoteObjectFuzzTest") { configs = [ "//arkcompiler/toolchain:toolchain_test_config" ] - deps = [ "../../../tooling/dynamic:libark_ecma_debugger_set" ] + deps = [ "../../../tooling:libark_ecma_debugger_set" ] # hiviewdfx libraries external_deps = hiviewdfx_ext_deps diff --git a/test/fuzztest/pttypessymbolremoteobject_fuzzer/pttypessymbolremoteobject_fuzzer.cpp b/test/fuzztest/pttypessymbolremoteobject_fuzzer/pttypessymbolremoteobject_fuzzer.cpp index 95bec9d2..d64368c0 100644 --- a/test/fuzztest/pttypessymbolremoteobject_fuzzer/pttypessymbolremoteobject_fuzzer.cpp +++ b/test/fuzztest/pttypessymbolremoteobject_fuzzer/pttypessymbolremoteobject_fuzzer.cpp @@ -15,7 +15,7 @@ #include "pttypessymbolremoteobject_fuzzer.h" #include "ecmascript/napi/include/jsnapi.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using namespace panda; using namespace panda::ecmascript; diff --git a/test/fuzztest/wsserver/wsserversendreply_fuzzer/BUILD.gn b/test/fuzztest/wsserver/wsserversendreply_fuzzer/BUILD.gn index ef50d094..b2ed5463 100644 --- a/test/fuzztest/wsserver/wsserversendreply_fuzzer/BUILD.gn +++ b/test/fuzztest/wsserver/wsserversendreply_fuzzer/BUILD.gn @@ -32,7 +32,7 @@ ohos_fuzztest("WsServerSendReplyFuzzTest") { deps = [ "$toolchain_root/inspector:ark_debugger", "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling/dynamic:libark_ecma_debugger_set", + "$toolchain_root/tooling:libark_ecma_debugger_set", ] # hiviewdfx libraries diff --git a/test/resource/tooling/ohos_test.xml b/test/resource/tooling/ohos_test.xml index 42a7fc11..b26b1407 100755 --- a/test/resource/tooling/ohos_test.xml +++ b/test/resource/tooling/ohos_test.xml @@ -15,110 +15,110 @@ - - - - diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index a3d5d094..4b3cacdc 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2025 Huawei Device Co., Ltd. +# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -13,31 +13,169 @@ import("../toolchain.gni") +config("ark_ecma_debugger_config") { + configs = [ "..:ark_toolchain_common_config" ] + + include_dirs = [ "." ] +} + +debugger_sources = [ + "../common/log_wrapper.cpp", + "agent/animation_impl.cpp", + "agent/css_impl.cpp", + "agent/debugger_impl.cpp", + "agent/dom_impl.cpp", + "agent/overlay_impl.cpp", + "agent/page_impl.cpp", + "agent/runtime_impl.cpp", + "agent/target_impl.cpp", + "agent/tracing_impl.cpp", + "backend/debugger_executor.cpp", + "backend/js_pt_hooks.cpp", + "backend/js_single_stepper.cpp", + "base/pt_base64.cpp", + "base/pt_events.cpp", + "base/pt_json.cpp", + "base/pt_params.cpp", + "base/pt_returns.cpp", + "base/pt_script.cpp", + "base/pt_types.cpp", + "debugger_service.cpp", + "dispatcher.cpp", + "protocol_handler.cpp", + "utils/utils.cpp", +] +if (!is_mingw && !is_mac && target_os != "ios") { + debugger_sources += [ + "agent/heapprofiler_impl.cpp", + "agent/profiler_impl.cpp", + ] +} + +ohos_source_set("libark_ecma_debugger_set") { + stack_protector_ret = true + sources = debugger_sources + + public_configs = [ ":ark_ecma_debugger_config" ] + + defines = [] + deps = [] + external_deps = [] + if (defined(ark_hybrid) && ark_hybrid) { + external_deps += [ "runtime_core:libarkruntime" ] + } else { + external_deps += [ "ets_runtime:libark_jsruntime" ] + } + if (is_arkui_x && target_os == "ios") { + sources -= [ "../common/log_wrapper.cpp" ] + external_deps += [ "cJSON:cjson_static" ] + } else { + external_deps += [ "cJSON:cjson" ] + } + external_deps += [ + "icu:shared_icuuc", + "libuv:uv", + ] + + if (is_ohos && is_standard_system && !is_arkui_x) { + defines += [ "ENABLE_FFRT_INTERFACES" ] + external_deps += [ "ffrt:libffrt" ] + } + + # hiviewdfx libraries + external_deps += hiviewdfx_ext_deps + + external_deps += [ "runtime_core:libarkfile_static" ] + deps += hiviewdfx_deps + + if (enable_leak_check) { + sources += [ "$js_root/ecmascript/dfx/native_dfx/backtrace.cpp" ] + defines += [ + "ECMASCRIPT_ENABLE_HANDLE_LEAK_CHECK", + "ECMASCRIPT_ENABLE_GLOBAL_LEAK_CHECK", + ] + } + + cflags_cc = [ "-fvisibility=hidden" ] + subsystem_name = "arkcompiler" + part_name = "toolchain" +} + ohos_shared_library("libark_ecma_debugger") { stack_protector_ret = true - deps = [ "./dynamic/:libark_ecma_debugger_static" ] + deps = [ ":libark_ecma_debugger_set" ] + external_deps = [ "libuv:uv" ] + if (is_mac) { + external_deps += [ "cJSON:cjson_static" ] + } + install_enable = true - if (is_mingw || is_win) { - output_extension = "dll" + # hiviewdfx libraries + external_deps += hiviewdfx_ext_deps + if (enable_hilog) { + external_deps += [ "hilog:libhilog" ] + } + if (!is_arkui_x) { + if (defined(ark_hybrid) && ark_hybrid) { + external_deps += [ "runtime_core:libarkruntime" ] + } else { + external_deps += [ "ets_runtime:libark_jsruntime" ] + } } else { + if (defined(ark_hybrid) && ark_hybrid) { + deps += [ "../../runtime_core:libarkruntime" ] + } else { + deps += [ "../../ets_runtime:libark_jsruntime" ] + } + } + deps += hiviewdfx_deps + + if (!is_mingw && !is_mac) { output_extension = "so" } - part_name = "toolchain" + if (!is_standard_system) { + relative_install_dir = "ark" + } subsystem_name = "arkcompiler" + part_name = "toolchain" output_name = "libark_tooling" } -ohos_shared_library("libark_tooling_plus") { - deps = [ "./static/:libark_tooling_plus_static" ] +ohos_static_library("libark_ecma_debugger_test") { + testonly = true + stack_protector_ret = true + sources = debugger_sources + + public_configs = [ ":ark_ecma_debugger_config" ] - if (is_mingw || is_win) { - output_extension = "dll" + defines = [ "OHOS_UNIT_TEST" ] + deps = [] + external_deps = [ + "icu:shared_icuuc", + "libuv:uv", + ] + if (defined(ark_hybrid) && ark_hybrid) { + external_deps += [ "runtime_core:libarkruntime" ] + } else { + external_deps += [ "ets_runtime:libark_jsruntime" ] + } + if ((is_arkui_x && target_os == "ios") || target_os == "mac") { + external_deps += [ "cJSON:cjson_static" ] } else { + external_deps += [ "cJSON:cjson" ] + } + + # hiviewdfx libraries + external_deps += hiviewdfx_ext_deps + deps += hiviewdfx_deps + if (enable_hilog) { + external_deps += [ "hilog:libhilog" ] + } + + if (!is_mingw && !is_mac) { output_extension = "so" } - part_name = "toolchain" - subsystem_name = "arkcompiler" + subsystem_name = "test" } - diff --git a/tooling/dynamic/agent/animation_impl.cpp b/tooling/agent/animation_impl.cpp similarity index 100% rename from tooling/dynamic/agent/animation_impl.cpp rename to tooling/agent/animation_impl.cpp diff --git a/tooling/dynamic/agent/animation_impl.h b/tooling/agent/animation_impl.h similarity index 100% rename from tooling/dynamic/agent/animation_impl.h rename to tooling/agent/animation_impl.h diff --git a/tooling/dynamic/agent/css_impl.cpp b/tooling/agent/css_impl.cpp similarity index 100% rename from tooling/dynamic/agent/css_impl.cpp rename to tooling/agent/css_impl.cpp diff --git a/tooling/dynamic/agent/css_impl.h b/tooling/agent/css_impl.h similarity index 100% rename from tooling/dynamic/agent/css_impl.h rename to tooling/agent/css_impl.h diff --git a/tooling/dynamic/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp similarity index 99% rename from tooling/dynamic/agent/debugger_impl.cpp rename to tooling/agent/debugger_impl.cpp index 2a5b5015..54716095 100755 --- a/tooling/dynamic/agent/debugger_impl.cpp +++ b/tooling/agent/debugger_impl.cpp @@ -15,7 +15,7 @@ #include "agent/debugger_impl.h" -#include "tooling/dynamic/base/pt_base64.h" +#include "tooling/base/pt_base64.h" #include "backend/debugger_executor.h" #include "protocol_handler.h" diff --git a/tooling/dynamic/agent/debugger_impl.h b/tooling/agent/debugger_impl.h similarity index 99% rename from tooling/dynamic/agent/debugger_impl.h rename to tooling/agent/debugger_impl.h index 4c104938..c3a0ddad 100644 --- a/tooling/dynamic/agent/debugger_impl.h +++ b/tooling/agent/debugger_impl.h @@ -18,7 +18,7 @@ #include "agent/runtime_impl.h" #include "backend/js_pt_hooks.h" -#include "tooling/dynamic/base/pt_params.h" +#include "tooling/base/pt_params.h" #include "backend/js_single_stepper.h" #include "dispatcher.h" diff --git a/tooling/dynamic/agent/dom_impl.cpp b/tooling/agent/dom_impl.cpp similarity index 100% rename from tooling/dynamic/agent/dom_impl.cpp rename to tooling/agent/dom_impl.cpp diff --git a/tooling/dynamic/agent/dom_impl.h b/tooling/agent/dom_impl.h similarity index 100% rename from tooling/dynamic/agent/dom_impl.h rename to tooling/agent/dom_impl.h diff --git a/tooling/dynamic/agent/heapprofiler_impl.cpp b/tooling/agent/heapprofiler_impl.cpp similarity index 100% rename from tooling/dynamic/agent/heapprofiler_impl.cpp rename to tooling/agent/heapprofiler_impl.cpp diff --git a/tooling/dynamic/agent/heapprofiler_impl.h b/tooling/agent/heapprofiler_impl.h similarity index 98% rename from tooling/dynamic/agent/heapprofiler_impl.h rename to tooling/agent/heapprofiler_impl.h index 04f1acd2..767bc6f5 100644 --- a/tooling/dynamic/agent/heapprofiler_impl.h +++ b/tooling/agent/heapprofiler_impl.h @@ -20,9 +20,9 @@ #include #endif -#include "tooling/dynamic/base/pt_params.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_params.h" +#include "tooling/base/pt_events.h" +#include "tooling/base/pt_returns.h" #include "dispatcher.h" #include "protocol_handler.h" #include "protocol_channel.h" diff --git a/tooling/dynamic/agent/overlay_impl.cpp b/tooling/agent/overlay_impl.cpp similarity index 100% rename from tooling/dynamic/agent/overlay_impl.cpp rename to tooling/agent/overlay_impl.cpp diff --git a/tooling/dynamic/agent/overlay_impl.h b/tooling/agent/overlay_impl.h similarity index 100% rename from tooling/dynamic/agent/overlay_impl.h rename to tooling/agent/overlay_impl.h diff --git a/tooling/dynamic/agent/page_impl.cpp b/tooling/agent/page_impl.cpp similarity index 100% rename from tooling/dynamic/agent/page_impl.cpp rename to tooling/agent/page_impl.cpp diff --git a/tooling/dynamic/agent/page_impl.h b/tooling/agent/page_impl.h similarity index 100% rename from tooling/dynamic/agent/page_impl.h rename to tooling/agent/page_impl.h diff --git a/tooling/dynamic/agent/profiler_impl.cpp b/tooling/agent/profiler_impl.cpp similarity index 100% rename from tooling/dynamic/agent/profiler_impl.cpp rename to tooling/agent/profiler_impl.cpp diff --git a/tooling/dynamic/agent/profiler_impl.h b/tooling/agent/profiler_impl.h similarity index 97% rename from tooling/dynamic/agent/profiler_impl.h rename to tooling/agent/profiler_impl.h index 4361e413..e953baca 100644 --- a/tooling/dynamic/agent/profiler_impl.h +++ b/tooling/agent/profiler_impl.h @@ -16,8 +16,8 @@ #ifndef ECMASCRIPT_TOOLING_AGENT_PROFILER_IMPL_H #define ECMASCRIPT_TOOLING_AGENT_PROFILER_IMPL_H -#include "tooling/dynamic/base/pt_params.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_params.h" +#include "tooling/base/pt_returns.h" #include "dispatcher.h" #include "ecmascript/dfx/cpu_profiler/samples_record.h" diff --git a/tooling/dynamic/agent/runtime_impl.cpp b/tooling/agent/runtime_impl.cpp similarity index 100% rename from tooling/dynamic/agent/runtime_impl.cpp rename to tooling/agent/runtime_impl.cpp diff --git a/tooling/dynamic/agent/runtime_impl.h b/tooling/agent/runtime_impl.h similarity index 99% rename from tooling/dynamic/agent/runtime_impl.h rename to tooling/agent/runtime_impl.h index c8b32ea2..0c40beb6 100644 --- a/tooling/dynamic/agent/runtime_impl.h +++ b/tooling/agent/runtime_impl.h @@ -17,7 +17,7 @@ #define ECMASCRIPT_TOOLING_AGENT_RUNTIME_IMPL_H -#include "tooling/dynamic/base/pt_params.h" +#include "tooling/base/pt_params.h" #include "dispatcher.h" #include "libpandabase/macros.h" diff --git a/tooling/dynamic/agent/target_impl.cpp b/tooling/agent/target_impl.cpp similarity index 100% rename from tooling/dynamic/agent/target_impl.cpp rename to tooling/agent/target_impl.cpp diff --git a/tooling/dynamic/agent/target_impl.h b/tooling/agent/target_impl.h similarity index 100% rename from tooling/dynamic/agent/target_impl.h rename to tooling/agent/target_impl.h diff --git a/tooling/dynamic/agent/tracing_impl.cpp b/tooling/agent/tracing_impl.cpp similarity index 100% rename from tooling/dynamic/agent/tracing_impl.cpp rename to tooling/agent/tracing_impl.cpp diff --git a/tooling/dynamic/agent/tracing_impl.h b/tooling/agent/tracing_impl.h similarity index 97% rename from tooling/dynamic/agent/tracing_impl.h rename to tooling/agent/tracing_impl.h index 65f730fd..0b050c0f 100644 --- a/tooling/dynamic/agent/tracing_impl.h +++ b/tooling/agent/tracing_impl.h @@ -20,8 +20,8 @@ #include #endif -#include "tooling/dynamic/base/pt_params.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_params.h" +#include "tooling/base/pt_returns.h" #include "dispatcher.h" #include "ecmascript/dfx/cpu_profiler/samples_record.h" diff --git a/tooling/dynamic/backend/debugger_executor.cpp b/tooling/backend/debugger_executor.cpp similarity index 99% rename from tooling/dynamic/backend/debugger_executor.cpp rename to tooling/backend/debugger_executor.cpp index 945e6c37..c7d2a6c0 100644 --- a/tooling/dynamic/backend/debugger_executor.cpp +++ b/tooling/backend/debugger_executor.cpp @@ -16,7 +16,7 @@ #include "backend/debugger_executor.h" #include "ecmascript/debugger/js_debugger_manager.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" namespace panda::ecmascript::tooling { void DebuggerExecutor::Initialize(const EcmaVM *vm) diff --git a/tooling/dynamic/backend/debugger_executor.h b/tooling/backend/debugger_executor.h similarity index 100% rename from tooling/dynamic/backend/debugger_executor.h rename to tooling/backend/debugger_executor.h diff --git a/tooling/dynamic/backend/js_pt_hooks.cpp b/tooling/backend/js_pt_hooks.cpp similarity index 100% rename from tooling/dynamic/backend/js_pt_hooks.cpp rename to tooling/backend/js_pt_hooks.cpp diff --git a/tooling/dynamic/backend/js_pt_hooks.h b/tooling/backend/js_pt_hooks.h similarity index 95% rename from tooling/dynamic/backend/js_pt_hooks.h rename to tooling/backend/js_pt_hooks.h index 814670d8..58c76e4f 100644 --- a/tooling/dynamic/backend/js_pt_hooks.h +++ b/tooling/backend/js_pt_hooks.h @@ -16,8 +16,8 @@ #ifndef ECMASCRIPT_TOOLING_BACKEND_JS_PT_HOOKS_H #define ECMASCRIPT_TOOLING_BACKEND_JS_PT_HOOKS_H -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/base/pt_script.h" +#include "tooling/base/pt_events.h" +#include "tooling/base/pt_script.h" #include "ecmascript/debugger/js_debugger_interface.h" #include "libpandabase/macros.h" diff --git a/tooling/dynamic/backend/js_single_stepper.cpp b/tooling/backend/js_single_stepper.cpp similarity index 100% rename from tooling/dynamic/backend/js_single_stepper.cpp rename to tooling/backend/js_single_stepper.cpp diff --git a/tooling/dynamic/backend/js_single_stepper.h b/tooling/backend/js_single_stepper.h similarity index 100% rename from tooling/dynamic/backend/js_single_stepper.h rename to tooling/backend/js_single_stepper.h diff --git a/tooling/dynamic/base/pt_base64.cpp b/tooling/base/pt_base64.cpp similarity index 99% rename from tooling/dynamic/base/pt_base64.cpp rename to tooling/base/pt_base64.cpp index f8f954a8..e50920de 100644 --- a/tooling/dynamic/base/pt_base64.cpp +++ b/tooling/base/pt_base64.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_base64.h" +#include "tooling/base/pt_base64.h" namespace panda::ecmascript::tooling { static const unsigned char DECODE_TABLE[] = { diff --git a/tooling/dynamic/base/pt_base64.h b/tooling/base/pt_base64.h similarity index 100% rename from tooling/dynamic/base/pt_base64.h rename to tooling/base/pt_base64.h diff --git a/tooling/dynamic/base/pt_events.cpp b/tooling/base/pt_events.cpp similarity index 99% rename from tooling/dynamic/base/pt_events.cpp rename to tooling/base/pt_events.cpp index 10269228..f3a4e608 100644 --- a/tooling/dynamic/base/pt_events.cpp +++ b/tooling/base/pt_events.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_events.h" +#include "tooling/base/pt_events.h" namespace panda::ecmascript::tooling { std::unique_ptr BreakpointResolved::ToJson() const diff --git a/tooling/dynamic/base/pt_events.h b/tooling/base/pt_events.h similarity index 99% rename from tooling/dynamic/base/pt_events.h rename to tooling/base/pt_events.h index 15d7e449..9d1bea7e 100644 --- a/tooling/dynamic/base/pt_events.h +++ b/tooling/base/pt_events.h @@ -20,8 +20,8 @@ #include #include "ecmascript/dfx/tracing/tracing.h" -#include "tooling/dynamic/base/pt_script.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_script.h" +#include "tooling/base/pt_types.h" #include "dispatcher.h" #include "libpandabase/macros.h" diff --git a/tooling/dynamic/base/pt_json.cpp b/tooling/base/pt_json.cpp similarity index 99% rename from tooling/dynamic/base/pt_json.cpp rename to tooling/base/pt_json.cpp index a1ce3f47..71fee1a1 100644 --- a/tooling/dynamic/base/pt_json.cpp +++ b/tooling/base/pt_json.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" namespace panda::ecmascript::tooling { std::unique_ptr PtJson::CreateObject() diff --git a/tooling/dynamic/base/pt_json.h b/tooling/base/pt_json.h similarity index 100% rename from tooling/dynamic/base/pt_json.h rename to tooling/base/pt_json.h diff --git a/tooling/dynamic/base/pt_params.cpp b/tooling/base/pt_params.cpp similarity index 97% rename from tooling/dynamic/base/pt_params.cpp rename to tooling/base/pt_params.cpp index f67598de..3f5934db 100644 --- a/tooling/dynamic/base/pt_params.cpp +++ b/tooling/base/pt_params.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_params.h" +#include "tooling/base/pt_params.h" namespace panda::ecmascript::tooling { std::unique_ptr EnableParams::Create(const PtJson ¶ms) diff --git a/tooling/dynamic/base/pt_params.h b/tooling/base/pt_params.h similarity index 99% rename from tooling/dynamic/base/pt_params.h rename to tooling/base/pt_params.h index be7780a8..404616ef 100644 --- a/tooling/dynamic/base/pt_params.h +++ b/tooling/base/pt_params.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_BASE_PT_PARAMS_H #define ECMASCRIPT_TOOLING_BASE_PT_PARAMS_H -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" namespace panda::ecmascript::tooling { class PtBaseParams : public PtBaseTypes { diff --git a/tooling/dynamic/base/pt_returns.cpp b/tooling/base/pt_returns.cpp similarity index 99% rename from tooling/dynamic/base/pt_returns.cpp rename to tooling/base/pt_returns.cpp index 63c1090c..b53355b1 100644 --- a/tooling/dynamic/base/pt_returns.cpp +++ b/tooling/base/pt_returns.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_returns.h" namespace panda::ecmascript::tooling { std::unique_ptr DebuggerEnableReturns::ToJson() const diff --git a/tooling/dynamic/base/pt_returns.h b/tooling/base/pt_returns.h similarity index 99% rename from tooling/dynamic/base/pt_returns.h rename to tooling/base/pt_returns.h index d6555809..d9dfa1ef 100644 --- a/tooling/dynamic/base/pt_returns.h +++ b/tooling/base/pt_returns.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_BASE_PT_RETURNS_H #define ECMASCRIPT_TOOLING_BASE_PT_RETURNS_H -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" namespace panda::ecmascript::tooling { class PtBaseReturns : public PtBaseTypes { diff --git a/tooling/dynamic/base/pt_script.cpp b/tooling/base/pt_script.cpp similarity index 95% rename from tooling/dynamic/base/pt_script.cpp rename to tooling/base/pt_script.cpp index 5d2debde..79db193f 100644 --- a/tooling/dynamic/base/pt_script.cpp +++ b/tooling/base/pt_script.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_script.h" +#include "tooling/base/pt_script.h" namespace panda::ecmascript::tooling { PtScript::PtScript(ScriptId scriptId, const std::string &fileName, const std::string &url, const std::string &source) diff --git a/tooling/dynamic/base/pt_script.h b/tooling/base/pt_script.h similarity index 98% rename from tooling/dynamic/base/pt_script.h rename to tooling/base/pt_script.h index d4d565f0..2d797e2b 100644 --- a/tooling/dynamic/base/pt_script.h +++ b/tooling/base/pt_script.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_BASE_PT_SCRIPT_H #define ECMASCRIPT_TOOLING_BASE_PT_SCRIPT_H -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" #include "libpandabase/macros.h" diff --git a/tooling/dynamic/base/pt_types.cpp b/tooling/base/pt_types.cpp similarity index 99% rename from tooling/dynamic/base/pt_types.cpp rename to tooling/base/pt_types.cpp index 5c6d3ba1..7bf2d88d 100644 --- a/tooling/dynamic/base/pt_types.cpp +++ b/tooling/base/pt_types.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" #include "ecmascript/napi/jsnapi_helper.h" #include "ecmascript/debugger/js_debugger.h" diff --git a/tooling/dynamic/base/pt_types.h b/tooling/base/pt_types.h similarity index 99% rename from tooling/dynamic/base/pt_types.h rename to tooling/base/pt_types.h index 682de66f..39efb84e 100644 --- a/tooling/dynamic/base/pt_types.h +++ b/tooling/base/pt_types.h @@ -21,8 +21,8 @@ #include "common/macros.h" -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/utils/utils.h" +#include "tooling/base/pt_json.h" +#include "tooling/utils/utils.h" #include "ecmascript/debugger/debugger_api.h" #include "ecmascript/dfx/cpu_profiler/samples_record.h" diff --git a/tooling/dynamic/client/BUILD.gn b/tooling/client/BUILD.gn similarity index 91% rename from tooling/dynamic/client/BUILD.gn rename to tooling/client/BUILD.gn index 27f1091a..c41d6979 100644 --- a/tooling/dynamic/client/BUILD.gn +++ b/tooling/client/BUILD.gn @@ -28,6 +28,7 @@ ohos_source_set("libark_client_set") { ] sources = [ + "../utils/utils.cpp", "domain/debugger_client.cpp", "domain/heapprofiler_client.cpp", "domain/profiler_client.cpp", @@ -46,6 +47,7 @@ ohos_source_set("libark_client_set") { deps += [ "$toolchain_root/websocket:websocket_client", + "..:libark_ecma_debugger", ] external_deps += [ @@ -61,7 +63,7 @@ ohos_source_set("libark_client_set") { external_deps += [ "ets_runtime:libark_jsruntime" ] } - configs = [ "../../..:ark_toolchain_common_config" ] + configs = [ "../..:ark_toolchain_common_config" ] cflags_cc = [ "-Wno-vla-extension" ] @@ -71,10 +73,7 @@ ohos_source_set("libark_client_set") { ohos_shared_library("libark_client") { stack_protector_ret = true - deps = [ - ":libark_client_set", - "../:libark_ecma_debugger_set", - ] + deps = [ ":libark_client_set" ] install_enable = false if (!is_mingw && !is_mac) { @@ -89,6 +88,5 @@ ohos_shared_library("libark_client") { external_deps += [ "hilog:libhilog" ] } - subsystem_name = "arkcompiler" - part_name = "toolchain" + subsystem_name = "test" } diff --git a/tooling/dynamic/client/ark_cli/BUILD.gn b/tooling/client/ark_cli/BUILD.gn similarity index 87% rename from tooling/dynamic/client/ark_cli/BUILD.gn rename to tooling/client/ark_cli/BUILD.gn index 37214dd6..b54b2a3c 100644 --- a/tooling/dynamic/client/ark_cli/BUILD.gn +++ b/tooling/client/ark_cli/BUILD.gn @@ -20,16 +20,13 @@ ohos_executable("arkdb") { "./", "../", "../../base", - "../../../../", - "../../../../inspector", - "../../../../tooling", - "../../../../websocket", + "../../../", + "../../../inspector", + "../../../tooling", + "../../../websocket", ] - deps = [ - "../:libark_client_set", - "../../:libark_ecma_debugger_set", - ] + deps = [ "../:libark_client_set" ] external_deps = [ "bounds_checking_function:libsec_shared", diff --git a/tooling/dynamic/client/ark_cli/main.cpp b/tooling/client/ark_cli/main.cpp similarity index 98% rename from tooling/dynamic/client/ark_cli/main.cpp rename to tooling/client/ark_cli/main.cpp index f1113f48..030bab0e 100644 --- a/tooling/dynamic/client/ark_cli/main.cpp +++ b/tooling/client/ark_cli/main.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "tooling/dynamic/client/utils/cli_command.h" -#include "tooling/dynamic/client/tcpServer/tcp_server.h" +#include "tooling/client/utils/cli_command.h" +#include "tooling/client/tcpServer/tcp_server.h" #include "manager/message_manager.h" namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/ark_multi/BUILD.gn b/tooling/client/ark_multi/BUILD.gn similarity index 97% rename from tooling/dynamic/client/ark_multi/BUILD.gn rename to tooling/client/ark_multi/BUILD.gn index 0d9dc674..62d885e6 100644 --- a/tooling/dynamic/client/ark_multi/BUILD.gn +++ b/tooling/client/ark_multi/BUILD.gn @@ -15,7 +15,7 @@ import("//arkcompiler/toolchain/toolchain.gni") ohos_executable("ark_multi") { sources = [ - "../../../../common/log_wrapper.cpp", + "../../../common/log_wrapper.cpp", "../../utils/utils.cpp", "main.cpp", ] diff --git a/tooling/dynamic/client/ark_multi/ReadMe.md b/tooling/client/ark_multi/ReadMe.md similarity index 100% rename from tooling/dynamic/client/ark_multi/ReadMe.md rename to tooling/client/ark_multi/ReadMe.md diff --git a/tooling/dynamic/client/ark_multi/ReadMe_Zh.md b/tooling/client/ark_multi/ReadMe_Zh.md similarity index 100% rename from tooling/dynamic/client/ark_multi/ReadMe_Zh.md rename to tooling/client/ark_multi/ReadMe_Zh.md diff --git a/tooling/dynamic/client/ark_multi/main.cpp b/tooling/client/ark_multi/main.cpp similarity index 99% rename from tooling/dynamic/client/ark_multi/main.cpp rename to tooling/client/ark_multi/main.cpp index 092bc85f..20dab54c 100644 --- a/tooling/dynamic/client/ark_multi/main.cpp +++ b/tooling/client/ark_multi/main.cpp @@ -18,7 +18,7 @@ #include "ecmascript/js_runtime_options.h" #include "ecmascript/napi/include/jsnapi_expo.h" #include "ecmascript/platform/file.h" -#include "tooling/dynamic/utils/utils.h" +#include "tooling/utils/utils.h" #ifdef PANDA_TARGET_MACOS #include #include diff --git a/tooling/dynamic/client/domain/debugger_client.cpp b/tooling/client/domain/debugger_client.cpp similarity index 99% rename from tooling/dynamic/client/domain/debugger_client.cpp rename to tooling/client/domain/debugger_client.cpp index 118b5dc7..821fd330 100644 --- a/tooling/dynamic/client/domain/debugger_client.cpp +++ b/tooling/client/domain/debugger_client.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/domain/debugger_client.h" +#include "tooling/client/domain/debugger_client.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/domain/debugger_client.h b/tooling/client/domain/debugger_client.h similarity index 98% rename from tooling/dynamic/client/domain/debugger_client.h rename to tooling/client/domain/debugger_client.h index ebe55d1d..aaeffd40 100644 --- a/tooling/dynamic/client/domain/debugger_client.h +++ b/tooling/client/domain/debugger_client.h @@ -19,7 +19,7 @@ #include #include -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/domain/heapprofiler_client.cpp b/tooling/client/domain/heapprofiler_client.cpp similarity index 99% rename from tooling/dynamic/client/domain/heapprofiler_client.cpp rename to tooling/client/domain/heapprofiler_client.cpp index 6e76fe5b..d8f8e3c4 100644 --- a/tooling/dynamic/client/domain/heapprofiler_client.cpp +++ b/tooling/client/domain/heapprofiler_client.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "tooling/dynamic/client/domain/heapprofiler_client.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/domain/heapprofiler_client.h" +#include "tooling/client/session/session.h" using Result = panda::ecmascript::tooling::Result; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/domain/heapprofiler_client.h b/tooling/client/domain/heapprofiler_client.h similarity index 97% rename from tooling/dynamic/client/domain/heapprofiler_client.h rename to tooling/client/domain/heapprofiler_client.h index c51f0e2f..b6a5fd66 100644 --- a/tooling/dynamic/client/domain/heapprofiler_client.h +++ b/tooling/client/domain/heapprofiler_client.h @@ -20,7 +20,7 @@ #include #include -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" using PtJson = panda::ecmascript::tooling::PtJson; diff --git a/tooling/dynamic/client/domain/profiler_client.cpp b/tooling/client/domain/profiler_client.cpp similarity index 98% rename from tooling/dynamic/client/domain/profiler_client.cpp rename to tooling/client/domain/profiler_client.cpp index f54ff44b..234c1ecc 100644 --- a/tooling/dynamic/client/domain/profiler_client.cpp +++ b/tooling/client/domain/profiler_client.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "tooling/dynamic/client/domain/profiler_client.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/domain/profiler_client.h" +#include "tooling/client/session/session.h" using Result = panda::ecmascript::tooling::Result; using Profile = panda::ecmascript::tooling::Profile; diff --git a/tooling/dynamic/client/domain/profiler_client.h b/tooling/client/domain/profiler_client.h similarity index 98% rename from tooling/dynamic/client/domain/profiler_client.h rename to tooling/client/domain/profiler_client.h index f9e6d18c..fcdc3f83 100644 --- a/tooling/dynamic/client/domain/profiler_client.h +++ b/tooling/client/domain/profiler_client.h @@ -21,7 +21,7 @@ #include -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" namespace OHOS::ArkCompiler::Toolchain { using PtJson = panda::ecmascript::tooling::PtJson; diff --git a/tooling/dynamic/client/domain/runtime_client.cpp b/tooling/client/domain/runtime_client.cpp similarity index 98% rename from tooling/dynamic/client/domain/runtime_client.cpp rename to tooling/client/domain/runtime_client.cpp index fa90ade5..0293330c 100644 --- a/tooling/dynamic/client/domain/runtime_client.cpp +++ b/tooling/client/domain/runtime_client.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/domain/runtime_client.h" +#include "tooling/client/domain/runtime_client.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/domain/runtime_client.h b/tooling/client/domain/runtime_client.h similarity index 97% rename from tooling/dynamic/client/domain/runtime_client.h rename to tooling/client/domain/runtime_client.h index 521304b2..12e12705 100644 --- a/tooling/dynamic/client/domain/runtime_client.h +++ b/tooling/client/domain/runtime_client.h @@ -19,7 +19,7 @@ #include #include -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/domain/test_client.cpp b/tooling/client/domain/test_client.cpp similarity index 95% rename from tooling/dynamic/client/domain/test_client.cpp rename to tooling/client/domain/test_client.cpp index d773a649..cc09b5bb 100644 --- a/tooling/dynamic/client/domain/test_client.cpp +++ b/tooling/client/domain/test_client.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/domain/test_client.h" +#include "tooling/client/domain/test_client.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/domain/test_client.h b/tooling/client/domain/test_client.h similarity index 96% rename from tooling/dynamic/client/domain/test_client.h rename to tooling/client/domain/test_client.h index 9a021ae2..6a768730 100644 --- a/tooling/dynamic/client/domain/test_client.h +++ b/tooling/client/domain/test_client.h @@ -19,7 +19,7 @@ #include #include -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/breakpoint_manager.cpp b/tooling/client/manager/breakpoint_manager.cpp similarity index 95% rename from tooling/dynamic/client/manager/breakpoint_manager.cpp rename to tooling/client/manager/breakpoint_manager.cpp index c704934c..f6df7c61 100644 --- a/tooling/dynamic/client/manager/breakpoint_manager.cpp +++ b/tooling/client/manager/breakpoint_manager.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/manager/breakpoint_manager.h" +#include "tooling/client/manager/breakpoint_manager.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/breakpoint_manager.h b/tooling/client/manager/breakpoint_manager.h similarity index 95% rename from tooling/dynamic/client/manager/breakpoint_manager.h rename to tooling/client/manager/breakpoint_manager.h index 85e84745..76958898 100644 --- a/tooling/dynamic/client/manager/breakpoint_manager.h +++ b/tooling/client/manager/breakpoint_manager.h @@ -22,8 +22,8 @@ #include #include -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_json.h" +#include "tooling/base/pt_types.h" namespace OHOS::ArkCompiler::Toolchain { using PtJson = panda::ecmascript::tooling::PtJson; diff --git a/tooling/dynamic/client/manager/domain_manager.cpp b/tooling/client/manager/domain_manager.cpp similarity index 97% rename from tooling/dynamic/client/manager/domain_manager.cpp rename to tooling/client/manager/domain_manager.cpp index 927c1f44..a5d8467f 100644 --- a/tooling/dynamic/client/manager/domain_manager.cpp +++ b/tooling/client/manager/domain_manager.cpp @@ -15,7 +15,7 @@ #include "domain_manager.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/domain_manager.h b/tooling/client/manager/domain_manager.h similarity index 88% rename from tooling/dynamic/client/manager/domain_manager.h rename to tooling/client/manager/domain_manager.h index ac58bc6b..893a2fe3 100644 --- a/tooling/dynamic/client/manager/domain_manager.h +++ b/tooling/client/manager/domain_manager.h @@ -18,11 +18,11 @@ #include -#include "tooling/dynamic/client/domain/debugger_client.h" -#include "tooling/dynamic/client/domain/heapprofiler_client.h" -#include "tooling/dynamic/client/domain/profiler_client.h" -#include "tooling/dynamic/client/domain/runtime_client.h" -#include "tooling/dynamic/client/domain/test_client.h" +#include "tooling/client/domain/debugger_client.h" +#include "tooling/client/domain/heapprofiler_client.h" +#include "tooling/client/domain/profiler_client.h" +#include "tooling/client/domain/runtime_client.h" +#include "tooling/client/domain/test_client.h" namespace OHOS::ArkCompiler::Toolchain { class DomainManager { diff --git a/tooling/dynamic/client/manager/message_manager.h b/tooling/client/manager/message_manager.h similarity index 100% rename from tooling/dynamic/client/manager/message_manager.h rename to tooling/client/manager/message_manager.h diff --git a/tooling/dynamic/client/manager/source_manager.cpp b/tooling/client/manager/source_manager.cpp similarity index 98% rename from tooling/dynamic/client/manager/source_manager.cpp rename to tooling/client/manager/source_manager.cpp index 61b045db..fd621b43 100644 --- a/tooling/dynamic/client/manager/source_manager.cpp +++ b/tooling/client/manager/source_manager.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/manager/source_manager.h" +#include "tooling/client/manager/source_manager.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/source_manager.h b/tooling/client/manager/source_manager.h similarity index 95% rename from tooling/dynamic/client/manager/source_manager.h rename to tooling/client/manager/source_manager.h index b938ccf6..1421cf7f 100644 --- a/tooling/dynamic/client/manager/source_manager.h +++ b/tooling/client/manager/source_manager.h @@ -21,8 +21,8 @@ #include #include -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_json.h" +#include "tooling/base/pt_types.h" namespace OHOS::ArkCompiler::Toolchain { using PtJson = panda::ecmascript::tooling::PtJson; diff --git a/tooling/dynamic/client/manager/stack_manager.cpp b/tooling/client/manager/stack_manager.cpp similarity index 97% rename from tooling/dynamic/client/manager/stack_manager.cpp rename to tooling/client/manager/stack_manager.cpp index 51ba11e4..7a5fb7cb 100644 --- a/tooling/dynamic/client/manager/stack_manager.cpp +++ b/tooling/client/manager/stack_manager.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/client/manager/stack_manager.h" +#include "tooling/client/manager/stack_manager.h" namespace OHOS::ArkCompiler::Toolchain { void StackManager::SetCallFrames(std::map> callFrames) diff --git a/tooling/dynamic/client/manager/stack_manager.h b/tooling/client/manager/stack_manager.h similarity index 95% rename from tooling/dynamic/client/manager/stack_manager.h rename to tooling/client/manager/stack_manager.h index 7817237c..99c65e32 100644 --- a/tooling/dynamic/client/manager/stack_manager.h +++ b/tooling/client/manager/stack_manager.h @@ -20,8 +20,8 @@ #include #include "common/log_wrapper.h" -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_json.h" +#include "tooling/base/pt_types.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/variable_manager.cpp b/tooling/client/manager/variable_manager.cpp similarity index 99% rename from tooling/dynamic/client/manager/variable_manager.cpp rename to tooling/client/manager/variable_manager.cpp index d6b4f2d9..2812ecf0 100644 --- a/tooling/dynamic/client/manager/variable_manager.cpp +++ b/tooling/client/manager/variable_manager.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/client/manager/variable_manager.h" +#include "tooling/client/manager/variable_manager.h" using PtJson = panda::ecmascript::tooling::PtJson; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/manager/variable_manager.h b/tooling/client/manager/variable_manager.h similarity index 95% rename from tooling/dynamic/client/manager/variable_manager.h rename to tooling/client/manager/variable_manager.h index 8d16af41..7bd72b7e 100644 --- a/tooling/dynamic/client/manager/variable_manager.h +++ b/tooling/client/manager/variable_manager.h @@ -19,10 +19,10 @@ #include #include -#include "tooling/dynamic/client/manager/stack_manager.h" -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/base/pt_returns.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/client/manager/stack_manager.h" +#include "tooling/base/pt_json.h" +#include "tooling/base/pt_returns.h" +#include "tooling/base/pt_types.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/watch_manager.cpp b/tooling/client/manager/watch_manager.cpp similarity index 98% rename from tooling/dynamic/client/manager/watch_manager.cpp rename to tooling/client/manager/watch_manager.cpp index caf457f1..49191e70 100644 --- a/tooling/dynamic/client/manager/watch_manager.cpp +++ b/tooling/client/manager/watch_manager.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/manager/watch_manager.h" +#include "tooling/client/manager/watch_manager.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/manager/watch_manager.h b/tooling/client/manager/watch_manager.h similarity index 93% rename from tooling/dynamic/client/manager/watch_manager.h rename to tooling/client/manager/watch_manager.h index 753d5cc7..be0aea47 100644 --- a/tooling/dynamic/client/manager/watch_manager.h +++ b/tooling/client/manager/watch_manager.h @@ -21,9 +21,9 @@ #include #include -#include "tooling/dynamic/base/pt_json.h" -#include "tooling/dynamic/base/pt_types.h" -#include "tooling/dynamic/client/domain/runtime_client.h" +#include "tooling/base/pt_json.h" +#include "tooling/base/pt_types.h" +#include "tooling/client/domain/runtime_client.h" namespace OHOS::ArkCompiler::Toolchain { using PtJson = panda::ecmascript::tooling::PtJson; diff --git a/tooling/dynamic/client/session/session.cpp b/tooling/client/session/session.cpp similarity index 98% rename from tooling/dynamic/client/session/session.cpp rename to tooling/client/session/session.cpp index 8940d331..db690148 100755 --- a/tooling/dynamic/client/session/session.cpp +++ b/tooling/client/session/session.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/session/session.h" -#include "tooling/dynamic/client/manager/message_manager.h" +#include "tooling/client/manager/message_manager.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/dynamic/client/session/session.h b/tooling/client/session/session.h similarity index 92% rename from tooling/dynamic/client/session/session.h rename to tooling/client/session/session.h index b875553d..a915b66f 100755 --- a/tooling/dynamic/client/session/session.h +++ b/tooling/client/session/session.h @@ -24,12 +24,12 @@ #include #include -#include "tooling/dynamic/client/manager/domain_manager.h" -#include "tooling/dynamic/client/manager/breakpoint_manager.h" -#include "tooling/dynamic/client/manager/source_manager.h" -#include "tooling/dynamic/client/manager/stack_manager.h" -#include "tooling/dynamic/client/manager/variable_manager.h" -#include "tooling/dynamic/client/manager/watch_manager.h" +#include "tooling/client/manager/domain_manager.h" +#include "tooling/client/manager/breakpoint_manager.h" +#include "tooling/client/manager/source_manager.h" +#include "tooling/client/manager/stack_manager.h" +#include "tooling/client/manager/variable_manager.h" +#include "tooling/client/manager/watch_manager.h" #include "websocket/client/websocket_client.h" namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/dynamic/client/tcpServer/tcp_server.cpp b/tooling/client/tcpServer/tcp_server.cpp similarity index 98% rename from tooling/dynamic/client/tcpServer/tcp_server.cpp rename to tooling/client/tcpServer/tcp_server.cpp index 0efed0aa..6db38292 100644 --- a/tooling/dynamic/client/tcpServer/tcp_server.cpp +++ b/tooling/client/tcpServer/tcp_server.cpp @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "tooling/dynamic/client/tcpServer/tcp_server.h" +#include "tooling/client/tcpServer/tcp_server.h" -#include "tooling/dynamic/utils/utils.h" +#include "tooling/utils/utils.h" namespace OHOS::ArkCompiler::Toolchain { uv_async_t* g_inputSignal; diff --git a/tooling/dynamic/client/tcpServer/tcp_server.h b/tooling/client/tcpServer/tcp_server.h similarity index 100% rename from tooling/dynamic/client/tcpServer/tcp_server.h rename to tooling/client/tcpServer/tcp_server.h diff --git a/tooling/dynamic/client/tcpServer/test/config.py b/tooling/client/tcpServer/test/config.py similarity index 100% rename from tooling/dynamic/client/tcpServer/test/config.py rename to tooling/client/tcpServer/test/config.py diff --git a/tooling/dynamic/client/tcpServer/test/js_test_base.py b/tooling/client/tcpServer/test/js_test_base.py similarity index 100% rename from tooling/dynamic/client/tcpServer/test/js_test_base.py rename to tooling/client/tcpServer/test/js_test_base.py diff --git a/tooling/dynamic/client/tcpServer/test/js_test_case/__init__.py b/tooling/client/tcpServer/test/js_test_case/__init__.py similarity index 100% rename from tooling/dynamic/client/tcpServer/test/js_test_case/__init__.py rename to tooling/client/tcpServer/test/js_test_case/__init__.py diff --git a/tooling/dynamic/client/tcpServer/test/js_test_case/js_test.py b/tooling/client/tcpServer/test/js_test_case/js_test.py similarity index 100% rename from tooling/dynamic/client/tcpServer/test/js_test_case/js_test.py rename to tooling/client/tcpServer/test/js_test_case/js_test.py diff --git a/tooling/dynamic/client/tcpServer/test/runtest.py b/tooling/client/tcpServer/test/runtest.py similarity index 100% rename from tooling/dynamic/client/tcpServer/test/runtest.py rename to tooling/client/tcpServer/test/runtest.py diff --git a/tooling/dynamic/client/utils/cli_command.cpp b/tooling/client/utils/cli_command.cpp similarity index 99% rename from tooling/dynamic/client/utils/cli_command.cpp rename to tooling/client/utils/cli_command.cpp index dd69d5c9..8747800b 100644 --- a/tooling/dynamic/client/utils/cli_command.cpp +++ b/tooling/client/utils/cli_command.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/client/utils/cli_command.h" +#include "tooling/client/utils/cli_command.h" namespace OHOS::ArkCompiler::Toolchain { const std::string HELP_MSG = "usage: \n" diff --git a/tooling/dynamic/client/utils/cli_command.h b/tooling/client/utils/cli_command.h similarity index 91% rename from tooling/dynamic/client/utils/cli_command.h rename to tooling/client/utils/cli_command.h index 52c94fd2..88cafd29 100644 --- a/tooling/dynamic/client/utils/cli_command.h +++ b/tooling/client/utils/cli_command.h @@ -22,11 +22,11 @@ #include #include "common/log_wrapper.h" -#include "tooling/dynamic/client/domain/heapprofiler_client.h" -#include "tooling/dynamic/client/domain/profiler_client.h" -#include "tooling/dynamic/client/manager/domain_manager.h" -#include "tooling/dynamic/utils/utils.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/domain/heapprofiler_client.h" +#include "tooling/client/domain/profiler_client.h" +#include "tooling/client/manager/domain_manager.h" +#include "tooling/utils/utils.h" +#include "tooling/client/session/session.h" namespace OHOS::ArkCompiler::Toolchain { using StrPair = std::pair; diff --git a/tooling/dynamic/debugger_service.cpp b/tooling/debugger_service.cpp similarity index 100% rename from tooling/dynamic/debugger_service.cpp rename to tooling/debugger_service.cpp diff --git a/tooling/dynamic/debugger_service.h b/tooling/debugger_service.h similarity index 100% rename from tooling/dynamic/debugger_service.h rename to tooling/debugger_service.h diff --git a/tooling/dynamic/dispatcher.cpp b/tooling/dispatcher.cpp similarity index 100% rename from tooling/dynamic/dispatcher.cpp rename to tooling/dispatcher.cpp diff --git a/tooling/dynamic/dispatcher.h b/tooling/dispatcher.h similarity index 98% rename from tooling/dynamic/dispatcher.h rename to tooling/dispatcher.h index 38a03992..92c1f1e5 100644 --- a/tooling/dynamic/dispatcher.h +++ b/tooling/dispatcher.h @@ -19,7 +19,7 @@ #include #include -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_returns.h" #include "ecmascript/debugger/js_debugger_interface.h" #include "ecmascript/napi/include/jsnapi.h" diff --git a/tooling/dynamic/BUILD.gn b/tooling/dynamic/BUILD.gn deleted file mode 100644 index c04d3a08..00000000 --- a/tooling/dynamic/BUILD.gn +++ /dev/null @@ -1,180 +0,0 @@ -# Copyright (c) 2021-2025 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("../../toolchain.gni") - -config("ark_ecma_debugger_config") { - configs = [ "../..:ark_toolchain_common_config" ] - - include_dirs = [ "." ] -} - -debugger_sources = [ - "../../common/log_wrapper.cpp", - "agent/animation_impl.cpp", - "agent/css_impl.cpp", - "agent/debugger_impl.cpp", - "agent/dom_impl.cpp", - "agent/overlay_impl.cpp", - "agent/page_impl.cpp", - "agent/runtime_impl.cpp", - "agent/target_impl.cpp", - "agent/tracing_impl.cpp", - "backend/debugger_executor.cpp", - "backend/js_pt_hooks.cpp", - "backend/js_single_stepper.cpp", - "base/pt_base64.cpp", - "base/pt_events.cpp", - "base/pt_json.cpp", - "base/pt_params.cpp", - "base/pt_returns.cpp", - "base/pt_script.cpp", - "base/pt_types.cpp", - "debugger_service.cpp", - "dispatcher.cpp", - "protocol_handler.cpp", - "utils/utils.cpp", -] -if (!is_mingw && !is_mac && target_os != "ios") { - debugger_sources += [ - "agent/heapprofiler_impl.cpp", - "agent/profiler_impl.cpp", - ] -} - -ohos_source_set("libark_ecma_debugger_set") { - stack_protector_ret = true - sources = debugger_sources - - public_configs = [ ":ark_ecma_debugger_config" ] - - defines = [] - deps = [] - external_deps = [] - if (defined(ark_hybrid) && ark_hybrid) { - external_deps += [ "runtime_core:libarkruntime" ] - } else { - external_deps += [ "ets_runtime:libark_jsruntime" ] - } - if (is_arkui_x && target_os == "ios") { - sources -= [ "../../common/log_wrapper.cpp" ] - external_deps += [ "cJSON:cjson_static" ] - } else { - external_deps += [ "cJSON:cjson" ] - } - external_deps += [ - "icu:shared_icuuc", - "libuv:uv", - ] - - if (is_ohos && is_standard_system && !is_arkui_x) { - defines += [ "ENABLE_FFRT_INTERFACES" ] - external_deps += [ "ffrt:libffrt" ] - } - - # hiviewdfx libraries - external_deps += hiviewdfx_ext_deps - - external_deps += [ "runtime_core:libarkfile_static" ] - deps += hiviewdfx_deps - - if (enable_leak_check) { - sources += [ "$js_root/ecmascript/dfx/native_dfx/backtrace.cpp" ] - defines += [ - "ECMASCRIPT_ENABLE_HANDLE_LEAK_CHECK", - "ECMASCRIPT_ENABLE_GLOBAL_LEAK_CHECK", - ] - } - - cflags_cc = [ "-fvisibility=hidden" ] - subsystem_name = "arkcompiler" - part_name = "toolchain" -} - -ohos_static_library("libark_ecma_debugger_static") { - deps = [ ":libark_ecma_debugger_set" ] - external_deps = [ "libuv:uv" ] - if (is_mac) { - external_deps += [ "cJSON:cjson_static" ] - } - - - - # hiviewdfx libraries - external_deps += hiviewdfx_ext_deps - if (enable_hilog) { - external_deps += [ "hilog:libhilog" ] - } - if (!is_arkui_x) { - if (defined(ark_hybrid) && ark_hybrid) { - external_deps += [ "runtime_core:libarkruntime" ] - } else { - external_deps += [ "ets_runtime:libark_jsruntime" ] - } - } else { - if (defined(ark_hybrid) && ark_hybrid) { - deps += [ "../../../runtime_core:libarkruntime" ] - } else { - deps += [ "../../../ets_runtime:libark_jsruntime" ] - } - } - deps += hiviewdfx_deps - - if (!is_mingw && !is_mac) { - output_extension = "so" - } - - if (!is_standard_system && !ark_standalone_build) { - relative_install_dir = "ark" - } - subsystem_name = "arkcompiler" - part_name = "toolchain" - output_name = "libark_tooling" -} - -ohos_static_library("libark_ecma_debugger_test") { - testonly = true - stack_protector_ret = true - sources = debugger_sources - - public_configs = [ ":ark_ecma_debugger_config" ] - - defines = [ "OHOS_UNIT_TEST" ] - deps = [] - external_deps = [ - "icu:shared_icuuc", - "libuv:uv", - ] - if (defined(ark_hybrid) && ark_hybrid) { - external_deps += [ "runtime_core:libarkruntime" ] - } else { - external_deps += [ "ets_runtime:libark_jsruntime" ] - } - if ((is_arkui_x && target_os == "ios") || target_os == "mac") { - external_deps += [ "cJSON:cjson_static" ] - } else { - external_deps += [ "cJSON:cjson" ] - } - - # hiviewdfx libraries - external_deps += hiviewdfx_ext_deps - deps += hiviewdfx_deps - if (enable_hilog) { - external_deps += [ "hilog:libhilog" ] - } - - if (!is_mingw && !is_mac) { - output_extension = "so" - } - subsystem_name = "test" -} \ No newline at end of file diff --git a/tooling/dynamic/protocol_channel.h b/tooling/protocol_channel.h similarity index 94% rename from tooling/dynamic/protocol_channel.h rename to tooling/protocol_channel.h index d4e4b543..adb52366 100644 --- a/tooling/dynamic/protocol_channel.h +++ b/tooling/protocol_channel.h @@ -16,8 +16,8 @@ #ifndef ECMASCRIPT_TOOLING_PROTOCOL_CHANNEL_H #define ECMASCRIPT_TOOLING_PROTOCOL_CHANNEL_H -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_events.h" +#include "tooling/base/pt_returns.h" #include "dispatcher.h" #include "libpandabase/macros.h" diff --git a/tooling/dynamic/protocol_handler.cpp b/tooling/protocol_handler.cpp similarity index 100% rename from tooling/dynamic/protocol_handler.cpp rename to tooling/protocol_handler.cpp diff --git a/tooling/dynamic/protocol_handler.h b/tooling/protocol_handler.h similarity index 100% rename from tooling/dynamic/protocol_handler.h rename to tooling/protocol_handler.h diff --git a/tooling/static/BUILD.gn b/tooling/static/BUILD.gn deleted file mode 100644 index 1e1decd2..00000000 --- a/tooling/static/BUILD.gn +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (c) 2022-2025 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("../../toolchain.gni") - -libarkinspector_sources = [ - "connection/endpoint_base.cpp", - "connection/event_loop.cpp", - "connection/ohos_ws/ohos_ws_server.cpp", - "connection/ohos_ws/ohos_ws_server_endpoint.cpp", - "connection/server_endpoint_base.cpp", - "debugger/breakpoint.cpp", - "debugger/breakpoint_storage.cpp", - "debugger/conditional_breakpoint.cpp", - "debugger/debug_info_cache.cpp", - "debugger/debuggable_thread.cpp", - "debugger/object_repository.cpp", - "debugger/thread_state.cpp", - "error.cpp", - "evaluation/evaluation_engine.cpp", - "init.cpp", - "inspector.cpp", - "inspector_server.cpp", - "json_serialization/jrpc_error.cpp", - "session_manager.cpp", - "source_manager.cpp", - "types/custom_url_breakpoint_response.cpp", - "types/debugger_call_function_on_request.cpp", - "types/debugger_evaluation_request.cpp", - "types/exception_details.cpp", - "types/location.cpp", - "types/object_preview.cpp", - "types/profile_result.cpp", - "types/remote_object.cpp", - "types/scope.cpp", - "types/url_breakpoint_request.cpp", - "types/url_breakpoint_response.cpp", -] - -config("libarkinspector_config") { - cflags_cc = [ - "-fexceptions", - "-Wno-invalid-offsetof", - "-Wno-null-pointer-subtraction", - "-Wno-error=unknown-warning-option", - ] - - # required for arkcompiler_toolchain compilation - if (is_ohos) { - defines = [ "OHOS_PLATFORM" ] - } -} - -ohos_static_library("libark_tooling_plus_static") { - sources = libarkinspector_sources - external_deps = hiviewdfx_ext_deps - - if (is_mingw || is_win) { - output_extension = "dll" - } else { - output_extension = "so" - } - part_name = "toolchain" - subsystem_name = "arkcompiler" -} \ No newline at end of file diff --git a/tooling/static/CMakeLists.txt b/tooling/static/CMakeLists.txt deleted file mode 100644 index 0773e218..00000000 --- a/tooling/static/CMakeLists.txt +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright (c) 2022-2025 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 3.10) - -project(arkinspector) - -set(ARKINSPECTOR_ROOTS - connection/endpoint_base.cpp - connection/event_loop.cpp - connection/server_endpoint_base.cpp - debugger/breakpoint.cpp - debugger/breakpoint_storage.cpp - debugger/conditional_breakpoint.cpp - debugger/debug_info_cache.cpp - debugger/debuggable_thread.cpp - debugger/object_repository.cpp - debugger/thread_state.cpp - error.cpp - evaluation/evaluation_engine.cpp - init.cpp - inspector.cpp - inspector_server.cpp - json_serialization/jrpc_error.cpp - session_manager.cpp - source_manager.cpp - types/custom_url_breakpoint_response.cpp - types/debugger_evaluation_request.cpp - types/debugger_call_function_on_request.cpp - types/exception_details.cpp - types/location.cpp - types/profile_result.cpp - types/remote_object.cpp - types/object_preview.cpp - types/scope.cpp - types/url_breakpoint_request.cpp - types/url_breakpoint_response.cpp -) -set(ARKINSPECTOR_LINKED_LIBRARIES - arkbase - arkdisassembler - arkfile - arkruntime -) -set(ARKINSPECTOR_DEFINITIONS - "" -) - -# required for arkcompiler_toolchain compilation -if(PANDA_TARGET_OHOS) - list(APPEND ARKINSPECTOR_DEFINITIONS -DOHOS_PLATFORM) -endif() - -if(PANDA_TOOLING_ASIO) - list(APPEND ARKINSPECTOR_ROOTS - connection/asio/asio_server.cpp - connection/asio/ws_logger.cpp - ) - set(ARKINSPECTOR_INCLUDES - ${PANDA_THIRD_PARTY_SOURCES_DIR}/asio/asio/include/ - ${PANDA_THIRD_PARTY_SOURCES_DIR}/websocketpp/ - ) - list(APPEND ARKINSPECTOR_DEFINITIONS - -DPANDA_TOOLING_ASIO - -DASIO_NO_TYPEID - -DASIO_STANDALONE - ) -else() - list(APPEND ARKINSPECTOR_ROOTS - connection/ohos_ws/ohos_ws_server_endpoint.cpp - connection/ohos_ws/ohos_ws_server.cpp - ) - list(APPEND ARKINSPECTOR_LINKED_LIBRARIES toolchain_websocket) - set(ARKINSPECTOR_INCLUDES - ${PANDA_THIRD_PARTY_SOURCES_DIR}/arkcompiler/toolchain/ - ${PANDA_ROOT}/runtime/tooling/ - ) -endif() - - -panda_add_library(${PROJECT_NAME} SHARED ${ARKINSPECTOR_ROOTS}) - -panda_target_compile_definitions(${PROJECT_NAME} PUBLIC ${ARKINSPECTOR_DEFINITIONS}) - -panda_target_compile_options(${PROJECT_NAME} PUBLIC -fexceptions -Wno-invalid-offsetof) - -add_dependencies(${PROJECT_NAME} arkruntime) - -panda_target_include_directories(${PROJECT_NAME} - PUBLIC ${PANDA_ROOT}/runtime/include/ - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} -) - -panda_target_include_directories(${PROJECT_NAME} SYSTEM - PUBLIC ${ARKINSPECTOR_INCLUDES} -) - -panda_target_link_libraries(${PROJECT_NAME} - ${ARKINSPECTOR_LINKED_LIBRARIES} -) - -panda_add_sanitizers(TARGET ${PROJECT_NAME} SANITIZERS ${PANDA_SANITIZERS_LIST}) - -panda_add_gtest( - NAME arkinspector_tests - NO_CORES - SOURCES - tests/base64.cpp - tests/debug_info_cache.cpp - tests/inspector_server.cpp - tests/json_object_matcher.cpp - tests/object_repository.cpp - tests/session_manager.cpp - tests/source_manager.cpp - tests/thread_state.cpp - INCLUDE_DIRS - ${PANDA_ROOT}/runtime/tooling/inspector - LIBRARIES - arkassembler - ${PROJECT_NAME} - arkruntime - gmock - SANITIZERS - ${PANDA_SANITIZERS_LIST} -) diff --git a/tooling/static/common.h b/tooling/static/common.h deleted file mode 100644 index fb005456..00000000 --- a/tooling/static/common.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PANDA_TOOLING_INSPECTOR_COMMON_H -#define PANDA_TOOLING_INSPECTOR_COMMON_H - -#include -#include - -namespace ark::tooling::inspector { -using SourceFileFilter = std::function; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_COMMON_H diff --git a/tooling/static/connection/asio/asio_config.h b/tooling/static/connection/asio/asio_config.h deleted file mode 100644 index 6afe109c..00000000 --- a/tooling/static/connection/asio/asio_config.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_CONFIG_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_CONFIG_H - -#include "websocketpp/config/asio_no_tls.hpp" -#include "websocketpp/logger/levels.hpp" -#include "websocketpp/transport/asio/endpoint.hpp" - -#include "connection/asio/ws_logger.h" - -namespace ark::tooling::inspector { -// NOLINTBEGIN(readability-identifier-naming) -struct AsioConfig : websocketpp::config::asio { - static const websocketpp::log::level alog_level = websocketpp::log::alevel::access_core; - - using alog_type = WsLogger; - using elog_type = WsLogger; - - struct transport_config : websocketpp::config::asio::transport_config { - using alog_type = AsioConfig::alog_type; - using elog_type = AsioConfig::elog_type; - }; - - using transport_type = websocketpp::transport::asio::endpoint; -}; -// NOLINTEND(readability-identifier-naming) -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_CONFIG_H diff --git a/tooling/static/connection/asio/asio_server.cpp b/tooling/static/connection/asio/asio_server.cpp deleted file mode 100644 index d7f0af57..00000000 --- a/tooling/static/connection/asio/asio_server.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/asio/asio_server.h" - -#include -#include -#include - -#include "websocketpp/close.hpp" -#include "websocketpp/http/constants.hpp" -#include "websocketpp/uri.hpp" - -#include "utils/json_builder.h" -#include "utils/logger.h" - -#include "connection/asio/asio_config.h" - -#define CONFIG AsioConfig // NOLINT(cppcoreguidelines-macro-usage) -#include "server_endpoint-inl.h" -#undef CONFIG - -namespace ark::tooling::inspector { -template -static void HandleHttpRequest(ConnectionPtr conn) -{ - static constexpr std::string_view GET = "GET"; - static constexpr std::string_view JSON_URI = "/json"; - static constexpr std::string_view JSON_LIST_URI = "/json/list"; - static constexpr std::string_view JSON_VERSION_URI = "/json/version"; - - const auto &req = conn->get_request(); - const auto &uri = req.get_uri(); - if (req.get_method() != GET) { - CloseConnection(conn); - return; - } - - if (uri == JSON_URI || uri == JSON_LIST_URI) { - HandleJsonList(conn); - } else if (uri == JSON_VERSION_URI) { - HandleJsonVersion(conn); - } else { - CloseConnection(conn); - return; - } - conn->append_header("Content-Type", "application/json; charset=UTF-8"); - conn->append_header("Cache-Control", "no-cache"); - conn->set_status(websocketpp::http::status_code::value::ok); -} - -template -static void HandleJsonVersion(ConnectionPtr conn) -{ - JsonObjectBuilder builder; - builder.AddProperty("browser", "ArkTS"); - builder.AddProperty("protocol-version", "1.1"); - AddWebSocketDebuggerUrl(conn, builder); - conn->set_body(std::move(builder).Build()); -} - -template -static void HandleJsonList(ConnectionPtr conn) -{ - auto buildJson = [conn](JsonObjectBuilder &builder) { - builder.AddProperty("description", "ArkTS"); - // Empty "id" corresponds to constructed URLs - builder.AddProperty("id", ""); - builder.AddProperty("type", "node"); - // Do not add "url" fields as it dummy value might confuse some clients - AddWebSocketDebuggerUrl(conn, builder); - std::stringstream ss; - // CC-OFFNXT(WordsTool.74) fixed protocol url - ss << "devtools://devtools/bundled/devtools_app.html?ws=" << conn->get_host() << ':' - << static_cast(conn->get_port()); - builder.AddProperty("devToolsFrontendUrl", ss.str()); - }; - JsonArrayBuilder arrayBuilder; - arrayBuilder.Add(std::move(buildJson)); - conn->set_body(std::move(arrayBuilder).Build()); -} - -template -static void CloseConnection(ConnectionPtr conn) -{ - std::error_code ec; - conn->close(websocketpp::close::status::protocol_error, "", ec); - if (ec) { - LOG(WARNING, DEBUGGER) << "Failed to close invalid HTTP connection"; - } -} - -template -static void AddWebSocketDebuggerUrl(ConnectionPtr conn, JsonObjectBuilder &builder) -{ - std::stringstream ss; - ss << "ws://" << conn->get_host() << ':' << conn->get_port(); - builder.AddProperty("webSocketDebuggerUrl", ss.str()); -} - -bool AsioServer::Initialize() -{ - if (initialized_) { - return true; - } - - // Do JSON handshake, as it is expected by some debugger clients - endpoint_.set_http_handler([this](auto hdl) { HandleHttpRequest(endpoint_.get_con_from_hdl(hdl)); }); - - std::error_code ec; - endpoint_.init_asio(ec); - if (ec) { - LOG(ERROR, DEBUGGER) << "Failed to initialize endpoint"; - return false; - } - - endpoint_.set_reuse_addr(true); - initialized_ = true; - return true; -} - -websocketpp::uri_ptr AsioServer::Start(uint32_t port) -{ - if (!Initialize()) { - return nullptr; - } - - std::error_code ec; - - endpoint_.listen(port, ec); - if (ec) { - LOG(ERROR, DEBUGGER) << "Failed to bind Inspector server on port " << port; - return nullptr; - } - - endpoint_.start_accept(ec); - - if (!ec) { - auto ep = endpoint_.get_local_endpoint(ec); - - if (!ec) { - LOG(INFO, DEBUGGER) << "Inspector server listening on " << ep; - return std::make_shared(false, ep.address().to_string(), ep.port(), "/"); - } - - LOG(ERROR, DEBUGGER) << "Failed to get the TCP endpoint"; - } else { - LOG(ERROR, DEBUGGER) << "Failed to start Inspector connection acceptance loop"; - } - - endpoint_.stop_listening(ec); - return nullptr; -} - -bool AsioServer::Stop() -{ - if (!Initialize()) { - return false; - } - - // Stop accepting new connections. - Kill(); - // Close the current connection. - Close(); - - std::error_code ec; - endpoint_.stop_listening(ec); - return !ec; -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/asio/asio_server.h b/tooling/static/connection/asio/asio_server.h deleted file mode 100644 index 04df5ddc..00000000 --- a/tooling/static/connection/asio/asio_server.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_SERVER_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_SERVER_H - -#include - -#include "websocketpp/uri.hpp" - -#include "connection/asio/asio_config.h" -#include "connection/asio/server_endpoint.h" - -namespace ark::tooling::inspector { -// NOLINTNEXTLINE(fuchsia-multiple-inheritance) -class AsioServer final : public ServerEndpoint { -public: - bool RunOne() override - { - return endpoint_.run_one() != 0; - } - - websocketpp::uri_ptr Start(uint32_t port = 0); - bool Stop(); - -private: - bool Initialize(); - -private: - bool initialized_ {false}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_ASIO_SERVER_H diff --git a/tooling/static/connection/asio/server_endpoint-inl.h b/tooling/static/connection/asio/server_endpoint-inl.h deleted file mode 100644 index 5277d2d3..00000000 --- a/tooling/static/connection/asio/server_endpoint-inl.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_INL_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_INL_H - -#ifndef CONFIG -#error Define CONFIG before including this header -#endif - -#include "connection/asio/server_endpoint.h" - -namespace ark::tooling::inspector { -template <> // NOLINTNEXTLINE(misc-definitions-in-headers) -ServerEndpoint::ServerEndpoint() noexcept -{ - endpoint_.set_message_handler( - [this](auto /* hdl */, auto message) { this->HandleMessage(message->get_payload()); }); - - endpoint_.set_validate_handler([this](auto hdl) { - onValidate_(); - - if (Pin(hdl)) { - return true; - } - - endpoint_.get_con_from_hdl(hdl)->set_body("Another debug session is in progress"); - return false; - }); - - endpoint_.set_open_handler([this](auto) { onOpen_(); }); - endpoint_.set_fail_handler([this](auto hdl) { - onFail_(); - Unpin(hdl); - }); - - endpoint_.set_close_handler([this](auto hdl) { Unpin(hdl); }); -} - -template <> // NOLINTNEXTLINE(misc-definitions-in-headers) -bool ServerEndpoint::Close() -{ - if (auto connection = GetPinnedConnection()) { - std::error_code ec; - connection->close(websocketpp::close::status::going_away, "", ec); - if (ec) { - LOG(ERROR, DEBUGGER) << "Error closing websocket connection: " << ec.message(); - return false; - } - } - return true; -} -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_INL_H diff --git a/tooling/static/connection/asio/server_endpoint.h b/tooling/static/connection/asio/server_endpoint.h deleted file mode 100644 index 1da60093..00000000 --- a/tooling/static/connection/asio/server_endpoint.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_H - -#include "websocketpp/common/connection_hdl.hpp" -#include "websocketpp/frame.hpp" -#include "websocketpp/server.hpp" - -#include "connection/server_endpoint_base.h" - -namespace ark::tooling::inspector { -// Server endpoint based on websocketpp implementation. -// NOLINTNEXTLINE(fuchsia-multiple-inheritance) -template -class ServerEndpoint : public ServerEndpointBase { -protected: - using Endpoint = websocketpp::server; - using ConnectionPtr = typename Endpoint::connection_ptr; - -public: - ServerEndpoint() noexcept; - -protected: - ConnectionPtr GetPinnedConnection() - { - return connection_; - } - - bool Pin(const websocketpp::connection_hdl &hdl) - { - ConnectionPtr expected; - // set new connection only if there is no already existing one - return std::atomic_compare_exchange_strong(&connection_, &expected, endpoint_.get_con_from_hdl(hdl)); - } - - void Unpin(const websocketpp::connection_hdl &hdl) - { - auto expected = endpoint_.get_con_from_hdl(hdl); - // expect that the given connection is the one already stored - std::atomic_compare_exchange_strong(&connection_, &expected, {}); - } - - bool Close(); - - Endpoint endpoint_; // NOLINT(misc-non-private-member-variables-in-classes) - -private: - void SendMessage(const std::string &message) override - { - if (auto connection = GetPinnedConnection()) { - connection->send(message, websocketpp::frame::opcode::text); - } else { - LOG(INFO, DEBUGGER) << "Did not send message: " << message; - } - } - - ConnectionPtr connection_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_SERVER_ENDPOINT_H diff --git a/tooling/static/connection/asio/ws_logger.cpp b/tooling/static/connection/asio/ws_logger.cpp deleted file mode 100644 index 8b895ba5..00000000 --- a/tooling/static/connection/asio/ws_logger.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/asio/ws_logger.h" - -#include "websocketpp/logger/levels.hpp" - -#include "macros.h" -#include "utils/logger.h" - -namespace ark::tooling::inspector { -void WsLogger::set_channels(Level channels) -{ - if (channels != 0) { - dynamicChannels_ |= channels & staticChannels_; - } else { - dynamicChannels_ = 0; - } -} - -void WsLogger::write(Level channel, const std::string &string) const -{ - if (!dynamic_test(channel)) { - return; - } - - auto level = channel_log_level(channel); - auto component = Logger::Component::DEBUGGER; - - if (!Logger::IsLoggingOnOrAbort(level, component)) { - return; - } - -#ifndef NDEBUG - if (Logger::IsMessageSuppressed(level, component)) { - return; - } -#endif - - Logger::Message message(level, component, false); - auto &ms = message.GetStream(); - - if (channelType_ == websocketpp::log::channel_type_hint::access) { - ms << websocketpp::log::alevel::channel_name(channel) << ": "; - } - - ms << string; -} - -Logger::Level WsLogger::channel_log_level(Level channel) const -{ - if (channelType_ != websocketpp::log::channel_type_hint::error) { - return Logger::Level::INFO; - } - - switch (channel) { - case websocketpp::log::elevel::devel: - return Logger::Level::DEBUG; - - case websocketpp::log::elevel::library: - case websocketpp::log::elevel::info: - return Logger::Level::INFO; - - case websocketpp::log::elevel::warn: - return Logger::Level::WARNING; - - case websocketpp::log::elevel::rerror: - return Logger::Level::ERROR; - - case websocketpp::log::elevel::fatal: - return Logger::Level::FATAL; - - default: - UNREACHABLE(); - } -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/asio/ws_logger.h b/tooling/static/connection/asio/ws_logger.h deleted file mode 100644 index b5ecbf41..00000000 --- a/tooling/static/connection/asio/ws_logger.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_WS_LOGGER_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_WS_LOGGER_H - -#include - -#include "websocketpp/logger/levels.hpp" - -#include "utils/logger.h" - -namespace ark::tooling::inspector { -class WsLogger { - using ChannelType = websocketpp::log::channel_type_hint::value; - using Level = websocketpp::log::level; - -public: - WsLogger(Level staticChannels, ChannelType channelType) : channelType_(channelType), staticChannels_(staticChannels) - { - } - - // NOLINTNEXTLINE(readability-identifier-naming) - void set_channels(Level channels); - // NOLINTNEXTLINE(readability-identifier-naming) - bool static_test(Level channel) const - { - return (channel & staticChannels_) == channel; - } - // NOLINTNEXTLINE(readability-identifier-naming) - bool dynamic_test(Level channel) const - { - return (channel & dynamicChannels_) == channel; - } - // NOLINTNEXTLINE(readability-identifier-naming) - void write(Level channel, const std::string &string) const; - -private: - // NOLINTNEXTLINE(readability-identifier-naming) - Logger::Level channel_log_level(Level channel) const; - - const ChannelType channelType_; - const Level staticChannels_; - Level dynamicChannels_ {0}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ASIO_WS_LOGGER_H diff --git a/tooling/static/connection/endpoint_base.cpp b/tooling/static/connection/endpoint_base.cpp deleted file mode 100644 index 5f06a37a..00000000 --- a/tooling/static/connection/endpoint_base.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/endpoint_base.h" - -#include - -#include "utils/json_builder.h" -#include "utils/json_parser.h" -#include "utils/logger.h" - -namespace ark::tooling::inspector { -void EndpointBase::OnCall(const char *method, EndpointBase::MethodHandler &&handler) -{ - os::memory::LockHolder lock(methodHandlersMutex_); - methodHandlers_[method] = std::move(handler); -} - -void EndpointBase::HandleMessage(const std::string &message) -{ - JsonObject request(message); - if (!request.IsValid()) { - LOG(INFO, DEBUGGER) << "Invalid request: " << message; - return; - } - - LOG(DEBUG, DEBUGGER) << "Received " << message; - - auto sessionId = request.GetValue("sessionId"); - auto id = request.GetValue("id"); - auto method = request.GetValue("method"); - auto result = request.GetValue("result"); - - if (method != nullptr && result == nullptr) { - os::memory::LockHolder lock(methodHandlersMutex_); - - auto optId = id != nullptr ? std::make_optional(*id) : std::nullopt; - if (auto handler = methodHandlers_.find(*method); handler != methodHandlers_.end()) { - auto *params = request.GetValue("params"); - - JsonObject empty; - - handler->second(sessionId != nullptr ? *sessionId : std::string(), optId, - params != nullptr ? **params : empty); - } else { - LOG(WARNING, DEBUGGER) << "Unsupported method: " << message; - HandleUnsupportedMethod(optId, *method); - } - } else if (result != nullptr && method == nullptr) { - if (id == nullptr) { - LOG(INFO, DEBUGGER) << "Response object with no \"id\": " << message; - return; - } - - if (auto handler = resultHandlers_.extract(*id)) { - handler.mapped()(**result); - } - } else { - LOG(INFO, DEBUGGER) << "Expected either 'method' or 'result' parameter"; - } -} - -void EndpointBase::Call(const std::string &sessionId, std::optional id, const char *method, - std::function &¶ms) -{ - Send([&sessionId, id, method, ¶ms](JsonObjectBuilder &call) { - if (id) { - call.AddProperty("id", *id); - } - - call.AddProperty("method", method); - call.AddProperty("params", std::move(params)); - - if (!sessionId.empty()) { - call.AddProperty("sessionId", sessionId); - } - }); -} - -void EndpointBase::HandleUnsupportedMethod(std::optional optId, const std::string &method) -{ - Send([&optId, &method](JsonObjectBuilder &builder) { - if (optId) { - builder.AddProperty("id", *optId); - } - builder.AddProperty("error", [&method](JsonObjectBuilder &errorBuilder) { - errorBuilder.AddProperty("code", static_cast(InspectorErrorCode::METHOD_NOT_FOUND)); - errorBuilder.AddProperty("message", "Unsupported method: " + method); - }); - }); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/endpoint_base.h b/tooling/static/connection/endpoint_base.h deleted file mode 100644 index 629bd741..00000000 --- a/tooling/static/connection/endpoint_base.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_ENDPOINT_BASE_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_ENDPOINT_BASE_H - -#include -#include -#include -#include -#include -#include - -#include "utils/json_builder.h" -#include "utils/logger.h" - -#include "json_serialization/jrpc_error.h" - -namespace ark { -class JsonObject; -} // namespace ark - -namespace ark::tooling::inspector { -enum class InspectorErrorCode { - PARSE_ERROR = -32700, - INTERNAL_ERROR = -32603, - INVALID_PARAMS = -32602, - METHOD_NOT_FOUND = -32601, - INVALID_REQUEST = -32600, - SESSION_NOT_FOUND = -32001, - SERVER_ERROR = -32000, -}; - -// Base class implementation of JSON-RPC endpoint handling the Inspector protocol. -class EndpointBase { -public: - using Id = double; - -private: - using MethodHandler = std::function, const JsonObject &)>; - using ResultHandler = std::function; - -public: - void OnCall(const char *method, MethodHandler &&handler); - -protected: - void HandleMessage(const std::string &message); - - void OnResult(Id id, ResultHandler &&handler) - { - resultHandlers_[id] = std::move(handler); - } - - void Call( - const std::string &sessionId, std::optional id, const char *method, - std::function &¶ms = [](JsonObjectBuilder & /* builder */) {}); - - template - void Reply(const std::string &sessionId, Id id, Result &&result) - { - Send([&sessionId, id, &result](JsonObjectBuilder &reply) { - reply.AddProperty("id", id); - reply.AddProperty("result", std::forward(result)); - - if (!sessionId.empty()) { - reply.AddProperty("sessionId", sessionId); - } - }); - } - - void ReplyError(const std::string &sessionId, Id id, JRPCError &&error) - { - Send([&sessionId, id, &error](JsonObjectBuilder &reply) { - reply.AddProperty("id", id); - reply.AddProperty("error", std::move(error)); - - if (!sessionId.empty()) { - reply.AddProperty("sessionId", sessionId); - } - }); - } - -private: - /// Send JSON message. - virtual void SendMessage(const std::string &message) = 0; - - /// Send JSON message created with the provided build function. - template - void Send(BuildFunction &&build) - { - JsonObjectBuilder builder; - build(builder); - auto message = std::move(builder).Build(); - LOG(DEBUG, DEBUGGER) << "Sending " << message; - SendMessage(message); - } - - void HandleUnsupportedMethod(std::optional optId, const std::string &method); - - os::memory::Mutex methodHandlersMutex_; - std::unordered_map methodHandlers_ GUARDED_BY(methodHandlersMutex_); - std::unordered_map resultHandlers_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_ENDPOINT_BASE_H diff --git a/tooling/static/connection/event_loop.cpp b/tooling/static/connection/event_loop.cpp deleted file mode 100644 index a9940f42..00000000 --- a/tooling/static/connection/event_loop.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/event_loop.h" - -#include "macros.h" - -namespace ark::tooling::inspector { -bool EventLoop::Kill() -{ - return running_.exchange(false); -} - -void EventLoop::Run() -{ - ASSERT_PRINT(!running_, "Event loop is already running"); - - for (running_ = true; running_;) { - os::memory::WriteLockHolder lock(taskExecution_); - RunOne(); - } -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/event_loop.h b/tooling/static/connection/event_loop.h deleted file mode 100644 index 06b7e668..00000000 --- a/tooling/static/connection/event_loop.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_EVENT_LOOP_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_EVENT_LOOP_H - -#include - -#include "os/mutex.h" - -namespace ark::tooling::inspector { -class EventLoop { -public: - // Notify the running event loop to stop. - bool Kill(); - - // Run the event loop until paused. - void Run(); - - // Run at most one event loop handler, may block. - virtual bool RunOne() = 0; - - // Pause the event loop. Wait for the current task to finish. - void Pause() ACQUIRE_SHARED(taskExecution_) - { - taskExecution_.ReadLock(); - } - - // Notify the event loop to continue. - void Continue() RELEASE_GENERIC(taskExecution_) - { - taskExecution_.Unlock(); - } - -private: - std::atomic running_ {false}; - os::memory::RWLock taskExecution_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_EVENT_LOOP_H diff --git a/tooling/static/connection/ohos_ws/ohos_ws_server.cpp b/tooling/static/connection/ohos_ws/ohos_ws_server.cpp deleted file mode 100644 index 3d7894d6..00000000 --- a/tooling/static/connection/ohos_ws/ohos_ws_server.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/ohos_ws/ohos_ws_server.h" - -#include - -#include "os/thread.h" -#include "utils/logger.h" - -namespace ark::tooling::inspector { -[[maybe_unused]] static constexpr std::string_view G_ARK_TS_INSPECTOR_NAME = "ArkEtsDebugger"; - -bool OhosWsServer::RunOne() -{ - if (!endpoint_.IsConnected() && !AcceptNewWsConnection()) { - LOG(WARNING, DEBUGGER) << "Inspector server is unable to establish a new connection, exiting"; - return false; - } - - auto message = endpoint_.Decode(); - if (!message.empty()) { - if (Endpoint::IsDecodeDisconnectMsg(message)) { - LOG(WARNING, DEBUGGER) << "Inspector server received `disconnect`, exiting"; - return false; - } - HandleMessage(message); - } - return true; -} - -bool OhosWsServer::Start([[maybe_unused]] uint32_t port) -{ - bool succeeded = false; - -#if !defined(PANDA_TARGET_OHOS) - succeeded = endpoint_.InitTcpWebSocket(port); - uint32_t name = port; -#else - auto pid = os::thread::GetPid(); - std::string name = std::to_string(pid) + std::string(G_ARK_TS_INSPECTOR_NAME); - succeeded = endpoint_.InitUnixWebSocket(name); -#endif - if (succeeded) { - LOG(INFO, DEBUGGER) << "Inspector server listening on " << name; - return true; - } - LOG(ERROR, DEBUGGER) << "Failed to bind Inspector server on " << name; - return false; -} - -bool OhosWsServer::Stop() -{ - // Stop event loop before closing endpoint server. - Kill(); - endpoint_.Close(); - socketpairMode_ = false; - return true; -} - -bool OhosWsServer::StartForSocketpair(int socketfd) -{ - bool succeeded = endpoint_.InitUnixWebSocket(socketfd); - if (succeeded) { - LOG(INFO, DEBUGGER) << "Inspector server listening on " << socketfd; - socketpairMode_ = true; - return true; - } - - LOG(ERROR, DEBUGGER) << "Failed to bind Inspector server on " << socketfd; - return false; -} - -bool OhosWsServer::AcceptNewWsConnection() -{ - if (socketpairMode_) { - return endpoint_.ConnectUnixWebSocketBySocketpair(); - } - return endpoint_.AcceptNewConnection(); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/ohos_ws/ohos_ws_server.h b/tooling/static/connection/ohos_ws/ohos_ws_server.h deleted file mode 100644 index 870b8cc1..00000000 --- a/tooling/static/connection/ohos_ws/ohos_ws_server.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_OHOS_WS_SERVER_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_OHOS_WS_SERVER_H - -#include "connection/ohos_ws/ohos_ws_server_endpoint.h" - -namespace ark::tooling::inspector { -// JSON-RPC server processing only one connection at time. -// Based on OHOS websocket protocol implementation. -// NOLINTNEXTLINE(fuchsia-multiple-inheritance) -class OhosWsServer final : public OhosWsServerEndpoint { -public: - bool RunOne() override; - - // Creates socket and starts listening - bool Start(uint32_t port = 0); - bool Stop(); - bool StartForSocketpair(int socketfd); - -private: - bool socketpairMode_ {false}; - - bool AcceptNewWsConnection(); -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_OHOS_WS_SERVER_H diff --git a/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.cpp b/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.cpp deleted file mode 100644 index 8a6ef8a8..00000000 --- a/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/ohos_ws/ohos_ws_server_endpoint.h" - -namespace ark::tooling::inspector { -OhosWsServerEndpoint::OhosWsServerEndpoint() noexcept -{ - endpoint_.SetValidateConnectionCallback([this](auto) { - // a new connection will be accepted only after the prior is finished, - // which is ensured by websocket implementation - onValidate_(); - return true; - }); - - endpoint_.SetOpenConnectionCallback([this] { onOpen_(); }); - endpoint_.SetFailConnectionCallback([this] { onFail_(); }); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.h b/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.h deleted file mode 100644 index 3ab4b77e..00000000 --- a/tooling/static/connection/ohos_ws/ohos_ws_server_endpoint.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_WS_OHOS_WS_SERVER_ENDPOINT_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_WS_OHOS_WS_SERVER_ENDPOINT_H - -#include "server/websocket_server.h" - -#include "connection/server_endpoint_base.h" - -namespace ark::tooling::inspector { -// Server endpoint based on OHOS websocket implementation -// NOLINTNEXTLINE(fuchsia-multiple-inheritance) -class OhosWsServerEndpoint : public ServerEndpointBase { -protected: - using Endpoint = OHOS::ArkCompiler::Toolchain::WebSocketServer; - -public: - OhosWsServerEndpoint() noexcept; - -protected: - Endpoint endpoint_; // NOLINT(misc-non-private-member-variables-in-classes) - -private: - void SendMessage(const std::string &message) override - { - auto wasSent = false; - if (endpoint_.IsConnected()) { - wasSent = endpoint_.SendReply(message); - } - if (!wasSent) { - LOG(INFO, DEBUGGER) << "Did not send message: " << message; - } - } -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_OHOS_WS_OHOS_WS_SERVER_ENDPOINT_H diff --git a/tooling/static/connection/server.h b/tooling/static/connection/server.h deleted file mode 100644 index 46ef13fd..00000000 --- a/tooling/static/connection/server.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_H - -#include - -#include "json_serialization/serializable.h" -#include "libpandabase/utils/expected.h" -#include "libpandabase/utils/json_builder.h" - -#include "connection/event_loop.h" -#include "json_serialization/jrpc_error.h" - -namespace ark { -class JsonObject; -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { -class Server : public virtual EventLoop { // NOLINT(fuchsia-virtual-inheritance) -public: - using MethodResponse = Expected, JRPCError>; - using Handler = std::function; - -public: - virtual void OnValidate(std::function &&handler) = 0; - virtual void OnOpen(std::function &&handler) = 0; - virtual void OnFail(std::function &&handler) = 0; - - virtual void Call(const std::string &sessionId, const char *method, - std::function &¶ms) = 0; - - void Call(const char *method, std::function &¶ms) - { - Call({}, method, std::move(params)); - } - - void Call(const std::string &sessionId, const char *method) - { - Call(sessionId, method, [](JsonObjectBuilder & /* builder */) {}); - } - - void Call(const char *method) - { - Call({}, method, [](JsonObjectBuilder & /* builder */) {}); - } - - virtual void OnCall(const char *method, Handler &&handler) = 0; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_H diff --git a/tooling/static/connection/server_endpoint_base.cpp b/tooling/static/connection/server_endpoint_base.cpp deleted file mode 100644 index bedbc976..00000000 --- a/tooling/static/connection/server_endpoint_base.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "connection/server_endpoint_base.h" - -#include "utils/logger.h" - -namespace ark::tooling::inspector { - -/// Empty response, returned on success -class EmptyResponse final : public JsonSerializable { -public: - EmptyResponse() = default; - - DEFAULT_COPY_SEMANTIC(EmptyResponse); - DEFAULT_MOVE_SEMANTIC(EmptyResponse); - - ~EmptyResponse() override = default; - - void Serialize([[maybe_unused]] JsonObjectBuilder &builder) const override {} -}; - -void ServerEndpointBase::Call(const std::string &sessionId, const char *method, - std::function &¶ms) -{ - EndpointBase::Call(sessionId, std::nullopt, method, std::move(params)); -} - -void ServerEndpointBase::OnCall(const char *method, Handler &&handler) -{ - EndpointBase::OnCall(method, [this, handler = std::move(handler)](auto &sessionId, auto id, auto ¶ms) { - if (!id) { - LOG(INFO, DEBUGGER) << "Invalid request: request has no \"id\""; - return; - } - - // Execute the handler's code - auto optResult = handler(sessionId, params); - if (optResult) { - if (*optResult) { - JsonSerializable &res = **optResult; - Reply(sessionId, *id, res); - } else { - Reply(sessionId, *id, EmptyResponse()); - } - } else { - ReplyError(sessionId, *id, std::move(optResult.Error())); - } - }); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/connection/server_endpoint_base.h b/tooling/static/connection/server_endpoint_base.h deleted file mode 100644 index 96ebe5d6..00000000 --- a/tooling/static/connection/server_endpoint_base.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_ENDPOINT_BASE_H -#define PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_ENDPOINT_BASE_H - -#include - -#include "connection/endpoint_base.h" -#include "connection/server.h" - -namespace ark::tooling::inspector { -// Base class for server endpoints implementations. -// Provides callbacks to be executed during client connections handling. -// NOLINTNEXTLINE(fuchsia-multiple-inheritance) -class ServerEndpointBase : public EndpointBase, public Server { -public: - using MethodResponse = Expected, JRPCError>; - using Handler = std::function; - -public: - void OnValidate(std::function &&handler) override - { - onValidate_ = std::move(handler); - } - - void OnOpen(std::function &&handler) override - { - onOpen_ = std::move(handler); - } - - void OnFail(std::function &&handler) override - { - onFail_ = std::move(handler); - } - - using Server::Call; - void Call(const std::string &sessionId, const char *method, - std::function &¶ms) override; - - void OnCall(const char *method, Handler &&handler) override; - -protected: - std::function onValidate_ = []() {}; // NOLINT(misc-non-private-member-variables-in-classes) - std::function onOpen_ = []() {}; // NOLINT(misc-non-private-member-variables-in-classes) - std::function onFail_ = []() {}; // NOLINT(misc-non-private-member-variables-in-classes) -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONNECTION_SERVER_ENDPOINT_BASE_H diff --git a/tooling/static/debugger/breakpoint.cpp b/tooling/static/debugger/breakpoint.cpp deleted file mode 100644 index 91e2cee9..00000000 --- a/tooling/static/debugger/breakpoint.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "breakpoint.h" - -#include "debug_info_extractor.h" -#include "error.h" -#include "evaluation/evaluation_engine.h" - -namespace ark::tooling::inspector { - -bool Breakpoint::SetLocations(std::set &sourceFiles, const DebugInfoCache &debugCache, - std::unordered_multimap &breakpointLocations) -{ - locations_ = debugCache.GetBreakpointLocations(sourceFileFilter_, lineNumber_, sourceFiles); - if (locations_.empty()) { - LOG(WARNING, DEBUGGER) << "Pending breakpoint, 0 locations resolved currently, id = " << GetId(); - return true; - } - - for (auto &location : locations_) { - breakpointLocations.emplace(location, GetId()); - } - Resolve(); - return true; -} - -void Breakpoint::TryResolveImpl(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) -{ - auto lineHandler = [this, &breakpointLocations](const auto &pandaFile, auto methodId, auto &entry) { - if (entry.line == lineNumber_) { - auto [it, _] = locations_.emplace(pandaFile.GetFilename().data(), methodId, entry.offset); - breakpointLocations.emplace(*it, GetId()); - Resolve(); - // Must choose the first found bytecode location in each method - return false; - } - // Continue search - return true; - }; - - for (const auto &methodId : debugInfo->GetMethodIdList()) { - if (!sourceFileFilter_(debugInfo->GetSourceFile(methodId))) { - continue; - } - - auto &table = debugInfo->GetLineNumberTable(methodId); - for (auto &entry : table) { - if (!lineHandler(file, methodId, entry)) { - break; - } - } - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/breakpoint.h b/tooling/static/debugger/breakpoint.h deleted file mode 100644 index 3d7721e0..00000000 --- a/tooling/static/debugger/breakpoint.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_BREAKPOINT_H -#define PANDA_TOOLING_INSPECTOR_BREAKPOINT_H - -#include -#include -#include - -#include "breakpoint_base.h" - -namespace ark::tooling::inspector { -class EvaluationEngine; - -/// @brief Breakpoint without condition, can be set in multiple locations -class Breakpoint final : public BreakpointBase { -public: - explicit Breakpoint(BreakpointId id, SourceFileFilter &&filter, size_t line, bool isUrlPattern) - : BreakpointBase(id), sourceFileFilter_(std::move(filter)), lineNumber_(line), isUrlPattern_(isUrlPattern) - { - } - - NO_COPY_SEMANTIC(Breakpoint); - NO_MOVE_SEMANTIC(Breakpoint); - - ~Breakpoint() override = default; - - bool SetLocations(std::set &sourceFiles, const DebugInfoCache &debugCache, - std::unordered_multimap &breakpointLocations) override; - - void EnumerateLocations(const std::function &func) override - { - for (const auto &loc : locations_) { - if (!func(GetId(), loc)) { - return; - } - } - } - - bool ShouldStopAt(const PtLocation &location, [[maybe_unused]] EvaluationEngine &engine) override - { - if (!IsResolved()) { - return false; - } - return std::any_of(locations_.begin(), locations_.end(), - [location](const auto &loc) { return loc == location; }); - } - - bool IsUrlPattern() - { - return isUrlPattern_; - } - -protected: - void TryResolveImpl(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) override; - -private: - std::unordered_set locations_; - SourceFileFilter sourceFileFilter_; - size_t lineNumber_ {0}; - bool isUrlPattern_ {false}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_BREAKPOINT_H diff --git a/tooling/static/debugger/breakpoint_base.h b/tooling/static/debugger/breakpoint_base.h deleted file mode 100644 index da39a327..00000000 --- a/tooling/static/debugger/breakpoint_base.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_BREAKPOINT_BASE_H -#define PANDA_TOOLING_INSPECTOR_BREAKPOINT_BASE_H - -#include -#include -#include - -#include "common.h" -#include "debug_info_cache.h" -#include "tooling/debugger.h" -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { -class EvaluationEngine; - -/// @brief Base breakpoint class -class BreakpointBase { -public: - explicit BreakpointBase(BreakpointId id) : id_(id) {} - - DEFAULT_COPY_SEMANTIC(BreakpointBase); - DEFAULT_MOVE_SEMANTIC(BreakpointBase); - - virtual ~BreakpointBase() = default; - - /** - * @brief Get breakpoint id - * @returns BreakpointId - */ - BreakpointId GetId() const - { - return id_; - } - - /** - * @brief If breakpoint resolved and can be hit - * @returns true/false - */ - bool IsResolved() const - { - return resolved_; - } - - /** - * @brief Tries to resolve breakpoint, shuould be called on load new panda file - * @param[in] file loaded panda file - * @param[in] debugInfo extractor with already added file - * @returns Was breakpoint resolved - */ - bool TryResolve(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) - { - TryResolveImpl(file, debugInfo, breakpointLocations); - return IsResolved(); - } - - /** - * @brief Applies function to every breakpoint location - * @param[in] func function to apply to every breakpoint - */ - virtual void EnumerateLocations(const std::function &func) = 0; - - /** - * @brief Check if should stop at location - * @param[in] location - * @param[in] engine to evaluate conditions for conditional breakpoint - * @returns true/false - */ - virtual bool ShouldStopAt(const PtLocation &location, EvaluationEngine &engine) = 0; - - /** - * @brief Set locations for current breakpoint - * @param[out] sourceFiles returns sourceFiles where breakpoint was set - * @param[in] debugCache debug cache to link src files with bytecode executable - * @param[out] breakpointLocations map of breakpoint locations from storage - * @returns BreakpointId of set breakpoint. - */ - virtual bool SetLocations(std::set &sourceFiles, const DebugInfoCache &debugCache, - std::unordered_multimap &breakpointLocations) = 0; - -protected: - virtual void TryResolveImpl( - const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) = 0; - - void Resolve() - { - resolved_ = true; - } - -private: - BreakpointId id_; - bool resolved_ {false}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_BREAKPOINT_BASE_H diff --git a/tooling/static/debugger/breakpoint_storage.cpp b/tooling/static/debugger/breakpoint_storage.cpp deleted file mode 100644 index f0a7185f..00000000 --- a/tooling/static/debugger/breakpoint_storage.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "breakpoint_storage.h" - -#include "breakpoint.h" -#include "conditional_breakpoint.h" -#include "os/mutex.h" - -namespace ark::tooling::inspector { - -bool BreakpointStorage::ShouldStopAtBreakpoint(const PtLocation &location, EvaluationEngine &engine) -{ - os::memory::ReadLockHolder lock(lock_); - - if (!breakpointsActive_) { - return false; - } - - auto rng = breakpointLocations_.equal_range(location); - - for (auto iter = rng.first; iter != rng.second; ++iter) { - BreakpointId bpId = iter->second; - bool shouldStop = breakpointStorage_[bpId]->ShouldStopAt(location, engine); - if (shouldStop) { - return true; - } - } - return false; -} - -void BreakpointStorage::ResolveBreakpoints(const panda_file::File &file, - const panda_file::DebugInfoExtractor *debugInfoCache) -{ - os::memory::ReadLockHolder lock(lock_); - - for (auto &[_, bp] : breakpointStorage_) { - bp->TryResolve(file, debugInfoCache, breakpointLocations_); - // if bp resolved add locations - } -} - -void BreakpointStorage::RemoveBreakpoint(BreakpointId id) -{ - os::memory::WriteLockHolder lock(lock_); - - for (auto it = breakpointLocations_.begin(); it != breakpointLocations_.end();) { - if (it->second == id) { - it = breakpointLocations_.erase(it); - } else { - ++it; - } - } - breakpointStorage_.erase(id); -} - -std::optional BreakpointStorage::SetBreakpoint(SourceFileFilter &&sourceFilesFilter, size_t lineNumber, - std::set &sourceFiles, - const std::string *condition, - const DebugInfoCache &debugCache) -{ - os::memory::WriteLockHolder lock(lock_); - - auto id = nextBreakpointId_; - std::unique_ptr bbp; - - if (condition == nullptr) { - bbp = std::make_unique(id, std::move(sourceFilesFilter), lineNumber, true); - } else { - bbp = std::make_unique(id, std::move(sourceFilesFilter), lineNumber, condition); - } - - if (!bbp->SetLocations(sourceFiles, debugCache, breakpointLocations_)) { - // Only if many locations for conditional bp, it will be destroyed, no need to increase id. - return std::nullopt; - } - // bp with correct locations, or pending with no locations - ++nextBreakpointId_; - breakpointStorage_[id] = std::move(bbp); - return id; -} - -void BreakpointStorage::Reset() -{ - os::memory::WriteLockHolder lock(lock_); - - breakpointsActive_ = true; - nextBreakpointId_ = 0; - breakpointLocations_.clear(); - breakpointStorage_.clear(); -} - -void BreakpointStorage::SetBreakpointsActive(bool active) -{ - os::memory::WriteLockHolder lock(lock_); - - breakpointsActive_ = active; -} - -std::vector BreakpointStorage::GetBreakpointsByLocation(const PtLocation &location) const -{ - os::memory::ReadLockHolder lock(lock_); - - std::vector hitBreakpoints; - - auto range = breakpointLocations_.equal_range(location); - std::transform(range.first, range.second, std::back_inserter(hitBreakpoints), [](auto &p) { return p.second; }); - - return hitBreakpoints; -} - -void BreakpointStorage::RemoveBreakpoints(const std::function &filter) -{ - os::memory::WriteLockHolder lock(lock_); - - std::vector breakpointsToRemove; - for (const auto &[loc, id] : breakpointLocations_) { - if (filter(loc)) { - breakpointsToRemove.emplace_back(id); - } - } - - for (auto id : breakpointsToRemove) { - for (auto it = breakpointLocations_.begin(); it != breakpointLocations_.end();) { - if (it->second == id) { - it = breakpointLocations_.erase(it); - } else { - ++it; - } - } - breakpointStorage_.erase(id); - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/breakpoint_storage.h b/tooling/static/debugger/breakpoint_storage.h deleted file mode 100644 index 36ec95d0..00000000 --- a/tooling/static/debugger/breakpoint_storage.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_BREAKPOINT_STORAGE_H -#define PANDA_TOOLING_INSPECTOR_BREAKPOINT_STORAGE_H - -#include -#include -#include - -#include "breakpoint_base.h" -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -/** - * @brief Blocking breakpoint storage class, adds functionality to add/remove/enable/disable breakpoints, - * Allows threads to check if it should stop at location - */ -class BreakpointStorage final { -public: - BreakpointStorage() = default; - - NO_COPY_SEMANTIC(BreakpointStorage); - NO_MOVE_SEMANTIC(BreakpointStorage); - - ~BreakpointStorage() = default; - - /** - * @brief Enable/disable breakpoints - * @param[in] active bool arg - */ - void SetBreakpointsActive(bool active); - - /** - * @brief Get breakpoint id vector by location - * @param[in] location - * @returns std::vector of ids - */ - std::vector GetBreakpointsByLocation(const PtLocation &location) const; - - /** - * @brief Set a breakpoint with optional condition. - * @param[in] sourceFilesFilter handler to filter src files. - * @param[in] lineNumber line in filtered src files. - * @param[out] sourceFiles returns sourceFiles where breakpoint was set - * @param[in] condition code fragment to compiled and evaluated for conditional bp - * @param[in] debugCache debug cache to link src files with bytecode executable - * @returns BreakpointId of set breakpoint. - */ - std::optional SetBreakpoint(SourceFileFilter &&sourceFilesFilter, size_t lineNumber, - std::set &sourceFiles, const std::string *condition, - const DebugInfoCache &debugCache); - - /** - * @brief Removes breakpoint by id - * @param[in] id - */ - void RemoveBreakpoint(BreakpointId id); - - /** - * @brief Check if should stop at location - * @param[in] location - * @param[in] engine to evaluate conditions for conditional breakpoint - * @returns true/false - */ - bool ShouldStopAtBreakpoint(const PtLocation &location, EvaluationEngine &engine); - - /** - * @brief Resolves pending breakpoints on new pandafile load - * @param[in] file loaded file - * @param[in] debugInfoCache debugcache with already added file - */ - void ResolveBreakpoints(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfoCache); - - /// @brief Resets storage to empty state - void Reset(); - - /** - * @brief Removes breakpoint by filter function - * @param[in] filter function to apply to every breakpoint - */ - void RemoveBreakpoints(const std::function &filter); - -private: - mutable os::memory::RWLock lock_; - bool breakpointsActive_ GUARDED_BY(lock_) {true}; - BreakpointId nextBreakpointId_ GUARDED_BY(lock_) = 0; - std::unordered_multimap breakpointLocations_ GUARDED_BY(lock_); - std::unordered_map> breakpointStorage_ GUARDED_BY(lock_); -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_BREAKPOINT_STORAGE_H diff --git a/tooling/static/debugger/conditional_breakpoint.cpp b/tooling/static/debugger/conditional_breakpoint.cpp deleted file mode 100644 index e49c80ba..00000000 --- a/tooling/static/debugger/conditional_breakpoint.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "conditional_breakpoint.h" - -#include "debug_info_extractor.h" -#include "error.h" -#include "evaluation/evaluation_engine.h" - -namespace ark::tooling::inspector { - -bool ConditionalBreakpoint::ShouldStopAt(const PtLocation &location, EvaluationEngine &engine) -{ - if (!location_.has_value() || !(*location_ == location)) { - return false; - } - // Condition is evaluated in the context of top frame - auto evalRes = engine.EvaluateExpression(0, bytecode_, &method_); - if (!evalRes) { - HandleError(evalRes.Error()); - return false; - } - if (evalRes.Value().second != nullptr) { - LOG(WARNING, DEBUGGER) << "Breakpoint #" << GetId() << " condition evaluated with an exception"; - return false; - } - return evalRes.Value().first.GetAsU1(); -} - -bool ConditionalBreakpoint::SetLocations( - std::set &sourceFiles, const DebugInfoCache &debugCache, - std::unordered_multimap &breakpointLocations) -{ - auto locations = debugCache.GetBreakpointLocations(sourceFileFilter_, lineNumber_, sourceFiles); - if (locations.size() > 1) { - LOG(WARNING, DEBUGGER) << "Will not set conditional breakpoint for more than one location"; - return false; - } - - if (locations.empty()) { - LOG(WARNING, DEBUGGER) << "Pending breakpoint, 0 locations resolved currently, id = " << GetId(); - return true; - } - - location_ = *locations.begin(); - breakpointLocations.emplace(location_.value(), GetId()); - Resolve(); - return true; -} - -void ConditionalBreakpoint::TryResolveImpl( - const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) -{ - if (IsResolved()) { - return; - } - - auto lineHandler = [this, &breakpointLocations](const auto &pandaFile, auto methodId, auto &entry) { - if (entry.line == lineNumber_) { - location_.emplace(pandaFile.GetFilename().data(), methodId, entry.offset); - breakpointLocations.emplace(location_.value(), GetId()); - Resolve(); - // Must choose the first found bytecode location in each method - return false; - } - // Continue search - return true; - }; - - for (const auto &methodId : debugInfo->GetMethodIdList()) { - if (!sourceFileFilter_(debugInfo->GetSourceFile(methodId))) { - continue; - } - - auto &table = debugInfo->GetLineNumberTable(methodId); - for (auto &entry : table) { - if (!lineHandler(file, methodId, entry)) { - break; - } - } - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/conditional_breakpoint.h b/tooling/static/debugger/conditional_breakpoint.h deleted file mode 100644 index aa412f0e..00000000 --- a/tooling/static/debugger/conditional_breakpoint.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_CONDITIONAL_BREAKPOINT_H -#define PANDA_TOOLING_INSPECTOR_CONDITIONAL_BREAKPOINT_H - -#include -#include -#include - -#include "breakpoint_base.h" - -namespace ark::tooling::inspector { -class EvaluationEngine; - -/// @brief Conditional breakpoint, allows only one location, condition is evaluated on breakpoint hit -class ConditionalBreakpoint final : public BreakpointBase { -public: - explicit ConditionalBreakpoint(BreakpointId id, SourceFileFilter &&filter, size_t line, const std::string *bytecode) - : BreakpointBase(id), sourceFileFilter_(std::move(filter)), lineNumber_(line), bytecode_(*bytecode) - { - } - - NO_COPY_SEMANTIC(ConditionalBreakpoint); - NO_MOVE_SEMANTIC(ConditionalBreakpoint); - - ~ConditionalBreakpoint() override = default; - - bool SetLocations(std::set &sourceFiles, const DebugInfoCache &debugCache, - std::unordered_multimap &breakpointLocations) override; - - void EnumerateLocations(const std::function &func) override - { - if (location_) { - func(GetId(), *location_); - } - } - - bool ShouldStopAt(const PtLocation &location, EvaluationEngine &engine) override; - -protected: - void TryResolveImpl(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo, - std::unordered_multimap &breakpointLocations) override; - -private: - std::optional location_; - SourceFileFilter sourceFileFilter_; - size_t lineNumber_ {0}; - std::string bytecode_; - Method *method_ {nullptr}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_CONDITIONAL_BREAKPOINT_H diff --git a/tooling/static/debugger/debug_info_cache.cpp b/tooling/static/debugger/debug_info_cache.cpp deleted file mode 100644 index af65685f..00000000 --- a/tooling/static/debugger/debug_info_cache.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debug_info_cache.h" - -#include "debug_info_extractor.h" -#include "include/tooling/pt_location.h" -#include "libpandabase/utils/bit_utils.h" -#include "method_data_accessor.h" -#include "os/mutex.h" - -namespace ark::tooling::inspector { -void DebugInfoCache::AddPandaFile(const panda_file::File &file) -{ - os::memory::LockHolder lock(debugInfosMutex_); - const auto &debugInfo = - debugInfos_ - .emplace(std::piecewise_construct, std::forward_as_tuple(&file), - std::forward_as_tuple(file, - [this, &file](auto methodId, auto sourceName) { - os::memory::LockHolder l(disassembliesMutex_); - disassemblies_.emplace(std::piecewise_construct, - std::forward_as_tuple(sourceName), - std::forward_as_tuple(file, methodId)); - })) - .first->second; - - // For all methods add non-empty source code read from debug-info - for (auto methodId : debugInfo.GetMethodIdList()) { - std::string_view sourceRelativePath = debugInfo.GetSourceFile(methodId); - std::string_view sourceCode = debugInfo.GetSourceCode(methodId); - if (!sourceCode.empty()) { - auto inserted = fileToSourceCode_.try_emplace(sourceRelativePath, sourceCode).second; - if (!inserted) { - LOG(WARNING, DEBUGGER) << "Duplicate source code in debug info for file \"" << sourceRelativePath - << '"'; - } - } - } -} - -void DebugInfoCache::GetSourceLocation(const PtFrame &frame, std::string_view &sourceFile, std::string_view &methodName, - size_t &lineNumber) -{ - auto method = frame.GetMethod(); - auto pandaFile = method->GetPandaFile(); - auto debugInfo = GetDebugInfo(pandaFile); - if (debugInfo == nullptr) { - lineNumber = 1; - return; - } - sourceFile = debugInfo->GetSourceFile(method->GetFileId()); - - methodName = utf::Mutf8AsCString(method->GetName().data); - - // Line number entry corresponding to the bytecode location is - // the last such entry for which the bytecode offset is not greater than - // the given offset. Use `std::upper_bound` to find the first entry - // for which the condition is not true, and then step back. - auto &table = debugInfo->GetLineNumberTable(method->GetFileId()); - auto lineNumberIter = std::upper_bound(table.begin(), table.end(), frame.GetBytecodeOffset(), - [](auto offset, auto &entry) { return offset < entry.offset; }); - ASSERT(lineNumberIter != table.begin()); - lineNumber = std::prev(lineNumberIter)->line; -} - -std::unordered_set DebugInfoCache::GetCurrentLineLocations(const PtFrame &frame) -{ - std::unordered_set locations; - - auto method = frame.GetMethod(); - auto pandaFile = method->GetPandaFile(); - auto methodId = method->GetFileId(); - auto &table = GetDebugInfo(pandaFile)->GetLineNumberTable(methodId); - auto it = std::upper_bound(table.begin(), table.end(), frame.GetBytecodeOffset(), - [](auto offset, auto entry) { return offset < entry.offset; }); - if (it == table.begin()) { - return locations; - } - auto lineNumber = (--it)->line; - - for (it = table.begin(); it != table.end(); ++it) { - if (it->line != lineNumber) { - continue; - } - - auto next = it + 1; - auto nextOffset = next != table.end() ? next->offset : method->GetCodeSize(); - for (auto o = it->offset; o < nextOffset; o++) { - locations.emplace(pandaFile->GetFilename().c_str(), methodId, o); - } - } - - return locations; -} - -std::unordered_set DebugInfoCache::GetContinueToLocations(std::string_view sourceFile, - size_t lineNumber) -{ - std::unordered_set locations; - EnumerateLineEntries( - [](auto, auto &) { return true; }, - [sourceFile](auto, auto &debugInfo, auto methodId) { return debugInfo.GetSourceFile(methodId) == sourceFile; }, - [lineNumber, &locations](auto pandaFile, auto &, auto methodId, auto &entry, auto next) { - if (entry.line != lineNumber) { - // continue enumeration - return true; - } - - uint32_t nextOffset; - if (next == nullptr) { - panda_file::MethodDataAccessor mda(*pandaFile, methodId); - if (auto codeId = mda.GetCodeId()) { - nextOffset = panda_file::CodeDataAccessor(*pandaFile, *codeId).GetCodeSize(); - } else { - nextOffset = 0; - } - } else { - nextOffset = next->offset; - } - - for (auto o = entry.offset; o < nextOffset; o++) { - locations.emplace(pandaFile->GetFilename().data(), methodId, o); - } - return true; - }); - return locations; -} - -std::unordered_set DebugInfoCache::GetBreakpointLocations( - const std::function &sourceFileFilter, size_t lineNumber, - std::set &sourceFiles) const -{ - std::unordered_set locations; - sourceFiles.clear(); - // clang-format off - EnumerateLineEntries( - [](auto, auto &) { return true; }, - [&sourceFileFilter](auto, auto &debugInfo, auto methodId) { - return sourceFileFilter(debugInfo.GetSourceFile(methodId)); - }, - [lineNumber, &sourceFiles, &locations](auto pandaFile, auto &debugInfo, auto methodId, - auto &entry, auto /* next */) { - if (entry.line == lineNumber) { - sourceFiles.insert(debugInfo.GetSourceFile(methodId)); - locations.emplace(pandaFile->GetFilename().data(), methodId, entry.offset); - // Must choose the first found bytecode location in each method - return false; - } - // Continue search - return true; - }); - // clang-format on - return locations; -} - -std::set DebugInfoCache::GetValidLineNumbers(std::string_view sourceFile, size_t startLine, size_t endLine, - bool restrictToFunction) -{ - std::set lineNumbers; - auto lineHandler = [startLine, endLine, &lineNumbers](auto, auto &, auto, auto &entry, auto /* next */) { - if (entry.line >= startLine && entry.line < endLine) { - lineNumbers.insert(entry.line); - } - - return true; - }; - if (!restrictToFunction) { - EnumerateLineEntries([](auto, auto &) { return true; }, - [sourceFile](auto, auto &debugInfo, auto methodId) { - return (debugInfo.GetSourceFile(methodId) == sourceFile); - }, - lineHandler); - return lineNumbers; - } - - auto methodFilter = [sourceFile, startLine](auto, auto &debugInfo, auto methodId) { - if (debugInfo.GetSourceFile(methodId) != sourceFile) { - return false; - } - - bool hasLess = false; - bool hasGreater = false; - for (auto &entry : debugInfo.GetLineNumberTable(methodId)) { - if (entry.line <= startLine) { - hasLess = true; - } - - if (entry.line >= startLine) { - hasGreater = true; - } - - if (hasLess && hasGreater) { - break; - } - } - - return hasLess && hasGreater; - }; - EnumerateLineEntries([](auto, auto &) { return true; }, methodFilter, lineHandler); - return lineNumbers; -} - -// NOLINTBEGIN(readability-magic-numbers) -static TypedValue CreateTypedValueFromReg(uint64_t reg, panda_file::Type::TypeId type) -{ - switch (type) { - case panda_file::Type::TypeId::INVALID: - return TypedValue::Invalid(); - case panda_file::Type::TypeId::VOID: - return TypedValue::Void(); - case panda_file::Type::TypeId::U1: - return TypedValue::U1(static_cast(ExtractBits(reg, 0U, 1U))); - case panda_file::Type::TypeId::I8: - return TypedValue::I8(static_cast(ExtractBits(reg, 0U, 8U))); - case panda_file::Type::TypeId::U8: - return TypedValue::U8(static_cast(ExtractBits(reg, 0U, 8U))); - case panda_file::Type::TypeId::I16: - return TypedValue::I16(static_cast(ExtractBits(reg, 0U, 16U))); - case panda_file::Type::TypeId::U16: - return TypedValue::U16(static_cast(ExtractBits(reg, 0U, 16U))); - case panda_file::Type::TypeId::I32: - return TypedValue::I32(static_cast(ExtractBits(reg, 0U, 32U))); - case panda_file::Type::TypeId::U32: - return TypedValue::U32(static_cast(ExtractBits(reg, 0U, 32U))); - case panda_file::Type::TypeId::F32: - return TypedValue::F32(bit_cast(static_cast(ExtractBits(reg, 0U, 32U)))); - case panda_file::Type::TypeId::F64: - return TypedValue::F64(bit_cast(reg)); - case panda_file::Type::TypeId::I64: - return TypedValue::I64(reg); - case panda_file::Type::TypeId::U64: - return TypedValue::U64(reg); - case panda_file::Type::TypeId::REFERENCE: - return TypedValue::Reference(reinterpret_cast(reg)); - case panda_file::Type::TypeId::TAGGED: - return TypedValue::Tagged(coretypes::TaggedValue(static_cast(reg))); - default: - UNREACHABLE(); - return TypedValue::Invalid(); - } -} -// NOLINTEND(readability-magic-numbers) - -static panda_file::Type::TypeId GetTypeIdBySignature(char signature) -{ - switch (signature) { - case 'V': - return panda_file::Type::TypeId::VOID; - case 'Z': - return panda_file::Type::TypeId::U1; - case 'B': - return panda_file::Type::TypeId::I8; - case 'H': - return panda_file::Type::TypeId::U8; - case 'S': - return panda_file::Type::TypeId::I16; - case 'C': - return panda_file::Type::TypeId::U16; - case 'I': - return panda_file::Type::TypeId::I32; - case 'U': - return panda_file::Type::TypeId::U32; - case 'F': - return panda_file::Type::TypeId::F32; - case 'D': - return panda_file::Type::TypeId::F64; - case 'J': - return panda_file::Type::TypeId::I64; - case 'Q': - return panda_file::Type::TypeId::U64; - case 'A': - return panda_file::Type::TypeId::TAGGED; - case 'L': - case '[': - return panda_file::Type::TypeId::REFERENCE; - default: - return panda_file::Type::TypeId::INVALID; - } -} - -std::map DebugInfoCache::GetLocals(const PtFrame &frame) -{ - std::map result; - - auto localHandler = [&result](const std::string &name, const std::string &signature, uint64_t reg, - PtFrame::RegisterKind kind) { - auto type = signature.empty() ? panda_file::Type::TypeId::INVALID : GetTypeIdBySignature(signature[0]); - if (type == panda_file::Type::TypeId::INVALID) { - switch (kind) { - case PtFrame::RegisterKind::PRIMITIVE: - type = panda_file::Type::TypeId::U64; - break; - case PtFrame::RegisterKind::REFERENCE: - type = panda_file::Type::TypeId::REFERENCE; - break; - case PtFrame::RegisterKind::TAGGED: - type = panda_file::Type::TypeId::TAGGED; - break; - default: - UNREACHABLE(); - break; - } - } - - result.emplace(name, CreateTypedValueFromReg(reg, type)); - }; - - auto method = frame.GetMethod(); - auto methodId = method->GetFileId(); - auto debugInfo = GetDebugInfo(method->GetPandaFile()); - if (debugInfo == nullptr) { - return result; - } - auto ¶meters = debugInfo->GetParameterInfo(methodId); - for (auto i = 0U; i < parameters.size(); i++) { - auto ¶meter = parameters[i]; - localHandler(parameter.name, parameter.signature, frame.GetArgument(i), frame.GetArgumentKind(i)); - } - - auto &variables = debugInfo->GetLocalVariableTable(methodId); - auto frameOffset = frame.GetBytecodeOffset(); - for (auto &variable : variables) { - if (variable.IsAccessibleAt(frameOffset)) { - localHandler(variable.name, variable.typeSignature, - // We introduced a hack in DisasmBackedDebugInfoExtractor, assigning -1 to Accumulator - variable.regNumber == -1 ? frame.GetAccumulator() : frame.GetVReg(variable.regNumber), - variable.regNumber == -1 ? frame.GetAccumulatorKind() : frame.GetVRegKind(variable.regNumber)); - } - } - - return result; -} - -std::string DebugInfoCache::GetSourceCode(std::string_view sourceFile) -{ - { - os::memory::LockHolder lock(disassembliesMutex_); - - auto it = disassemblies_.find(sourceFile); - if (it != disassemblies_.end()) { - return GetDebugInfo(&it->second.first)->GetSourceCode(it->second.second); - } - } - - // Try to get source code read from debug info - { - os::memory::LockHolder lock(debugInfosMutex_); - - auto iter = fileToSourceCode_.find(sourceFile); - if (iter != fileToSourceCode_.end()) { - return std::string(iter->second); - } - } - - if (!os::file::File::IsRegularFile(sourceFile.data())) { - return {}; - } - - std::string result; - - std::stringstream buffer; - buffer << std::ifstream(sourceFile.data()).rdbuf(); - - result = buffer.str(); - if (!result.empty() && result.back() != '\n') { - result += "\n"; - } - - return result; -} - -std::vector DebugInfoCache::GetPandaFiles(const std::function &sourceFileFilter) -{ - std::vector pandaFiles; - // clang-format off - EnumerateLineEntries( - [](auto, auto &) { return true; }, - [&sourceFileFilter](auto, auto &debugInfo, auto methodId) { - return sourceFileFilter(debugInfo.GetSourceFile(methodId)); - }, - [&pandaFiles](const auto *pf, auto &, auto, auto &, auto) { - pandaFiles.emplace_back(pf->GetFilename()); - return false; - }); - // clang-format on - return pandaFiles; -} - -const panda_file::DebugInfoExtractor *DebugInfoCache::GetDebugInfo(const panda_file::File *file) const -{ - os::memory::LockHolder lock(debugInfosMutex_); - auto it = debugInfos_.find(file); - if (it == debugInfos_.end()) { - return nullptr; - } - return &it->second; -} - -const char *DebugInfoCache::GetSourceFile(Method *method) -{ - auto pandaFile = method->GetPandaFile(); - auto debugInfo = GetDebugInfo(pandaFile); - if (debugInfo == nullptr) { - return nullptr; - } - return debugInfo->GetSourceFile(method->GetFileId()); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/debug_info_cache.h b/tooling/static/debugger/debug_info_cache.h deleted file mode 100644 index 27b8dce3..00000000 --- a/tooling/static/debugger/debug_info_cache.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_DEBUG_INFO_CACHE_H -#define PANDA_TOOLING_INSPECTOR_DEBUG_INFO_CACHE_H - -#include -#include -#include -#include -#include - -#include "disassembler/disasm_backed_debug_info_extractor.h" -#include "include/typed_value.h" -#include "runtime/tooling/debugger.h" - -namespace ark::tooling::inspector { -class DebugInfoCache final { -public: - DebugInfoCache() = default; - ~DebugInfoCache() = default; - - NO_COPY_SEMANTIC(DebugInfoCache); - NO_MOVE_SEMANTIC(DebugInfoCache); - - void AddPandaFile(const panda_file::File &file); - void GetSourceLocation(const PtFrame &frame, std::string_view &sourceFile, std::string_view &methodName, - size_t &lineNumber); - std::unordered_set GetCurrentLineLocations(const PtFrame &frame); - std::unordered_set GetContinueToLocations(std::string_view sourceFile, size_t lineNumber); - std::unordered_set GetBreakpointLocations( - const std::function &sourceFileFilter, size_t lineNumber, - std::set &sourceFiles) const; - std::set GetValidLineNumbers(std::string_view sourceFile, size_t startLine, size_t endLine, - bool restrictToFunction); - - std::map GetLocals(const PtFrame &frame); - - std::string GetSourceCode(std::string_view sourceFile); - - std::vector GetPandaFiles(const std::function &sourceFileFilter); - - const char *GetSourceFile(Method *method); - - const panda_file::DebugInfoExtractor *GetDebugInfo(const panda_file::File *file) const; - -private: - template - void EnumerateLineEntries(PFF &&pandaFileFilter, MF &&methodFilter, H &&handler) const - { - os::memory::LockHolder lock(debugInfosMutex_); - - for (auto &[file, debugInfo] : debugInfos_) { - if (!pandaFileFilter(file, debugInfo)) { - continue; - } - - EnumerateLineEntries(file, debugInfo, std::forward(methodFilter), std::forward(handler)); - } - } - - template - void EnumerateLineEntries(const panda_file::File *file, const disasm::DisasmBackedDebugInfoExtractor &debugInfo, - MF &&methodFilter, H &&handler) const REQUIRES(debugInfosMutex_) - { - for (const auto &methodId : debugInfo.GetMethodIdList()) { - if (!methodFilter(file, debugInfo, methodId)) { - continue; - } - - EnumerateLineEntries(file, debugInfo, methodId, std::forward(handler)); - } - } - - template - void EnumerateLineEntries(const panda_file::File *file, const disasm::DisasmBackedDebugInfoExtractor &debugInfo, - panda_file::File::EntityId methodId, H &&handler) const REQUIRES(debugInfosMutex_) - { - auto &table = debugInfo.GetLineNumberTable(methodId); - for (auto it = table.begin(); it != table.end(); ++it) { - auto next = it + 1; - if (!handler(file, debugInfo, methodId, *it, next != table.end() ? &*next : nullptr)) { - break; - } - } - } - - mutable os::memory::Mutex debugInfosMutex_; - std::unordered_map debugInfos_ - GUARDED_BY(debugInfosMutex_); - - os::memory::Mutex disassembliesMutex_; - std::unordered_map> disassemblies_ - GUARDED_BY(disassembliesMutex_); - - std::unordered_map fileToSourceCode_ GUARDED_BY(debugInfosMutex_); -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_DEBUG_INFO_CACHE_H diff --git a/tooling/static/debugger/debuggable_thread.cpp b/tooling/static/debugger/debuggable_thread.cpp deleted file mode 100644 index c5057449..00000000 --- a/tooling/static/debugger/debuggable_thread.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debuggable_thread.h" - -#include "breakpoint_storage.h" -#include "error.h" -#include "include/method.h" -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { -DebuggableThread::DebuggableThread(ManagedThread *thread, DebugInterface *debugger, SuspensionCallbacks &&callbacks, - BreakpointStorage &bpStorage) - : PtThreadEvaluationEngine(debugger, thread), callbacks_(std::move(callbacks)), state_(*this, bpStorage) -{ -} - -void DebuggableThread::Reset() -{ - os::memory::LockHolder lock(mutex_); - state_.Reset(); -} - -void DebuggableThread::BreakOnStart() -{ - os::memory::LockHolder lock(mutex_); - state_.BreakOnStart(); -} - -void DebuggableThread::Continue() -{ - os::memory::LockHolder lock(mutex_); - state_.Continue(); - Resume(); -} - -void DebuggableThread::ContinueTo(std::unordered_set locations) -{ - os::memory::LockHolder lock(mutex_); - state_.ContinueTo(std::move(locations)); - Resume(); -} - -void DebuggableThread::StepInto(std::unordered_set locations) -{ - os::memory::LockHolder lock(mutex_); - state_.StepInto(std::move(locations)); - Resume(); -} - -void DebuggableThread::StepOver(std::unordered_set locations) -{ - os::memory::LockHolder lock(mutex_); - state_.StepOver(std::move(locations)); - Resume(); -} - -void DebuggableThread::StepOut() -{ - os::memory::LockHolder lock(mutex_); - state_.StepOut(); - Resume(); -} - -bool DebuggableThread::IsPaused() -{ - os::memory::LockHolder lock(mutex_); - return suspended_; -} - -void DebuggableThread::Touch() -{ - os::memory::LockHolder lock(mutex_); - Resume(); -} - -void DebuggableThread::Pause() -{ - os::memory::LockHolder lock(mutex_); - state_.Pause(); -} - -void DebuggableThread::SetSkipAllPauses(bool skip) -{ - os::memory::LockHolder lock(mutex_); - state_.SetSkipAllPauses(skip); -} - -void DebuggableThread::SetMixedDebugEnabled(bool mixedDebugEnabled) -{ - os::memory::LockHolder lock(mutex_); - state_.SetMixedDebugEnabled(mixedDebugEnabled); -} - -void DebuggableThread::SetPauseOnExceptions(PauseOnExceptionsState state) -{ - os::memory::LockHolder lock(mutex_); - state_.SetPauseOnExceptions(state); -} - -bool DebuggableThread::RequestToObjectRepository(std::function request) -{ - os::memory::LockHolder lock(mutex_); - - ASSERT(!request_.has_value()); - - if (!suspended_) { - return false; - } - - ASSERT(GetManagedThread()->IsSuspended()); - - request_ = std::move(request); - GetManagedThread()->Resume(); - - while (request_) { - requestDone_.Wait(&mutex_); - } - - ASSERT(suspended_); - ASSERT(GetManagedThread()->IsSuspended()); - - return true; -} - -Expected>, std::string> DebuggableThread::EvaluateExpression( - uint32_t frameNumber, const ExpressionWrapper &bytecode) -{ - std::optional optResult; - std::optional optException; - std::optional optError; - RequestToObjectRepository( - [this, frameNumber, &bytecode, &optResult, &optException, &optError](ObjectRepository &objectRepo) { - Method *method = nullptr; - auto res = EvaluateExpression(frameNumber, bytecode, &method); - if (!res) { - HandleError(res.Error()); - optError = res.Error(); - return; - } - - auto [result, exc] = res.Value(); - optResult.emplace(objectRepo.CreateObject(result)); - if (exc != nullptr) { - optException.emplace(objectRepo.CreateObject(TypedValue::Reference(exc))); - } - }); - if (optError) { - ASSERT(!optResult); - return Unexpected(optError->GetMessage()); - } - return std::make_pair(*optResult, optException); -} - -void DebuggableThread::OnException(bool uncaught) -{ - if (IsEvaluating()) { - return; - } - os::memory::LockHolder lock(mutex_); - state_.OnException(uncaught); - while (state_.IsPaused()) { - ObjectRepository objectRepository; - Suspend(objectRepository, {}, GetManagedThread()->GetException(), state_.GetPauseReason()); - } -} - -void DebuggableThread::OnFramePop() -{ - if (IsEvaluating()) { - return; - } - os::memory::LockHolder lock(mutex_); - state_.OnFramePop(); -} - -bool DebuggableThread::OnMethodEntry() -{ - if (IsEvaluating()) { - return false; - } - os::memory::LockHolder lock(mutex_); - return state_.OnMethodEntry(); -} - -void DebuggableThread::OnSingleStep(const PtLocation &location, const char *sourceFile) -{ - if (IsEvaluating()) { - return; - } - os::memory::LockHolder lock(mutex_); - state_.OnSingleStep(location, sourceFile); - while (state_.IsPaused()) { - ObjectRepository objectRepository; - auto hitBreakpoints = state_.GetBreakpointsByLocation(location); - Suspend(objectRepository, hitBreakpoints, {}, state_.GetPauseReason()); - } -} - -std::vector DebuggableThread::OnConsoleCall(const PandaVector &arguments) -{ - std::vector result; - - ObjectRepository objectRepository; - std::transform(arguments.begin(), arguments.end(), std::back_inserter(result), - [&objectRepository](auto value) { return objectRepository.CreateObject(value); }); - - return result; -} - -void DebuggableThread::Suspend(ObjectRepository &objectRepository, const std::vector &hitBreakpoints, - ObjectHeader *exception, PauseReason pauseReason) -{ - ASSERT(ManagedThread::GetCurrent() == GetManagedThread()); - - ASSERT(!suspended_); - ASSERT(!request_.has_value()); - - callbacks_.preSuspend(objectRepository, hitBreakpoints, exception); - - suspended_ = true; - GetManagedThread()->Suspend(); - - callbacks_.postSuspend(objectRepository, hitBreakpoints, exception, pauseReason); - - while (suspended_) { - mutex_.Unlock(); - - callbacks_.preWaitSuspension(); - GetManagedThread()->WaitSuspension(); - callbacks_.postWaitSuspension(); - - mutex_.Lock(); - - // We have three levels of suspension: - // - state_.IsPaused() - tells if the thread is paused on breakpoint or step; - // - suspended_ - tells if the thread generally sleeps (but could execute object repository requests); - // - GetManagedThread()->IsSuspended() - tells if the thread is actually sleeping - // - // If we are here, then the latter is false (thread waked up). The following variants are possible: - // - not paused and not suspended - e.g. continue / stepping action was performed; - // - not paused and suspended - invalid; - // - paused and not suspended - touch was performed, resume and sleep back - // (used to notify about the state on `runIfWaitingForDebugger`); - // - paused and suspended - object repository request was made. - - ASSERT(suspended_ == request_.has_value()); - - if (request_) { - (*request_)(objectRepository); - - request_.reset(); - GetManagedThread()->Suspend(); - - requestDone_.Signal(); - } - } -} - -void DebuggableThread::Resume() -{ - ASSERT(!request_.has_value()); - - if (!suspended_) { - return; - } - - ASSERT(GetManagedThread()->IsSuspended()); - - callbacks_.preResume(); - - suspended_ = false; - GetManagedThread()->Resume(); - - callbacks_.postResume(); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/debuggable_thread.h b/tooling/static/debugger/debuggable_thread.h deleted file mode 100644 index e3395d20..00000000 --- a/tooling/static/debugger/debuggable_thread.h +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_DEBUGGABLE_THREAD_H -#define PANDA_TOOLING_INSPECTOR_DEBUGGABLE_THREAD_H - -#include "common.h" -#include "debug_info_cache.h" -#include "include/managed_thread.h" -#include "include/tooling/pt_location.h" - -#include "evaluation/evaluation_engine.h" -#include "object_repository.h" -#include "thread_state.h" -#include "types/numeric_id.h" -#include "types/pause_on_exceptions_state.h" - -namespace ark::tooling::inspector { -/** - * @brief Application thread abstraction. - * Note that private inheritance is used in order not to expose evaluation-related state details. - */ -class DebuggableThread final : private PtThreadEvaluationEngine { -public: - struct SuspensionCallbacks final { - std::function &, ObjectHeader *)> preSuspend; - std::function &, ObjectHeader *, PauseReason)> - postSuspend; - std::function preWaitSuspension; - std::function postWaitSuspension; - std::function preResume; - std::function postResume; - }; - -public: - DebuggableThread(ManagedThread *thread, DebugInterface *debugger, SuspensionCallbacks &&callbacks, - BreakpointStorage &bpStorage); - ~DebuggableThread() override = default; - - NO_COPY_SEMANTIC(DebuggableThread); - NO_MOVE_SEMANTIC(DebuggableThread); - - /// The following methods should be called on the server thread - - // Resets the state on a new connection - void Reset(); - - // Tells a newly created thread to pause on the next step - void BreakOnStart(); - - // Continues execution of a paused thread - void Continue(); - - // Continues execution of a paused thread until it reaches one of the locations - void ContinueTo(std::unordered_set locations); - - // Tells a paused thread to perform a step into - void StepInto(std::unordered_set locations); - - // Tells a paused thread to perform a step over - void StepOver(std::unordered_set locations); - - // Tells a paused thread to perform a step out - void StepOut(); - - // Checks if application thread is currently paused. - // Used by server thread for validation before executing stepping requests. - bool IsPaused(); - - // Makes a paused thread to resume and suspend back (does nothing for running threads). - // Used to notify about thread's state when processing `runIfWaitingForDebugger` - void Touch(); - - // Tells a running thread to pause on the next step - void Pause(); - - // Enables or disables skipping all pauses - void SetSkipAllPauses(bool skip); - - // Enables or disables mixdebug && mixstack - void SetMixedDebugEnabled(bool mixedDebugEnabled); - - // Tells when stops should be made on exceptions - void SetPauseOnExceptions(PauseOnExceptionsState state); - - // Executes a request to object repository on a paused thread (does nothing for running threads) - bool RequestToObjectRepository(std::function request); - - /// The following methods should be called on an application thread - - // Notification that an exception was thrown. Pauses the thread if necessary - void OnException(bool uncaught); - - // Notification that an "interesting" frame was popped - void OnFramePop(); - - // Notification that a new frame was pushed. Returns true if we want to be notified about the frame is popped - // (i.e. the frame is "interesting"), false otherwise - bool OnMethodEntry(); - - // Notification that a next step will be performed. Pauses the thread if necessary - void OnSingleStep(const PtLocation &location, const char *sourceFile); - - // Notification that a call to console was performed. Returns its arguments presented as remote objects - std::vector OnConsoleCall(const PandaVector &arguments); - - /** - * @brief Evaluates the given bytecode expression. - * @param frameNumber frame depth to evaluate expression in. - * @param bytecode fragment with expression. - * @returns pair of result (might be void) and optional exception objects OR error message - */ - Expected>, std::string> EvaluateExpression( - uint32_t frameNumber, const ExpressionWrapper &bytecode); - -private: - using PtThreadEvaluationEngine::EvaluateExpression; - - // Suspends a paused thread. Should be called on an application thread - void Suspend(ObjectRepository &objectRepository, const std::vector &hitBreakpoints, - ObjectHeader *exception, PauseReason pauseReason) REQUIRES(mutex_); - - // Marks a paused thread as not suspended. Should be called on the server thread - void Resume() REQUIRES(mutex_); - -private: - SuspensionCallbacks callbacks_; - - os::memory::Mutex mutex_; - ThreadState state_ GUARDED_BY(mutex_); - bool suspended_ GUARDED_BY(mutex_) {false}; - std::optional> request_ GUARDED_BY(mutex_); - os::memory::ConditionVariable requestDone_ GUARDED_BY(mutex_); -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_DEBUGGABLE_THREAD_H diff --git a/tooling/static/debugger/object_repository.cpp b/tooling/static/debugger/object_repository.cpp deleted file mode 100644 index 93b2d41e..00000000 --- a/tooling/static/debugger/object_repository.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "object_repository.h" - -#include "include/tooling/pt_lang_extension.h" -#include "runtime/handle_scope-inl.h" - -namespace ark::tooling::inspector { -ObjectRepository::ObjectRepository() - : extension_(ManagedThread::GetCurrent()->GetLanguageContext().CreatePtLangExt()), - scope_(ManagedThread::GetCurrent()) -{ -} - -RemoteObject ObjectRepository::CreateGlobalObject() -{ - return RemoteObject::Object("[Global]", GLOBAL_OBJECT_ID, "Global object"); -} - -RemoteObject ObjectRepository::CreateFrameObject(const PtFrame &frame, const std::map &locals, - std::optional &objThis) -{ - ASSERT(ManagedThread::GetCurrent()->GetMutatorLock()->HasLock()); - - std::vector properties; - properties.reserve(locals.size()); - auto thisParamName = extension_->GetThisParameterName(); - for (const auto &[paramName, value] : locals) { - auto obj = CreateObject(value); - if (paramName == thisParamName) { - objThis.emplace(std::move(obj)); - } else { - properties.emplace_back(paramName, std::move(obj)); - } - } - - auto id = counter_++; - frames_.emplace(id, std::move(properties)); - - return RemoteObject::Object("", id, "Frame #" + std::to_string(frame.GetFrameId())); -} - -RemoteObject ObjectRepository::CreateObject(TypedValue value) -{ - ASSERT(ManagedThread::GetCurrent()->GetMutatorLock()->HasLock()); - - switch (value.GetType()) { - case panda_file::Type::TypeId::INVALID: - case panda_file::Type::TypeId::VOID: - return RemoteObject::Undefined(); - case panda_file::Type::TypeId::U1: - return RemoteObject::Boolean(value.GetAsU1()); - case panda_file::Type::TypeId::I8: - return RemoteObject::Number(value.GetAsI8()); - case panda_file::Type::TypeId::U8: - return RemoteObject::Number(value.GetAsU8()); - case panda_file::Type::TypeId::I16: - return RemoteObject::Number(value.GetAsI16()); - case panda_file::Type::TypeId::U16: - return RemoteObject::Number(value.GetAsU16()); - case panda_file::Type::TypeId::I32: - return RemoteObject::Number(value.GetAsI32()); - case panda_file::Type::TypeId::U32: - return RemoteObject::Number(value.GetAsU32()); - case panda_file::Type::TypeId::F32: - return RemoteObject::Number(value.GetAsF32()); - case panda_file::Type::TypeId::F64: - return RemoteObject::Number(value.GetAsF64()); - case panda_file::Type::TypeId::I64: - return RemoteObject::Number(value.GetAsI64()); - case panda_file::Type::TypeId::U64: - return RemoteObject::Number(value.GetAsU64()); - case panda_file::Type::TypeId::REFERENCE: - return CreateObject(value.GetAsReference()); - case panda_file::Type::TypeId::TAGGED: - return CreateObject(value.GetAsTagged()); - } - UNREACHABLE(); -} - -std::vector ObjectRepository::GetProperties(RemoteObjectId id, bool generatePreview) -{ - ASSERT(ManagedThread::GetCurrent()->GetMutatorLock()->HasLock()); - - auto properties = GetProperties(id); - - if (generatePreview) { - for (auto &property : properties) { - if (property.IsAccessor()) { - continue; - } - - RemoteObject &value = property.GetValue(); - auto preview = CreateObjectPreview(value); - if (preview.has_value()) { - value.SetObjectPreview(std::move(*preview)); - } - } - } - - return properties; -} - -std::optional ObjectRepository::CreateObjectPreview(RemoteObject &remobj) -{ - auto valueId = remobj.GetObjectId(); - if (!valueId.has_value()) { - return {}; - } - - ObjectPreview preview(remobj.GetType(), GetProperties(*valueId)); - - return preview; -} - -RemoteObject ObjectRepository::CreateObject(coretypes::TaggedValue value) -{ - if (value.IsHeapObject()) { - return CreateObject(value.GetHeapObject()); - } - if (value.IsUndefined() || value.IsHole()) { - return RemoteObject::Undefined(); - } - if (value.IsNull()) { - return RemoteObject::Null(); - } - if (value.IsBoolean()) { - return RemoteObject::Boolean(value.IsTrue()); - } - if (value.IsInt()) { - return RemoteObject::Number(value.GetInt()); - } - if (value.IsDouble()) { - return RemoteObject::Number(value.GetDouble()); - } - UNREACHABLE(); -} - -RemoteObject ObjectRepository::CreateObject(ObjectHeader *object) -{ - ASSERT(ManagedThread::GetCurrent()->GetMutatorLock()->HasLock()); - - if (object == nullptr) { - return RemoteObject::Null(); - } - - if (auto str = extension_->GetAsString(object)) { - return RemoteObject::String(*str); - } - - RemoteObjectId id; - - // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) - auto it = std::find_if(objects_.begin(), objects_.end(), [object](auto &p) { return p.second.GetPtr() == object; }); - if (it == objects_.end()) { - id = counter_++; - - objects_.emplace(std::piecewise_construct, std::forward_as_tuple(id), - std::forward_as_tuple(ManagedThread::GetCurrent(), object)); - } else { - id = it->first; - } - - // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) - if (auto arrayLen = extension_->GetLengthIfArray(object)) { - // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) - return RemoteObject::Array(extension_->GetClassName(object), *arrayLen, id); - } - - // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) - return RemoteObject::Object(extension_->GetClassName(object), id); -} - -std::vector ObjectRepository::GetProperties(RemoteObjectId id) -{ - ASSERT(ManagedThread::GetCurrent()->GetMutatorLock()->HasLock()); - - auto fIt = frames_.find(id); - if (fIt != frames_.end()) { - ASSERT(objects_.find(id) == objects_.end()); - return fIt->second; - } - - std::vector properties; - auto propertyHandler = [this, &properties](auto &name, auto value, auto isFinal, auto isAccessor) { - auto property = isAccessor ? PropertyDescriptor::Accessor(name, CreateObject(value)) - : PropertyDescriptor(name, CreateObject(value)); - if (!isAccessor && isFinal) { - property.SetWritable(false); - } - properties.emplace_back(std::move(property)); - }; - - if (id == GLOBAL_OBJECT_ID) { - ASSERT(objects_.find(id) == objects_.end()); - extension_->EnumerateGlobals(propertyHandler); - } else { - auto oIt = objects_.find(id); - if (oIt == objects_.end()) { - LOG(INFO, DEBUGGER) << "Unknown object ID " << id; - return {}; - } - - extension_->EnumerateProperties(oIt->second.GetPtr(), propertyHandler); - } - - return properties; -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/object_repository.h b/tooling/static/debugger/object_repository.h deleted file mode 100644 index 1a6bc281..00000000 --- a/tooling/static/debugger/object_repository.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_OBJECT_REPOSITORY_H -#define PANDA_TOOLING_INSPECTOR_OBJECT_REPOSITORY_H - -#include "include/tooling/debug_interface.h" -#include "include/typed_value.h" -#include "os/mutex.h" -#include "runtime/handle_scope.h" - -#include "types/numeric_id.h" -#include "types/property_descriptor.h" - -namespace ark::tooling::inspector { -/** - * All manipulations with an object repository should be made - * on the corresponding application thread with mutator lock held - */ - -class ObjectRepository { -public: - explicit ObjectRepository(); - ~ObjectRepository() = default; - - NO_COPY_SEMANTIC(ObjectRepository); - NO_MOVE_SEMANTIC(ObjectRepository); - - RemoteObject CreateGlobalObject(); - RemoteObject CreateFrameObject(const PtFrame &frame, const std::map &locals, - std::optional &objThis); - RemoteObject CreateObject(TypedValue value); - - std::vector GetProperties(RemoteObjectId id, bool generatePreview); - -private: - static constexpr RemoteObjectId GLOBAL_OBJECT_ID = 0; - - RemoteObject CreateObject(coretypes::TaggedValue value); - RemoteObject CreateObject(ObjectHeader *object); - std::vector GetProperties(RemoteObjectId id); - - std::optional CreateObjectPreview(RemoteObject &remobj); - - std::unique_ptr extension_; - HandleScope scope_; - RemoteObjectId counter_ {GLOBAL_OBJECT_ID + 1}; - std::map> frames_; - std::map> objects_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_OBJECT_REPOSITORY_H diff --git a/tooling/static/debugger/thread_state.cpp b/tooling/static/debugger/thread_state.cpp deleted file mode 100644 index 94554d9c..00000000 --- a/tooling/static/debugger/thread_state.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "thread_state.h" - -#include -#include -#include - -#include "include/tooling/pt_location.h" -#include "macros.h" -#include "breakpoint.h" -#include "error.h" -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -void ThreadState::Reset() -{ - stepKind_ = StepKind::BREAK_ON_START; - stepLocations_.clear(); - methodEntered_ = false; - skipAllPauses_ = false; - mixedDebugEnabled_ = false; - pauseOnExceptionsState_ = PauseOnExceptionsState::NONE; -} - -void ThreadState::BreakOnStart() -{ - if (!paused_) { - stepKind_ = StepKind::BREAK_ON_START; - } - breakOnStart_ = true; -} - -void ThreadState::Continue() -{ - stepKind_ = StepKind::NONE; - paused_ = false; - pauseReason_ = PauseReason::OTHER; -} - -void ThreadState::ContinueTo(std::unordered_set locations) -{ - stepKind_ = StepKind::CONTINUE_TO; - stepLocations_ = std::move(locations); - paused_ = false; - pauseReason_ = PauseReason::OTHER; -} - -void ThreadState::StepInto(std::unordered_set locations) -{ - stepKind_ = StepKind::STEP_INTO; - methodEntered_ = false; - stepLocations_ = std::move(locations); - paused_ = false; - pauseReason_ = PauseReason::STEP; -} - -void ThreadState::StepOver(std::unordered_set locations) -{ - stepKind_ = StepKind::STEP_OVER; - methodEntered_ = false; - stepLocations_ = std::move(locations); - paused_ = false; - pauseReason_ = PauseReason::STEP; -} - -void ThreadState::StepOut() -{ - stepKind_ = StepKind::STEP_OUT; - methodEntered_ = true; - paused_ = false; - pauseReason_ = PauseReason::STEP; -} - -void ThreadState::Pause() -{ - if (!paused_ && !skipAllPauses_) { - stepKind_ = StepKind::PAUSE; - } -} - -void ThreadState::SetSkipAllPauses(bool skip) -{ - skipAllPauses_ = skip; -} - -// NOTE(fangting, #25108): implement "NativeOut" events when in mixed debug mode -void ThreadState::SetMixedDebugEnabled(bool mixedDebugEnabled) -{ - mixedDebugEnabled_ = mixedDebugEnabled; -} - -void ThreadState::SetPauseOnExceptions(PauseOnExceptionsState state) -{ - pauseOnExceptionsState_ = state; -} - -void ThreadState::OnException(bool uncaught) -{ - ASSERT(!paused_); - if (skipAllPauses_) { - return; - } - switch (pauseOnExceptionsState_) { - case PauseOnExceptionsState::NONE: - break; - case PauseOnExceptionsState::CAUGHT: - paused_ = !uncaught; - break; - case PauseOnExceptionsState::UNCAUGHT: - paused_ = uncaught; - break; - case PauseOnExceptionsState::ALL: - paused_ = true; - break; - } - if (paused_) { - pauseReason_ = PauseReason::EXCEPTION; - } -} - -void ThreadState::OnFramePop() -{ - ASSERT(!paused_); - switch (stepKind_) { - case StepKind::NONE: - case StepKind::BREAK_ON_START: - case StepKind::CONTINUE_TO: - case StepKind::PAUSE: - case StepKind::STEP_INTO: { - break; - } - - case StepKind::STEP_OUT: - case StepKind::STEP_OVER: { - methodEntered_ = false; - break; - } - } -} - -bool ThreadState::OnMethodEntry() -{ - ASSERT(!paused_); - switch (stepKind_) { - case StepKind::NONE: - case StepKind::BREAK_ON_START: - case StepKind::CONTINUE_TO: - case StepKind::PAUSE: - case StepKind::STEP_INTO: { - return false; - } - - case StepKind::STEP_OUT: - case StepKind::STEP_OVER: { - return !std::exchange(methodEntered_, true); - } - } - - UNREACHABLE(); -} - -void ThreadState::OnSingleStep(const PtLocation &location, const char *sourceFile) -{ - ASSERT(!paused_); - - if (breakOnStart_) { - std::string_view file = sourceFile; - if (sourceFiles_.find(file) == sourceFiles_.end()) { - sourceFiles_.emplace(file); - stepKind_ = StepKind::BREAK_ON_START; - paused_ = true; - pauseReason_ = PauseReason::BREAK_ON_START; - return; - } - } - - if (ShouldStopAtBreakpoint(location)) { - paused_ = true; - return; - } - - switch (stepKind_) { - case StepKind::NONE: { - paused_ = false; - break; - } - - case StepKind::BREAK_ON_START: { - paused_ = true; - break; - } - - case StepKind::CONTINUE_TO: { - paused_ = stepLocations_.find(location) != stepLocations_.end(); - break; - } - - case StepKind::PAUSE: { - paused_ = true; - break; - } - - case StepKind::STEP_INTO: { - paused_ = stepLocations_.find(location) == stepLocations_.end(); - break; - } - - case StepKind::STEP_OUT: { - paused_ = !methodEntered_; - break; - } - - case StepKind::STEP_OVER: { - paused_ = !methodEntered_ && stepLocations_.find(location) == stepLocations_.end(); - break; - } - } -} - -bool ThreadState::ShouldStopAtBreakpoint(const PtLocation &location) -{ - if (skipAllPauses_) { - return false; - } - return bpStorage_.ShouldStopAtBreakpoint(location, engine_); -} - -std::vector ThreadState::GetBreakpointsByLocation(const PtLocation &location) const -{ - return bpStorage_.GetBreakpointsByLocation(location); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/debugger/thread_state.h b/tooling/static/debugger/thread_state.h deleted file mode 100644 index b87f7710..00000000 --- a/tooling/static/debugger/thread_state.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_THREAD_STATE_H -#define PANDA_TOOLING_INSPECTOR_THREAD_STATE_H - -#include -#include -#include - -#include "breakpoint.h" -#include "breakpoint_storage.h" -#include "common.h" -#include "debug_info_cache.h" -#include "runtime/tooling/debugger.h" - -#include "include/tooling/debug_interface.h" -#include "types/numeric_id.h" -#include "types/pause_on_exceptions_state.h" - -namespace ark::tooling::inspector { - -class DebuggableThread; - -class ThreadState final { -public: - explicit ThreadState(EvaluationEngine &engine, BreakpointStorage &bpStorage) - : engine_(engine), bpStorage_(bpStorage) - { - } - ~ThreadState() = default; - - NO_COPY_SEMANTIC(ThreadState); - NO_MOVE_SEMANTIC(ThreadState); - - bool IsPaused() const - { - return paused_; - } - - std::vector GetBreakpointsByLocation(const PtLocation &location) const; - - void Reset(); - void BreakOnStart(); - void Continue(); - void ContinueTo(std::unordered_set locations); - void StepInto(std::unordered_set locations); - void StepOver(std::unordered_set locations); - void StepOut(); - void Pause(); - void SetSkipAllPauses(bool skip); - void SetMixedDebugEnabled(bool mixedDebugEnabled); - void SetPauseOnExceptions(PauseOnExceptionsState state); - - void OnException(bool uncaught); - void OnFramePop(); - bool OnMethodEntry(); - void OnSingleStep(const PtLocation &location, const char *sourceFile); - - PauseReason GetPauseReason() const - { - return pauseReason_; - } - -private: - enum class StepKind { - // Just continue execution - NONE, - - // Stop on the next step event. It is not reset to NONE during resetting the state on a new connection - BREAK_ON_START, - - // Continue execution until one of the specified locations is reached - CONTINUE_TO, - - // Stop on the next step event - PAUSE, - - // Continue execution until one of the locations, other than the current line, is reached - STEP_INTO, - - // Continue execution until the current frame is popped - STEP_OUT, - - // Continue execution until both: - // - The call frame is not a child to the starting position (e.g. we have not entered some method); - // - One of the locations, other than the current line, is reached. - STEP_OVER - }; - -private: - bool ShouldStopAtBreakpoint(const PtLocation &location); - -private: - StepKind stepKind_ {StepKind::NONE}; - - // The set of locations has different semantics for various kinds of stepping: - // - for CONTINUE_TO it contains the set of locations we should reach to end the step; - // - for STEP_INTO and STEP_OVER it contains the set of locations corresponding to the current line - // (then, the locations we should leave to end the step). - std::unordered_set stepLocations_; - - bool methodEntered_ {false}; - - EvaluationEngine &engine_; - BreakpointStorage &bpStorage_; - - PauseOnExceptionsState pauseOnExceptionsState_ {PauseOnExceptionsState::NONE}; - - bool paused_ {false}; - bool skipAllPauses_ {false}; - bool mixedDebugEnabled_ {false}; - bool breakOnStart_ {false}; - std::set sourceFiles_; - PauseReason pauseReason_ {PauseReason::OTHER}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_THREAD_STATE_H diff --git a/tooling/static/debugger_arkapi.cpp b/tooling/static/debugger_arkapi.cpp deleted file mode 100644 index 89d9e89c..00000000 --- a/tooling/static/debugger_arkapi.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debugger_arkapi.h" -#include "runtime/include/panda_vm.h" - -namespace ark { -bool ArkDebugNativeAPI::NotifyDebugMode([[maybe_unused]] int tid, [[maybe_unused]] int32_t instanceId, - [[maybe_unused]] bool debugApp) -{ - LOG(INFO, DEBUGGER) << "ArkDebugNativeAPI::NotifyDebugMode, tid = " << tid << ", debugApp = " << debugApp - << ", instanceId = " << instanceId; - if ((!debugApp) || (!Runtime::GetOptions().IsDebuggerEnable())) { - return true; - } - - auto loadRes = os::library_loader::Load(Runtime::GetOptions().GetDebuggerLibraryPath()); - if (!loadRes) { - LOG(ERROR, DEBUGGER) << "Load library fail: " << Runtime::GetOptions().GetDebuggerLibraryPath() << " " << errno; - return false; - } - os::library_loader::LibraryHandle handle = std::move(loadRes.Value()); - - Runtime::GetCurrent()->SetDebugMode(true); - - using WaitForDebugger = void (*)(); - auto symOfWaitForDebugger = os::library_loader::ResolveSymbol(handle, "WaitForDebugger"); - if (!symOfWaitForDebugger) { - LOG(ERROR, DEBUGGER) << "Resolve symbol WaitForDebugger fail: " << symOfWaitForDebugger.Error().ToString(); - return false; - } - reinterpret_cast(symOfWaitForDebugger.Value())(); - - return true; -} - -bool ArkDebugNativeAPI::StopDebugger() -{ - LOG(INFO, DEBUGGER) << "ArkDebugNativeAPI::StopDebugger"; - - ark::Runtime::GetCurrent()->SetDebugMode(false); - return true; -} - -bool ArkDebugNativeAPI::StartDebuggerForSocketPair([[maybe_unused]] int tid, [[maybe_unused]] int socketfd) -{ - LOG(INFO, DEBUGGER) << "ArkDebugNativeAPI::StartDebuggerForSocketPair, tid = " << tid; - - auto loadRes = os::library_loader::Load(Runtime::GetOptions().GetDebuggerLibraryPath()); - if (!loadRes) { - LOG(ERROR, DEBUGGER) << "Load library fail: " << Runtime::GetOptions().GetDebuggerLibraryPath() << " " << errno; - return false; - } - os::library_loader::LibraryHandle handle = std::move(loadRes.Value()); - - using StartDebuggerForSocketpair = bool (*)(int, bool); - auto sym = os::library_loader::ResolveSymbol(handle, "StartDebuggerForSocketpair"); - if (!sym) { - LOG(ERROR, DEBUGGER) << "[StartDebuggerForSocketPair] Resolve symbol fail: " << sym.Error().ToString(); - return false; - } - bool breakOnStart = Runtime::GetOptions().IsDebuggerBreakOnStart(); - bool ret = reinterpret_cast(sym.Value())(socketfd, breakOnStart); - if (!ret) { - // Reset the config - ark::Runtime::GetCurrent()->SetDebugMode(false); - } - return ret; -} -bool ArkDebugNativeAPI::IsDebugModeEnabled() -{ - LOG(INFO, DEBUGGER) << "ArkDebugNativeAPI::IsDebugModeEnabled is " << ark::Runtime::GetCurrent()->IsDebugMode(); - - return ark::Runtime::GetCurrent()->IsDebugMode(); -} -} // namespace ark diff --git a/tooling/static/debugger_arkapi.h b/tooling/static/debugger_arkapi.h deleted file mode 100644 index af3039ea..00000000 --- a/tooling/static/debugger_arkapi.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_DEBUGGER_ARKAPI_H -#define PANDA_DEBUGGER_ARKAPI_H - -#include -#include - -#include "libpandabase/macros.h" - -namespace ark { -class PANDA_PUBLIC_API ArkDebugNativeAPI final { -public: - using DebuggerPostTask = std::function &&)>; - - static bool StartDebuggerForSocketPair(int tid, int socketfd = -1); - static bool NotifyDebugMode(int tid, int32_t instanceId = 0, bool debugApp = false); - static bool StopDebugger(); - static bool IsDebugModeEnabled(); - - ArkDebugNativeAPI() = delete; - ~ArkDebugNativeAPI() = delete; - - NO_COPY_SEMANTIC(ArkDebugNativeAPI); - NO_MOVE_SEMANTIC(ArkDebugNativeAPI); -}; - -} // namespace ark - -#endif // PANDA_DEBUGGER_ARKAPI_H diff --git a/tooling/static/error.cpp b/tooling/static/error.cpp deleted file mode 100644 index 7ed13ada..00000000 --- a/tooling/static/error.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "error.h" - -#include "utils/logger.h" - -namespace ark::tooling::inspector { -bool HandleError(std::optional &&error) -{ - if (error) { - LOG(ERROR, DEBUGGER) << error->GetMessage(); - return false; - } - return true; -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/error.h b/tooling/static/error.h deleted file mode 100644 index 75aa0e29..00000000 --- a/tooling/static/error.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_ERROR_H -#define PANDA_TOOLING_INSPECTOR_ERROR_H - -#include "include/tooling/debug_interface.h" - -#include - -namespace ark::tooling::inspector { -bool HandleError(std::optional &&error); -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_ERROR_H diff --git a/tooling/static/evaluation/base64.h b/tooling/static/evaluation/base64.h deleted file mode 100644 index 0b10e679..00000000 --- a/tooling/static/evaluation/base64.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_EVALUATION_BASE64_H -#define PANDA_TOOLING_INSPECTOR_EVALUATION_BASE64_H - -#include -#include -#include - -#include "libpandabase/macros.h" -#include "libpandabase/utils/span.h" - -namespace ark::tooling::inspector { -class Base64Decoder final { -public: - Base64Decoder() = delete; - - static std::optional DecodedSize(Span input) - { - if (input.empty() || input.size() % ENCODED_GROUP_BYTES != 0) { - return {}; - } - - auto sz = input.size() / ENCODED_GROUP_BYTES * DECODED_GROUP_BYTES; - auto last = input.end() - 1; - for (size_t i = 0; i < MAX_PADDINGS && *last == PADDING_CHAR; ++i, --last) { - --sz; - } - return sz; - } - - static bool Decode(const std::string &encoded, std::string &decoded) - { - ASSERT(!encoded.empty()); - - auto sz = encoded.size(); - Span encodingInput(reinterpret_cast(encoded.c_str()), sz); - auto bytecodeSize = Base64Decoder::DecodedSize(encodingInput); - if (!bytecodeSize) { - return false; - } - decoded.resize(*bytecodeSize); - return Base64Decoder::Decode(reinterpret_cast(decoded.data()), encodingInput); - } - - static bool Decode(uint8_t *output, Span input) - { - ASSERT(output); - - if (input.empty() || input.size() % ENCODED_GROUP_BYTES != 0) { - return false; - } - - std::array decodingBuffer = {0}; - size_t baseIdx = 0; - auto srcIter = input.begin(); - for (auto endIter = input.end(); srcIter != endIter && *srcIter != PADDING_CHAR; ++srcIter) { - auto decoded = DecodeChar(*srcIter); - if (decoded == INVALID_VALUE) { - return false; - } - decodingBuffer[baseIdx++] = decoded; - - if (baseIdx == ENCODED_GROUP_BYTES) { - DecodeSextetsGroup(decodingBuffer, Span(output, DECODED_GROUP_BYTES)); - // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) - output += DECODED_GROUP_BYTES; - baseIdx = 0; - } - } - - if (baseIdx != 0) { - // Decode the remainder part. - std::array decodedRemainder = {0}; - DecodeSextetsGroup(decodingBuffer, Span(decodedRemainder.data(), DECODED_GROUP_BYTES)); - for (size_t idx = 0, end = baseIdx - 1; idx < end; ++idx) { - // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) - *output++ = decodedRemainder[idx]; - } - } - - // Only padding symbols could remain. - // NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic) - auto remainder = input.end() - srcIter; - return (remainder == 0 || (remainder == 1 && *srcIter == PADDING_CHAR) || - (remainder == MAX_PADDINGS && *srcIter == PADDING_CHAR && *(srcIter + 1) == PADDING_CHAR)); - // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic) - } - -private: - static constexpr size_t DECODED_GROUP_BYTES = 3; - static constexpr size_t ENCODED_GROUP_BYTES = 4; - -private: - static uint8_t DecodeChar(uint8_t encoded) - { - if (encoded >= DECODE_TABLE.size()) { - return INVALID_VALUE; - } - return DECODE_TABLE[encoded]; - } - - /// @brief Converts 4 sextets into 3 output bytes. - static void DecodeSextetsGroup(const std::array &decodingBuffer, Span output) - { - // 0b00110000 - static constexpr uint8_t FOURTH_TO_FIFTH_BITS = 0x30U; - // 0b00111100 - static constexpr uint8_t SECOND_TO_FIFTH_BITS = 0x3CU; - static constexpr uint8_t TWO_BITS_SHIFT = 2U; - static constexpr uint8_t FOUR_BITS_SHIFT = 4U; - static constexpr uint8_t SIX_BITS_SHIFT = 6U; - - ASSERT(output.size() == DECODED_GROUP_BYTES); - // NOLINTBEGIN(hicpp-signed-bitwise) - output[0UL] = - (decodingBuffer[0UL] << TWO_BITS_SHIFT) | ((decodingBuffer[1UL] & FOURTH_TO_FIFTH_BITS) >> FOUR_BITS_SHIFT); - output[1UL] = - (decodingBuffer[1UL] << FOUR_BITS_SHIFT) | ((decodingBuffer[2UL] & SECOND_TO_FIFTH_BITS) >> TWO_BITS_SHIFT); - output[2UL] = (decodingBuffer[2UL] << SIX_BITS_SHIFT) | decodingBuffer[3UL]; - // NOLINTEND(hicpp-signed-bitwise) - } - -private: - static constexpr size_t MAX_PADDINGS = 2U; - static constexpr uint8_t PADDING_CHAR = '='; - static constexpr uint8_t INVALID_VALUE = 255U; - static constexpr std::array DECODE_TABLE = { - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255, 255, - 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_EVALUATION_BASE64_H diff --git a/tooling/static/evaluation/evaluation_engine.cpp b/tooling/static/evaluation/evaluation_engine.cpp deleted file mode 100644 index 1e735729..00000000 --- a/tooling/static/evaluation/evaluation_engine.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "evaluation/evaluation_engine.h" - -#include "include/tooling/pt_thread.h" - -namespace ark::tooling::inspector { -Expected, Error> PtThreadEvaluationEngine::EvaluateExpression( - uint32_t frameNumber, const ExpressionWrapper &bytecode, Method **method) -{ - ASSERT(!IsEvaluating()); - ASSERT(method != nullptr); - - VRegValue result; - std::optional err; - - evaluating_ = true; - if (*method != nullptr) { - err = debugger_->EvaluateExpression(PtThread(thread_), frameNumber, *method, &result); - } else { - err = debugger_->EvaluateExpression(PtThread(thread_), frameNumber, bytecode, method, &result); - } - evaluating_ = false; - - if (err) { - return Unexpected(*err); - } - ASSERT(*method != nullptr); - - auto *exception = thread_->GetException(); - // Current implementation must clear any occurred exceptions - if (exception != nullptr) { - thread_->SetException(nullptr); - } - - return std::make_pair(result.ToTypedValue((*method)->GetReturnType().GetId()), exception); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/evaluation/evaluation_engine.h b/tooling/static/evaluation/evaluation_engine.h deleted file mode 100644 index 33b36753..00000000 --- a/tooling/static/evaluation/evaluation_engine.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_EVALUATION_EVALUATION_ENGINE_H -#define PANDA_TOOLING_INSPECTOR_EVALUATION_EVALUATION_ENGINE_H - -#include "include/managed_thread.h" -#include "include/object_header.h" -#include "include/tooling/debug_interface.h" - -namespace ark::tooling::inspector { -class EvaluationEngine { -public: - EvaluationEngine() = default; - - NO_COPY_SEMANTIC(EvaluationEngine); - NO_MOVE_SEMANTIC(EvaluationEngine); - - virtual ~EvaluationEngine() = default; - - virtual Expected, Error> EvaluateExpression(uint32_t frameNumber, - const ExpressionWrapper &bytecode, - Method **method) = 0; -}; - -/// @brief Class provides debugger-based evaluation within the given application thread. -class PtThreadEvaluationEngine : public EvaluationEngine { -public: - explicit PtThreadEvaluationEngine(DebugInterface *debugger, ManagedThread *thread) - : debugger_(debugger), thread_(thread) - { - ASSERT(debugger_ != nullptr); - ASSERT(thread_ != nullptr); - } - - NO_COPY_SEMANTIC(PtThreadEvaluationEngine); - NO_MOVE_SEMANTIC(PtThreadEvaluationEngine); - - ~PtThreadEvaluationEngine() override = default; - - ManagedThread *GetManagedThread() - { - return thread_; - } - - bool IsEvaluating() const - { - return evaluating_; - } - - /** - * @brief Evaluates the given bytecode expression. - * @param frameNumber frame depth to evaluate expression in. - * @param bytecode fragment with expression. - * @param method pointer either providing the previously loaded method or used for storing the expression method. - * @returns pair of result and raised exception or an error. - */ - Expected, Error> EvaluateExpression(uint32_t frameNumber, - const ExpressionWrapper &bytecode, - Method **method) final; - -private: - DebugInterface *debugger_; - ManagedThread *thread_; - bool evaluating_ {false}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_EVALUATION_EVALUATION_ENGINE_H diff --git a/tooling/static/init.cpp b/tooling/static/init.cpp deleted file mode 100644 index ae58884a..00000000 --- a/tooling/static/init.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#ifdef PANDA_TOOLING_ASIO -#include "connection/asio/asio_server.h" -#else -#include "connection/ohos_ws/ohos_ws_server.h" -#endif // PANDA_TOOLING_ASIO - -#include "inspector.h" - -namespace ark::tooling { -class DebugInterface; -} // namespace ark::tooling - -#ifdef PANDA_TOOLING_ASIO -using InspectorWebSocketServer = ark::tooling::inspector::AsioServer; -#else -using InspectorWebSocketServer = ark::tooling::inspector::OhosWsServer; -#endif // PANDA_TOOLING_ASIO - -// NOLINTNEXTLINE(fuchsia-statically-constructed-objects) -static ark::Runtime::DebugSessionHandle g_debugSession; - -// NOLINTNEXTLINE(fuchsia-statically-constructed-objects) -static InspectorWebSocketServer g_server; - -// NOLINTNEXTLINE(fuchsia-statically-constructed-objects) -static std::optional g_inspector; - -extern "C" int StartDebugger(uint32_t port, bool breakOnStart) -{ - if (g_inspector) { - LOG(ERROR, DEBUGGER) << "Debugger has already been started"; - return 1; - } - - if (!g_server.Start(port)) { - return 1; - } - - g_debugSession = ark::Runtime::GetCurrent()->StartDebugSession(); - g_inspector.emplace(g_server, g_debugSession->GetDebugger(), breakOnStart); - g_inspector->Run(); - return 0; -} - -extern "C" int StopDebugger() -{ - if (!g_inspector) { - LOG(ERROR, DEBUGGER) << "Debugger has not been started"; - return 1; - } - - if (!g_server.Stop()) { - return 1; - } - g_inspector.reset(); - g_debugSession.reset(); - return 0; -} - -extern "C" bool StartDebuggerForSocketpair(int socketfd, bool breakOnStart) -{ - if (g_inspector) { - g_server.Stop(); - g_inspector->Stop(); - } - - if (!g_server.StartForSocketpair(socketfd)) { - return false; - } - - if (!g_inspector) { - g_debugSession = ark::Runtime::GetCurrent()->StartDebugSession(); - g_inspector.emplace(g_server, g_debugSession->GetDebugger(), breakOnStart); - } - - g_inspector->Run(); - return true; -} - -extern "C" void WaitForDebugger() -{ - if (!g_inspector) { - LOG(ERROR, DEBUGGER) << "Debugger has not been started"; - return; - } - - g_inspector->WaitForDebugger(); -} diff --git a/tooling/static/inspector.cpp b/tooling/static/inspector.cpp deleted file mode 100644 index 561aa6a2..00000000 --- a/tooling/static/inspector.cpp +++ /dev/null @@ -1,819 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "inspector.h" - -#include -#include -#include -#include - -#include "debugger/breakpoint.h" -#include "macros.h" -#include "os/mutex.h" -#include "runtime.h" -#include "utils/logger.h" - -#include "error.h" -#include "evaluation/base64.h" -#include "sampler/sampling_profiler.h" -#include "types/remote_object.h" -#include "types/scope.h" - -using namespace std::placeholders; // NOLINT(google-build-using-namespace) - -namespace ark::tooling::inspector { -static void LogDebuggerNotPaused(std::string_view methodName) -{ - LOG(WARNING, DEBUGGER) << "Inspector method '" << methodName << "' must be called on pause"; -} - -Inspector::Inspector(Server &server, DebugInterface &debugger, bool breakOnStart) - : breakOnStart_(breakOnStart), inspectorServer_(server), debugger_(debugger) -{ - if (!HandleError(debugger_.RegisterHooks(this))) { - return; - } - - // acquire lock to later release it either in `OnOpen` or `OnFail` callbacks - inspectorServer_.OnValidate([this]() NO_THREAD_SAFETY_ANALYSIS { - ASSERT(!connecting_); // NOLINT(bugprone-lambda-function-name) - debuggerEventsLock_.WriteLock(); - connecting_ = true; - }); - inspectorServer_.OnOpen([this]() NO_THREAD_SAFETY_ANALYSIS { - ASSERT(connecting_); // NOLINT(bugprone-lambda-function-name) - connecting_ = false; - debuggerEventsLock_.Unlock(); - }); - inspectorServer_.OnFail([this]() NO_THREAD_SAFETY_ANALYSIS { - if (connecting_) { - connecting_ = false; - debuggerEventsLock_.Unlock(); - } - }); - - RegisterMethodHandlers(); -} - -Inspector::~Inspector() -{ - // Current implementation destroys `Inspector` after server connection is closed, - // hence no need to notify client - inspectorServer_.Kill(); - serverThread_.join(); - HandleError(debugger_.UnregisterHooks()); -} - -void Inspector::CollectModules() -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - Runtime::GetCurrent()->GetClassLinker()->EnumeratePandaFiles([this](auto &file) { - debugInfoCache_.AddPandaFile(file); - // Do not call server, cause no connection at this stage - return true; - }); -} - -void Inspector::Run() -{ - CollectModules(); - - serverThread_ = std::thread(&InspectorServer::Run, &inspectorServer_); - os::thread::SetThreadName(serverThread_.native_handle(), "InspectorServer"); -} - -void Inspector::Stop() -{ - serverThread_.join(); -} - -void Inspector::ConsoleCall(PtThread thread, ConsoleCallType type, uint64_t timestamp, - const PandaVector &arguments) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - auto *debuggableThread = GetDebuggableThread(thread); - ASSERT(debuggableThread != nullptr); - inspectorServer_.CallRuntimeConsoleApiCalled(thread, type, timestamp, debuggableThread->OnConsoleCall(arguments)); -} - -// CC-OFFNXT(G.FUN.01-CPP) Decreasing the number of arguments will decrease the clarity of the code. -void Inspector::Exception(PtThread thread, Method * /* method */, const PtLocation & /* location */, - ObjectHeader * /* exception */, Method * /* catch_method */, const PtLocation &catchLocation) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - auto *debuggableThread = GetDebuggableThread(thread); - ASSERT(debuggableThread != nullptr); - debuggableThread->OnException(catchLocation.GetBytecodeOffset() == panda_file::INVALID_OFFSET); -} - -void Inspector::FramePop(PtThread thread, Method * /* method */, bool /* was_popped_by_exception */) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - auto *debuggableThread = GetDebuggableThread(thread); - ASSERT(debuggableThread != nullptr); - debuggableThread->OnFramePop(); -} - -void Inspector::MethodEntry(PtThread thread, Method * /* method */) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - auto *debuggableThread = GetDebuggableThread(thread); - ASSERT(debuggableThread != nullptr); - if (debuggableThread->OnMethodEntry()) { - HandleError(debugger_.NotifyFramePop(thread, 0)); - } -} - -void Inspector::SourceNameInsert(const panda_file::DebugInfoExtractor *extractor) -{ - const auto &methodList = extractor->GetMethodIdList(); - std::unordered_set sourceNames; - for (const auto &method : methodList) { - sourceNames.insert(extractor->GetSourceFile(method)); - } - for (const auto &sourceName : sourceNames) { - // Get src file name - auto scriptId = inspectorServer_.GetSourceManager().GetScriptId(sourceName); - inspectorServer_.CallDebuggerScriptParsed(scriptId, sourceName); - } -} - -void Inspector::LoadModule(std::string_view fileName) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - Runtime::GetCurrent()->GetClassLinker()->EnumeratePandaFiles( - [this, fileName](auto &file) { - if (file.GetFilename() == fileName) { - debugInfoCache_.AddPandaFile(file); - const auto *extractor = debugInfoCache_.GetDebugInfo(&file); - SourceNameInsert(extractor); - ResolveBreakpoints(file, extractor); - } - - return true; - }, - !fileName.empty()); -} - -void Inspector::ResolveBreakpoints(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfo) -{ - breakpointStorage_.ResolveBreakpoints(file, debugInfo); -} - -void Inspector::SingleStep(PtThread thread, Method *method, const PtLocation &location) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - auto sourceFile = debugInfoCache_.GetSourceFile(method); - // NOTE(fangting, #IC98Z2): etsstdlib.ets should not call loadModule in pytest. - if ((sourceFile == nullptr) || (strcmp(sourceFile, "etsstdlib.ets") == 0)) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - ASSERT(debuggableThread != nullptr); - debuggableThread->OnSingleStep(location, sourceFile); -} - -void Inspector::ThreadStart(PtThread thread) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - if (thread != PtThread::NONE) { - inspectorServer_.CallTargetAttachedToTarget(thread); - } - - // NOLINTBEGIN(modernize-avoid-bind) - auto callbacks = DebuggableThread::SuspensionCallbacks { - [](auto &, auto &, auto) {}, - std::bind(&Inspector::DebuggableThreadPostSuspend, this, thread, _1, _2, _3, _4), - [this]() NO_THREAD_SAFETY_ANALYSIS { debuggerEventsLock_.Unlock(); }, - [this]() NO_THREAD_SAFETY_ANALYSIS { debuggerEventsLock_.ReadLock(); }, - []() {}, - [this, thread]() { inspectorServer_.CallDebuggerResumed(thread); }}; - // NOLINTEND(modernize-avoid-bind) - auto [it, inserted] = threads_.emplace( - std::piecewise_construct, std::forward_as_tuple(thread), - std::forward_as_tuple(thread.GetManagedThread(), &debugger_, std::move(callbacks), breakpointStorage_)); - (void)inserted; - ASSERT(inserted); - - if (breakOnStart_) { - it->second.BreakOnStart(); - } -} - -void Inspector::ThreadEnd(PtThread thread) -{ - os::memory::ReadLockHolder lock(debuggerEventsLock_); - - if (thread != PtThread::NONE) { - inspectorServer_.CallTargetDetachedFromTarget(thread); - } - - [[maybe_unused]] auto erased = threads_.erase(thread); - ASSERT(erased == 1); -} - -void Inspector::VmDeath() -{ - os::memory::WriteLockHolder lock(vmDeathLock_); - - ASSERT(!isVmDead_); - isVmDead_ = true; - - NotifyExecutionEnded(); -} - -void Inspector::RuntimeEnable(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - inspectorServer_.CallRuntimeExecutionContextCreated(thread); -} - -void Inspector::RunIfWaitingForDebugger(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->Touch(); - } - - os::memory::LockHolder lockHolder(waitDebuggerMutex_); - waitDebuggerCond_.Signal(); -} - -void Inspector::WaitForDebugger() -{ - os::memory::LockHolder lock(waitDebuggerMutex_); - waitDebuggerCond_.Wait(&waitDebuggerMutex_); -} - -void Inspector::Pause(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->Pause(); - } -} - -void Inspector::Continue(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->Continue(); - } -} - -void Inspector::SetBreakpointsActive([[maybe_unused]] PtThread thread, bool active) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - breakpointStorage_.SetBreakpointsActive(active); -} - -void Inspector::SetSkipAllPauses(PtThread thread, bool skip) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->SetSkipAllPauses(skip); - } -} - -void Inspector::SetMixedDebugEnabled(PtThread thread, bool mixedDebugEnabled) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->SetMixedDebugEnabled(mixedDebugEnabled); - } -} - -std::set Inspector::GetPossibleBreakpoints(std::string_view sourceFile, size_t startLine, size_t endLine, - bool restrictToFunction) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return {}; - } - - return debugInfoCache_.GetValidLineNumbers(sourceFile, startLine, endLine, restrictToFunction); -} - -std::optional Inspector::SetBreakpoint([[maybe_unused]] PtThread thread, - SourceFileFilter &&sourceFilesFilter, size_t lineNumber, - std::set &sourceFiles, - const std::string *condition) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return {}; - } - - std::string optBytecode; - if (condition != nullptr) { - if (condition->empty()) { - // Some debugger clients send empty condition by default - condition = nullptr; - } else { - Base64Decoder::Decode(*condition, optBytecode); - condition = &optBytecode; - } - } - - return breakpointStorage_.SetBreakpoint(std::move(sourceFilesFilter), lineNumber, sourceFiles, condition, - debugInfoCache_); -} - -void Inspector::RemoveBreakpoint([[maybe_unused]] PtThread thread, BreakpointId id) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - breakpointStorage_.RemoveBreakpoint(id); -} - -void Inspector::RemoveBreakpoints(PtThread thread, const SourceFileFilter &sourceFilesFilter) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread == nullptr) { - return; - } - auto pandaFilesPaths = debugInfoCache_.GetPandaFiles(sourceFilesFilter); - if (pandaFilesPaths.empty()) { - return; - } - - breakpointStorage_.RemoveBreakpoints([pfs = std::as_const(pandaFilesPaths)](const auto &loc) { - for (const auto &pf : pfs) { - if (pf == loc.GetPandaFile()) { - return true; - } - } - return false; - }); -} - -void Inspector::SetPauseOnExceptions(PtThread thread, PauseOnExceptionsState state) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->SetPauseOnExceptions(state); - } -} - -void Inspector::StepInto(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("stepInto"); - return; - } - - auto frame = debugger_.GetCurrentFrame(thread); - if (!frame) { - HandleError(frame.Error()); - return; - } - - debuggableThread->StepInto(debugInfoCache_.GetCurrentLineLocations(*frame.Value())); - } -} - -void Inspector::StepOver(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("stepOver"); - return; - } - - auto frame = debugger_.GetCurrentFrame(thread); - if (!frame) { - HandleError(frame.Error()); - return; - } - - debuggableThread->StepOver(debugInfoCache_.GetCurrentLineLocations(*frame.Value())); - } -} - -void Inspector::StepOut(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("stepOut"); - return; - } - - HandleError(debugger_.NotifyFramePop(thread, 0)); - debuggableThread->StepOut(); - } -} - -void Inspector::ContinueToLocation(PtThread thread, std::string_view sourceFile, size_t lineNumber) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("continueToLocation"); - return; - } - - debuggableThread->ContinueTo(debugInfoCache_.GetContinueToLocations(sourceFile, lineNumber)); - } -} - -void Inspector::RestartFrame(PtThread thread, FrameId frameId) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("restartFrame"); - return; - } - - if (auto error = debugger_.RestartFrame(thread, frameId)) { - HandleError(*error); - return; - } - - debuggableThread->StepInto({}); - } -} - -std::vector Inspector::GetProperties(PtThread thread, RemoteObjectId objectId, bool generatePreview) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return {}; - } - - std::optional> properties; - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread != nullptr) { - debuggableThread->RequestToObjectRepository([objectId, generatePreview, &properties](auto &objectRepository) { - properties = objectRepository.GetProperties(objectId, generatePreview); - }); - } - - if (!properties) { - LOG(INFO, DEBUGGER) << "Failed to resolve object id: " << objectId; - return {}; - } - - return *properties; -} - -std::string Inspector::GetSourceCode(std::string_view sourceFile) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return {}; - } - - return debugInfoCache_.GetSourceCode(sourceFile); -} - -void Inspector::DebuggableThreadPostSuspend(PtThread thread, ObjectRepository &objectRepository, - const std::vector &hitBreakpoints, ObjectHeader *exception, - PauseReason pauseReason) -{ - auto exceptionRemoteObject = exception != nullptr ? objectRepository.CreateObject(TypedValue::Reference(exception)) - : std::optional(); - - inspectorServer_.CallDebuggerPaused( - thread, hitBreakpoints, exceptionRemoteObject, pauseReason, [this, thread, &objectRepository](auto &handler) { - FrameId frameId = 0; - HandleError(debugger_.EnumerateFrames(thread, [this, &objectRepository, &handler, - &frameId](const PtFrame &frame) { - std::string_view sourceFile; - std::string_view methodName; - size_t lineNumber; - debugInfoCache_.GetSourceLocation(frame, sourceFile, methodName, lineNumber); - if (sourceFile.empty()) { - return false; - } - - std::optional objThis; - auto frameObject = objectRepository.CreateFrameObject(frame, debugInfoCache_.GetLocals(frame), objThis); - auto scopeChain = std::vector {Scope(Scope::Type::LOCAL, std::move(frameObject)), - Scope(Scope::Type::GLOBAL, objectRepository.CreateGlobalObject())}; - - handler(frameId++, methodName, sourceFile, lineNumber, scopeChain, objThis); - - return true; - })); - }); -} - -void Inspector::NotifyExecutionEnded() -{ - inspectorServer_.CallRuntimeExecutionContextsCleared(); -} - -Expected Inspector::Evaluate(PtThread thread, const std::string &bytecodeBase64, - size_t frameNumber) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return Unexpected(std::string("Fatal, VM is dead")); - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread == nullptr) { - return Unexpected(std::string("No thread found")); - } - - if (UNLIKELY(!debuggableThread->IsPaused())) { - LogDebuggerNotPaused("evaluate"); - return Unexpected(std::string("Expression evaluation can be done only on pause")); - } - - std::string bytecode; - Base64Decoder::Decode(bytecodeBase64, bytecode); - auto optResult = debuggableThread->EvaluateExpression(frameNumber, bytecode); - if (!optResult) { - return Unexpected(std::move(optResult.Error())); - } - auto optExceptionDetails = (optResult->second) ? CreateExceptionDetails(thread, std::move(*optResult->second)) - : std::optional(); - return EvaluationResult(std::move(optResult->first), std::move(optExceptionDetails)); -} - -std::optional Inspector::CreateExceptionDetails(PtThread thread, RemoteObject &&exception) -{ - auto frame = debugger_.GetCurrentFrame(thread); - if (!frame) { - HandleError(frame.Error()); - return {}; - } - - std::string_view sourceFile; - std::string_view methodName; - size_t lineNumber; - debugInfoCache_.GetSourceLocation(*frame.Value(), sourceFile, methodName, lineNumber); - - ExceptionDetails exceptionDetails(GetNewExceptionId(), "", lineNumber, 0); - return exceptionDetails.SetUrl(sourceFile).SetExceptionObject(std::move(exception)); -} - -size_t Inspector::GetNewExceptionId() -{ - // Atomic with relaxed order reason: data race on concurrent exceptions happening in conditional breakpoints. - return currentExceptionId_.fetch_add(1, std::memory_order_relaxed); -} - -DebuggableThread *Inspector::GetDebuggableThread(PtThread thread) -{ - auto it = threads_.find(thread); - return it != threads_.end() ? &it->second : nullptr; -} - -void Inspector::Disable(PtThread thread) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - - auto *debuggableThread = GetDebuggableThread(thread); - if (debuggableThread == nullptr) { - return; - } - debuggableThread->Reset(); - debuggableThread->Continue(); -} - -void Inspector::ClientDisconnect(PtThread thread) -{ - (void)thread; -} - -void Inspector::SetAsyncCallStackDepth(PtThread thread) -{ - (void)thread; -} - -void Inspector::SetBlackboxPatterns(PtThread thread) -{ - (void)thread; -} - -void Inspector::SmartStepInto(PtThread thread) -{ - (void)thread; -} - -void Inspector::DropFrame(PtThread thread) -{ - (void)thread; -} - -void Inspector::SetNativeRange(PtThread thread) -{ - (void)thread; -} - -void Inspector::ReplyNativeCalling(PtThread thread) -{ - Continue(thread); -} - -void Inspector::ProfilerSetSamplingInterval(int32_t interval) -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return; - } - samplingInterval_ = interval; -} - -Expected Inspector::ProfilerStart() -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return Unexpected(std::string("Fatal, VM is dead")); - } - if (cpuProfilerStarted_) { - return Unexpected(std::string("Fatal, profiling operation is already running.")); - } - cpuProfilerStarted_ = true; - profileInfoBuffer_ = std::make_shared(); - profileInfoBuffer_->SetThreadStartTime(sampler::Sampler::GetMicrosecondsTimeStamp()); - Runtime::GetCurrent()->GetTools().StartSamplingProfiler( - std::make_unique(profileInfoBuffer_), samplingInterval_); - return true; -} - -Expected Inspector::ProfilerStop() -{ - os::memory::ReadLockHolder lock(vmDeathLock_); - if (UNLIKELY(CheckVmDead())) { - return Unexpected(std::string("Fatal, VM is dead")); - } - - if (!cpuProfilerStarted_) { - return Unexpected(std::string("Fatal, profiler inactive")); - } - - Runtime::GetCurrent()->GetTools().StopSamplingProfiler(); - auto profileInfoPtr = profileInfoBuffer_->GetAllThreadsProfileInfos(); - if (!profileInfoPtr) { - return Unexpected(std::string("Fatal, profiler info is empty")); - } - profileInfoBuffer_.reset(); - cpuProfilerStarted_ = false; - return Profile(std::move(profileInfoPtr)); -} - -void Inspector::DebuggerEnable() -{ - os::memory::WriteLockHolder lock(debuggerEventsLock_); - for (auto &[_, dbgThread] : threads_) { - (void)_; - dbgThread.Reset(); - } - breakpointStorage_.Reset(); - Runtime::GetCurrent()->GetClassLinker()->EnumeratePandaFiles([this](auto &file) { - const auto *extractor = debugInfoCache_.GetDebugInfo(&file); - SourceNameInsert(extractor); - return true; - }); -} - -void Inspector::RegisterMethodHandlers() -{ - // NOLINTBEGIN(modernize-avoid-bind) - inspectorServer_.OnCallDebuggerContinueToLocation(std::bind(&Inspector::ContinueToLocation, this, _1, _2, _3)); - inspectorServer_.OnCallDebuggerEnable(std::bind(&Inspector::DebuggerEnable, this)); - inspectorServer_.OnCallDebuggerGetPossibleBreakpoints( - std::bind(&Inspector::GetPossibleBreakpoints, this, _1, _2, _3, _4)); - inspectorServer_.OnCallDebuggerGetScriptSource(std::bind(&Inspector::GetSourceCode, this, _1)); - inspectorServer_.OnCallDebuggerPause(std::bind(&Inspector::Pause, this, _1)); - inspectorServer_.OnCallDebuggerRemoveBreakpoint(std::bind(&Inspector::RemoveBreakpoint, this, _1, _2)); - inspectorServer_.OnCallDebuggerRemoveBreakpointsByUrl(std::bind(&Inspector::RemoveBreakpoints, this, _1, _2)); - inspectorServer_.OnCallDebuggerRestartFrame(std::bind(&Inspector::RestartFrame, this, _1, _2)); - inspectorServer_.OnCallDebuggerResume(std::bind(&Inspector::Continue, this, _1)); - inspectorServer_.OnCallDebuggerSetAsyncCallStackDepth(std::bind(&Inspector::SetAsyncCallStackDepth, this, _1)); - inspectorServer_.OnCallDebuggerSetBlackboxPatterns(std::bind(&Inspector::SetBlackboxPatterns, this, _1)); - inspectorServer_.OnCallDebuggerSmartStepInto(std::bind(&Inspector::SmartStepInto, this, _1)); - inspectorServer_.OnCallDebuggerSetBreakpoint(std::bind(&Inspector::SetBreakpoint, this, _1, _2, _3, _4, _5)); - inspectorServer_.OnCallDebuggerSetBreakpointByUrl(std::bind(&Inspector::SetBreakpoint, this, _1, _2, _3, _4, _5)); - inspectorServer_.OnCallDebuggerGetPossibleAndSetBreakpointByUrl( - std::bind(&Inspector::SetBreakpoint, this, _1, _2, _3, _4, _5)); - inspectorServer_.OnCallDebuggerSetBreakpointsActive(std::bind(&Inspector::SetBreakpointsActive, this, _1, _2)); - inspectorServer_.OnCallDebuggerSetSkipAllPauses(std::bind(&Inspector::SetSkipAllPauses, this, _1, _2)); - inspectorServer_.OnCallDebuggerSetPauseOnExceptions(std::bind(&Inspector::SetPauseOnExceptions, this, _1, _2)); - inspectorServer_.OnCallDebuggerStepInto(std::bind(&Inspector::StepInto, this, _1)); - inspectorServer_.OnCallDebuggerStepOut(std::bind(&Inspector::StepOut, this, _1)); - inspectorServer_.OnCallDebuggerStepOver(std::bind(&Inspector::StepOver, this, _1)); - inspectorServer_.OnCallDebuggerEvaluateOnCallFrame(std::bind(&Inspector::Evaluate, this, _1, _2, _3)); - inspectorServer_.OnCallDebuggerDisable(std::bind(&Inspector::Disable, this, _1)); - inspectorServer_.OnCallDebuggerClientDisconnect(std::bind(&Inspector::ClientDisconnect, this, _1)); - inspectorServer_.OnCallDebuggerDropFrame(std::bind(&Inspector::DropFrame, this, _1)); - inspectorServer_.OnCallDebuggerSetNativeRange(std::bind(&Inspector::SetNativeRange, this, _1)); - inspectorServer_.OnCallDebuggerReplyNativeCalling(std::bind(&Inspector::ReplyNativeCalling, this, _1)); - inspectorServer_.OnCallDebuggerCallFunctionOn(std::bind(&Inspector::Evaluate, this, _1, _2, _3)); - inspectorServer_.OnCallDebuggerSetMixedDebugEnabled(std::bind(&Inspector::SetMixedDebugEnabled, this, _1, _2)); - inspectorServer_.OnCallRuntimeEnable(std::bind(&Inspector::RuntimeEnable, this, _1)); - inspectorServer_.OnCallRuntimeGetProperties(std::bind(&Inspector::GetProperties, this, _1, _2, _3)); - inspectorServer_.OnCallRuntimeRunIfWaitingForDebugger(std::bind(&Inspector::RunIfWaitingForDebugger, this, _1)); - inspectorServer_.OnCallRuntimeEvaluate(std::bind(&Inspector::Evaluate, this, _1, _2, 0)); - inspectorServer_.OnCallProfilerEnable(); - inspectorServer_.OnCallProfilerDisable(); - inspectorServer_.OnCallProfilerSetSamplingInterval(std::bind(&Inspector::ProfilerSetSamplingInterval, this, _1)); - inspectorServer_.OnCallProfilerStart(std::bind(&Inspector::ProfilerStart, this)); - inspectorServer_.OnCallProfilerStop(std::bind(&Inspector::ProfilerStop, this)); - // NOLINTEND(modernize-avoid-bind) -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/inspector.h b/tooling/static/inspector.h deleted file mode 100644 index 5effd413..00000000 --- a/tooling/static/inspector.h +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_INSPECTOR_H -#define PANDA_TOOLING_INSPECTOR_INSPECTOR_H - -#include -#include -#include -#include -#include -#include -#include - -#include "include/tooling/debug_interface.h" -#include "include/tooling/pt_thread.h" - -#include "debugger/breakpoint_storage.h" -#include "debugger/debug_info_cache.h" -#include "debugger/debuggable_thread.h" -#include "debugger/object_repository.h" - -#include "common.h" -#include "inspector_server.h" -#include "runtime/tooling/tools.h" -#include "os/mutex.h" -#include "types/evaluation_result.h" -#include "types/numeric_id.h" -#include "types/pause_on_exceptions_state.h" -#include "types/profile_result.h" -#include "types/property_descriptor.h" -#include "types/remote_object.h" - -namespace ark::tooling { -class DebugInterface; - -namespace inspector { -// NOLINTNEXTLINE(fuchsia-virtual-inheritance) -class Server; - -class Inspector final : public PtHooks { -public: - Inspector(Server &server, DebugInterface &debugger, bool breakOnStart); - ~Inspector() override; - - NO_COPY_SEMANTIC(Inspector); - NO_MOVE_SEMANTIC(Inspector); - - void ConsoleCall(PtThread thread, ConsoleCallType type, uint64_t timestamp, - const PandaVector &arguments) override; - // CC-OFFNXT(G.FUN.01-CPP) Decreasing the number of arguments will decrease the clarity of the code. - void Exception(PtThread thread, Method *method, const PtLocation &location, ObjectHeader *exception, - Method *catchMethod, const PtLocation &catchLocation) override; - void FramePop(PtThread thread, Method *method, bool wasPoppedByException) override; - void MethodEntry(PtThread thread, Method *method) override; - void LoadModule(std::string_view fileName) override; - void SingleStep(PtThread thread, Method *method, const PtLocation &location) override; - void ThreadStart(PtThread thread) override; - void ThreadEnd(PtThread thread) override; - void VmDeath() override; - - void Run(); - void Stop(); - void WaitForDebugger(); - -private: - void RuntimeEnable(PtThread thread); - - void RunIfWaitingForDebugger(PtThread thread); - - void Pause(PtThread thread); - void Continue(PtThread thread); - void Disable(PtThread thread); - void ClientDisconnect(PtThread thread); - void SetAsyncCallStackDepth(PtThread thread); - void SetBlackboxPatterns(PtThread thread); - void SmartStepInto(PtThread thread); - void DropFrame(PtThread thread); - void SetNativeRange(PtThread thread); - void ReplyNativeCalling(PtThread thread); - void SetBreakpointsActive(PtThread thread, bool active); - void SetSkipAllPauses(PtThread thread, bool skip); - void SetMixedDebugEnabled(PtThread thread, bool mixedDebugEnabled); - std::set GetPossibleBreakpoints(std::string_view sourceFile, size_t startLine, size_t endLine, - bool restrictToFunction); - std::optional SetBreakpoint(PtThread thread, SourceFileFilter &&sourceFilesFilter, size_t lineNumber, - std::set &sourceFiles, const std::string *condition); - void RemoveBreakpoint(PtThread thread, BreakpointId id); - void RemoveBreakpoints(PtThread thread, const SourceFileFilter &sourceFilesFilter); - - void SetPauseOnExceptions(PtThread thread, PauseOnExceptionsState state); - - void StepInto(PtThread thread); - void StepOver(PtThread thread); - void StepOut(PtThread thread); - void ContinueToLocation(PtThread thread, std::string_view sourceFile, size_t lineNumber); - - void RestartFrame(PtThread thread, FrameId frameId); - - std::vector GetProperties(PtThread thread, RemoteObjectId objectId, bool generatePreview); - std::string GetSourceCode(std::string_view sourceFile); - - void DebuggableThreadPostSuspend(PtThread thread, ObjectRepository &objectRepository, - const std::vector &hitBreakpoints, ObjectHeader *exception, - PauseReason pauseReason); - - void NotifyExecutionEnded(); - - Expected Evaluate(PtThread thread, const std::string &bytecodeBase64, - size_t frameNumber); - void ProfilerSetSamplingInterval(int32_t interval); - Expected ProfilerStart(); - Expected ProfilerStop(); - - ALWAYS_INLINE bool CheckVmDead() REQUIRES_SHARED(vmDeathLock_) - { - if (UNLIKELY(isVmDead_)) { - LOG(WARNING, DEBUGGER) << "Killing inspector server after VM death"; - inspectorServer_.Kill(); - return true; - } - return false; - } - - /// @brief Get verbose information about the raised exception. - std::optional CreateExceptionDetails(PtThread thread, RemoteObject &&exception); - - size_t GetNewExceptionId(); - - DebuggableThread *GetDebuggableThread(PtThread thread); - - void RegisterMethodHandlers(); - - void ResolveBreakpoints(const panda_file::File &file, const panda_file::DebugInfoExtractor *debugInfoCache); - void CollectModules(); - void DebuggerEnable(); - void SourceNameInsert(const panda_file::DebugInfoExtractor *extractor); - -private: - bool breakOnStart_; - - os::memory::RWLock debuggerEventsLock_; - bool connecting_ {false}; // Should be accessed only from the server thread - - InspectorServer inspectorServer_; // NOLINT(misc-non-private-member-variables-in-classes) - DebugInterface &debugger_; - DebugInfoCache debugInfoCache_; - std::map threads_; - - std::atomic_size_t currentExceptionId_ {0}; - - os::memory::RWLock vmDeathLock_; - bool isVmDead_ GUARDED_BY(vmDeathLock_) {false}; - - BreakpointStorage breakpointStorage_; - - std::thread serverThread_; - uint32_t samplingInterval_ {0}; - std::shared_ptr profileInfoBuffer_ = nullptr; - bool cpuProfilerStarted_ = false; - os::memory::Mutex waitDebuggerMutex_; - os::memory::ConditionVariable waitDebuggerCond_ GUARDED_BY(waitDebuggerMutex_); -}; -} // namespace inspector -} // namespace ark::tooling - -#endif // PANDA_TOOLING_INSPECTOR_INSPECTOR_H diff --git a/tooling/static/inspector_server.cpp b/tooling/static/inspector_server.cpp deleted file mode 100644 index b5019279..00000000 --- a/tooling/static/inspector_server.cpp +++ /dev/null @@ -1,1072 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "inspector_server.h" - -#include -#include -#include -#include -#include - -#include "include/console_call_type.h" -#include "include/tooling/pt_thread.h" -#include "json_serialization/serializable.h" -#include "macros.h" -#include "utils/expected.h" -#include "utils/json_builder.h" -#include "utils/json_parser.h" -#include "utils/logger.h" - -#include "connection/server.h" -#include "json_serialization/jrpc_error.h" -#include "types/custom_url_breakpoint_response.h" -#include "types/debugger_evaluation_request.h" -#include "types/debugger_call_function_on_request.h" -#include "types/location.h" -#include "types/numeric_id.h" -#include "types/possible_breakpoints_response.h" -#include "types/script_source_response.h" -#include "types/url_breakpoint_request.h" -#include "types/url_breakpoint_response.h" - -namespace ark::tooling::inspector { -InspectorServer::InspectorServer(Server &server) : server_(server) {} - -void InspectorServer::Kill() -{ - server_.Kill(); -} - -void InspectorServer::Run() -{ - server_.Run(); -} - -void InspectorServer::OnValidate(std::function &&handler) -{ - server_.OnValidate([handler = std::move(handler)]() { - // Pause debugger events processing - handler(); - - // At this point, the whole messaging is stopped due to: - // - Debugger events are not processed by the inspector after the call above; - // - Client messages are not processed as we are executing on the server thread. - }); -} - -void InspectorServer::OnOpen(std::function &&handler) -{ - server_.OnOpen([this, handler = std::move(handler)]() { - // A new connection is open, reinitialize the state - sessionManager_.EnumerateSessions([this](auto &id, [[maybe_unused]] auto thread) { - if (!id.empty()) { - SendTargetAttachedToTarget(id); - } - }); - - // Resume debugger events processing - handler(); - }); -} - -void InspectorServer::OnFail(std::function &&handler) -{ - server_.OnFail([handler = std::move(handler)]() { - // Resume debugger events processing - handler(); - }); -} - -static std::string_view GetPauseReasonString(PauseReason reason) -{ - switch (reason) { - case PauseReason::EXCEPTION: - return "exception"; - case PauseReason::BREAK_ON_START: - return "Break on start"; - default: - return "other"; - } - UNREACHABLE(); -} - -void InspectorServer::CallDebuggerPaused(PtThread thread, const std::vector &hitBreakpoints, - const std::optional &exception, PauseReason pauseReason, - const std::function &enumerateFrames) -{ - auto sessionId = sessionManager_.GetSessionIdByThread(thread); - - server_.Call(sessionId, "Debugger.paused", [&](auto ¶ms) { - params.AddProperty("callFrames", [this, thread, &enumerateFrames](JsonArrayBuilder &callFrames) { - EnumerateCallFrames(callFrames, thread, enumerateFrames); - }); - - params.AddProperty("hitBreakpoints", [&hitBreakpoints](JsonArrayBuilder &hitBreakpointsBuilder) { - AddHitBreakpoints(hitBreakpointsBuilder, hitBreakpoints); - }); - - if (exception) { - params.AddProperty("data", *exception); - } - - params.AddProperty("reason", GetPauseReasonString(pauseReason)); - }); -} - -void InspectorServer::CallDebuggerResumed(PtThread thread) -{ - server_.Call(sessionManager_.GetSessionIdByThread(thread), "Debugger.resumed"); -} - -void InspectorServer::CallDebuggerScriptParsed(ScriptId scriptId, std::string_view sourceFile) -{ - server_.Call("", "Debugger.scriptParsed", [&sourceFile, &scriptId](auto ¶ms) { - params.AddProperty("executionContextId", 0); - params.AddProperty("scriptId", std::to_string(scriptId)); - params.AddProperty("url", sourceFile.data()); - params.AddProperty("startLine", 0); - params.AddProperty("startColumn", 0); - params.AddProperty("endLine", std::numeric_limits::max()); - params.AddProperty("endColumn", std::numeric_limits::max()); - params.AddProperty("hash", ""); - }); -} - -void InspectorServer::CallRuntimeConsoleApiCalled(PtThread thread, ConsoleCallType type, uint64_t timestamp, - const std::vector &arguments) -{ - auto sessionId = sessionManager_.GetSessionIdByThread(thread); - - server_.Call(sessionId, "Runtime.consoleAPICalled", [&](auto ¶ms) { - params.AddProperty("executionContextId", 0); - params.AddProperty("timestamp", timestamp); - - switch (type) { - case ConsoleCallType::LOG: - params.AddProperty("type", "log"); - break; - case ConsoleCallType::DEBUG: - params.AddProperty("type", "debug"); - break; - case ConsoleCallType::INFO: - params.AddProperty("type", "info"); - break; - case ConsoleCallType::ERROR: - params.AddProperty("type", "error"); - break; - case ConsoleCallType::WARNING: - params.AddProperty("type", "warning"); - break; - default: - UNREACHABLE(); - } - - params.AddProperty("args", [&](JsonArrayBuilder &argsBuilder) { - for (const auto &argument : arguments) { - argsBuilder.Add(argument); - } - }); - }); -} - -void InspectorServer::CallRuntimeExecutionContextCreated(PtThread thread) -{ - auto sessionId = sessionManager_.GetSessionIdByThread(thread); - - std::string name; - if (thread != PtThread::NONE) { - name = "Thread #" + std::to_string(thread.GetId()); - } - - server_.Call(sessionId, "Runtime.executionContextCreated", [&](auto ¶ms) { - params.AddProperty("context", [&](JsonObjectBuilder &context) { - context.AddProperty("id", thread.GetId()); - context.AddProperty("origin", ""); - context.AddProperty("name", name); - context.AddProperty("uniqueId", GetExecutionContextUniqueId(thread)); - }); - }); -} - -void InspectorServer::CallRuntimeExecutionContextsCleared() -{ - server_.Call("Runtime.executionContextsCleared"); -} - -void InspectorServer::CallTargetAttachedToTarget(PtThread thread) -{ - auto &sessionId = sessionManager_.AddSession(thread); - if (!sessionId.empty()) { - SendTargetAttachedToTarget(sessionId); - } -} - -void InspectorServer::CallTargetDetachedFromTarget(PtThread thread) -{ - auto sessionId = sessionManager_.GetSessionIdByThread(thread); - - // Pause the server thread to ensure that there will be no dangling PtThreads - server_.Pause(); - - sessionManager_.RemoveSession(sessionId); - - // Now no one will retrieve the detached thread from the sessions manager - server_.Continue(); - - if (!sessionId.empty()) { - server_.Call("Target.detachedFromTarget", - [&sessionId](auto ¶ms) { params.AddProperty("session_id", sessionId); }); - } -} - -void InspectorServer::OnCallDebuggerContinueToLocation( - std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.continueToLocation", - [this, handler = std::move(handler)](auto &sessionId, const auto ¶ms) -> Server::MethodResponse { - auto location = Location::FromJsonProperty(params, "location"); - if (!location) { - LOG(INFO, DEBUGGER) << location.Error(); - return Unexpected(JRPCError(location.Error())); - } - - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread, sourceManager_.GetSourceFileName(location->GetScriptId()), - location->GetLineNumber()); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerEnable(std::function &&handler) -{ - struct Response : public JsonSerializable { - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("debuggerId", 0); - builder.AddProperty("protocols", [](JsonArrayBuilder &) {}); - } - }; - - server_.OnCall("Debugger.enable", [handler = std::move(handler)](auto, auto &) { - handler(); - return std::unique_ptr(std::make_unique()); - }); -} - -void InspectorServer::OnCallDebuggerGetPossibleBreakpoints( - std::function(std::string_view, size_t, size_t, bool)> &&handler) -{ - // clang-format off - server_.OnCall("Debugger.getPossibleBreakpoints", - [this, handler = std::move(handler)](auto &, const JsonObject ¶ms) -> Server::MethodResponse { - auto optStart = Location::FromJsonProperty(params, "start"); - if (!optStart) { - LOG(INFO, DEBUGGER) << optStart.Error(); - return Unexpected(JRPCError(optStart.Error(), ErrorCode::PARSE_ERROR)); - } - - auto scriptId = optStart->GetScriptId(); - - size_t endLine = ~0U; - if (auto end = Location::FromJsonProperty(params, "end")) { - if (end->GetScriptId() != scriptId) { - std::string_view msg = "Script ids don't match"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INVALID_PARAMS)); - } - - endLine = end->GetLineNumber(); - } - - bool restrictToFunction = false; - if (auto prop = params.GetValue("restrictToFunction")) { - restrictToFunction = *prop; - } - - auto lineNumbers = handler(sourceManager_.GetSourceFileName(scriptId), optStart->GetLineNumber(), - endLine, restrictToFunction); - auto response = std::make_unique(); - for (const auto &line : lineNumbers) { - response->Add(Location(scriptId, line)); - } - return std::unique_ptr(std::move(response)); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerGetScriptSource(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.getScriptSource", - [this, handler = std::move(handler)](auto &, auto ¶ms) -> Server::MethodResponse { - auto scriptId = ParseNumericId(params, "scriptId"); - if (scriptId) { - auto sourceFile = sourceManager_.GetSourceFileName(*scriptId); - return std::unique_ptr( - std::make_unique(handler(sourceFile))); - } - LOG(INFO, DEBUGGER) << scriptId.Error(); - return Unexpected(JRPCError(scriptId.Error(), ErrorCode::PARSE_ERROR)); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerPause(std::function &&handler) -{ - server_.OnCall("Debugger.pause", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerRemoveBreakpoint(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.removeBreakpoint", - [this, handler = std::move(handler)](auto &sessionId, auto ¶ms) -> Server::MethodResponse { - auto breakpointId = ParseNumericId(params, "breakpointId"); - if (breakpointId) { - handler(sessionManager_.GetThreadBySessionId(sessionId), *breakpointId); - return std::unique_ptr(); - } - LOG(INFO, DEBUGGER) << breakpointId.Error(); - return Unexpected(JRPCError(breakpointId.Error())); - }); - // clang-format on -} - -static bool IsPathEqual(const std::string_view &src, const std::string_view &dst) -{ - if (src.size() != dst.size()) { - return false; - } - - for (size_t i = 0; i < src.size(); ++i) { - if ((src[i] == '\\' || src[i] == '/') && (dst[i] == '\\' || dst[i] == '/')) { - continue; - } - if (src[i] != dst[i]) { - return false; - } - } - - return true; -} - -static auto GetUrlFileFilter(const std::string &url) -{ - static constexpr std::string_view FILE_PREFIX = "file://"; - return [sourceFile = url.find(FILE_PREFIX) == 0 ? url.substr(FILE_PREFIX.size()) : url](auto fileName) { - return IsPathEqual(sourceFile, fileName); - }; -} - -void InspectorServer::OnCallDebuggerRemoveBreakpointsByUrl(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.removeBreakpointsByUrl", - [this, handler = std::move(handler)](auto &sessionId, auto ¶ms) -> Server::MethodResponse { - const auto *url = params.template GetValue("url"); - if (url == nullptr) { - std::string_view msg = "No 'url' parameter was provided for Debugger.removeBreakpointsByUrl"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::PARSE_ERROR)); - } - handler(sessionManager_.GetThreadBySessionId(sessionId), GetUrlFileFilter(*url)); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerRestartFrame(std::function &&handler) -{ - struct Response : public JsonSerializable { - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("callFrames", [](JsonArrayBuilder &) {}); - } - }; - // clang-format off - server_.OnCall("Debugger.restartFrame", - [this, handler = std::move(handler)](auto &sessionId, auto ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto frameId = ParseNumericId(params, "callFrameId"); - if (!frameId) { - LOG(INFO, DEBUGGER) << frameId.Error(); - return Unexpected(JRPCError(frameId.Error(), ErrorCode::PARSE_ERROR)); - } - - handler(thread, *frameId); - return std::unique_ptr(std::make_unique()); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerResume(std::function &&handler) -{ - server_.OnCall("Debugger.resume", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerSetBreakpoint(std::function &&handler) -{ - class Response : public JsonSerializable { - public: - explicit Response(std::string &&bpId, Location &&loc) - : breakpointId_(std::move(bpId)), location_(std::move(loc)) - { - } - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("breakpointId", breakpointId_); - builder.AddProperty("actualLocation", location_); - } - - private: - std::string breakpointId_; - Location location_; - }; - // clang-format off - server_.OnCall("Debugger.setBreakpoint", - [this, handler = std::move(handler)](auto &sessionId, auto ¶ms) -> Server::MethodResponse { - auto location = Location::FromJsonProperty(params, "location"); - if (!location) { - LOG(INFO, DEBUGGER) << location.Error(); - return Unexpected(JRPCError(location.Error(), ErrorCode::PARSE_ERROR)); - } - auto condition = params.template GetValue("condition"); - - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto sourceFile = sourceManager_.GetSourceFileName(location->GetScriptId()); - std::set sourceFiles; - - auto id = handler( - thread, [sourceFile](auto fileName) { return fileName == sourceFile; }, - location->GetLineNumber(), sourceFiles, condition); - if (!id) { - std::string_view msg = "Failed to set breakpoint"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INTERNAL_ERROR)); - } - auto response = std::make_unique(std::move(std::to_string(*id)), std::move(*location)); - return std::unique_ptr(std::move(response)); - }); - // clang-format on -} - -Expected, std::string> InspectorServer::SetBreakpointByUrl( - const std::string &sessionId, const UrlBreakpointRequest &breakpointRequest, - const std::function &handler) -{ - std::function sourceFileFilter; - if (const auto &url = breakpointRequest.GetUrl()) { - sourceFileFilter = GetUrlFileFilter(*url); - } else if (const auto &urlRegex = breakpointRequest.GetUrlRegex()) { - sourceFileFilter = [regex = std::regex(*urlRegex)](auto fileName) { - return std::regex_match(fileName.data(), regex); - }; - } else { - // Either 'url' or 'urlRegex' must be specified - checked in parser - UNREACHABLE(); - } - - const auto *condition = breakpointRequest.GetCondition().has_value() ? &*breakpointRequest.GetCondition() : nullptr; - - std::set sourceFiles; - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto id = handler(thread, std::move(sourceFileFilter), breakpointRequest.GetLineNumber(), sourceFiles, condition); - if (!id) { - std::string msg = "Failed to set breakpoint"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(msg); - } - - auto breakpointInfo = std::make_unique(*id); - AddLocations(*breakpointInfo, sourceFiles, breakpointRequest.GetLineNumber(), thread); - return Expected, std::string>(std::move(breakpointInfo)); -} - -void InspectorServer::OnCallDebuggerSetBreakpointByUrl(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.setBreakpointByUrl", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto optRequest = UrlBreakpointRequest::FromJson(params); - if (!optRequest) { - std::stringstream ss; - ss << "Parse error: " << optRequest.Error(); - auto msg = ss.str(); - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::PARSE_ERROR)); - } - auto optResponse = SetBreakpointByUrl(sessionId, *optRequest, handler); - if (optResponse) { - return std::unique_ptr(std::move(optResponse.Value())); - } - return Unexpected(JRPCError(optResponse.Error())); - }); - // clang-format on -} - -static Expected, std::string> ParseUrlBreakpointRequests( - const std::vector &rawRequests) -{ - std::vector requestedBreakpoints; - for (const auto &rawRequest : rawRequests) { - auto *jsonObject = rawRequest.Get(); - if (jsonObject == nullptr) { - std::string msg = "Invalid 'locations' array in getPossibleAndSetBreakpointByUrl"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(std::move(msg)); - } - auto optBreakpointRequest = UrlBreakpointRequest::FromJson(**jsonObject); - if (!optBreakpointRequest) { - std::stringstream ss; - ss << "Invalid breakpoint request: " << optBreakpointRequest.Error(); - auto msg = ss.str(); - LOG(INFO, DEBUGGER) << msg; - return Unexpected(std::move(msg)); - } - requestedBreakpoints.push_back(std::move(*optBreakpointRequest)); - } - return requestedBreakpoints; -} - -void InspectorServer::OnCallDebuggerGetPossibleAndSetBreakpointByUrl(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.getPossibleAndSetBreakpointByUrl", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto rawRequests = params.GetValue("locations"); - if (rawRequests == nullptr) { - std::string_view msg = "No 'locations' array in getPossibleAndSetBreakpointByUrl"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::PARSE_ERROR)); - } - auto optRequests = ParseUrlBreakpointRequests(*rawRequests); - if (!optRequests) { - return Unexpected(JRPCError(std::move(optRequests.Error()), ErrorCode::PARSE_ERROR)); - } - - auto response = std::make_unique(); - for (const auto &req : *optRequests) { - auto optResponse = SetBreakpointByUrl(sessionId, req, handler); - if (!optResponse.HasValue()) { - response->Add(CustomUrlBreakpointResponse(req.GetLineNumber())); - continue; - } - - if (optResponse.Value()->GetLocations().size() != 0) { - response->Add(optResponse.Value()->ToCustomUrlBreakpointResponse()); - } else { - auto resp = CustomUrlBreakpointResponse(req.GetLineNumber()); - resp.SetBreakpointId(optResponse.Value()->GetBreakpointId()); - response->Add(std::move(resp)); - } - } - return std::unique_ptr(std::move(response)); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerSetBreakpointsActive(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.setBreakpointsActive", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - bool active; - if (auto prop = params.GetValue("active")) { - active = *prop; - } else { - std::string_view msg = "No 'active' property"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg)); - } - - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread, active); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerSetSkipAllPauses(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.setSkipAllPauses", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - bool skip; - if (auto prop = params.GetValue("skip")) { - skip = *prop; - } else { - std::string_view msg = "No 'active' property"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INVALID_PARAMS)); - } - - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread, skip); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerSetPauseOnExceptions( - std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.setPauseOnExceptions", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - PauseOnExceptionsState state; - auto stateStr = params.GetValue("state"); - if (stateStr == nullptr) { - std::string_view msg = "No 'state' property"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INVALID_PARAMS)); - } - - if (*stateStr == "none") { - state = PauseOnExceptionsState::NONE; - } else if (*stateStr == "caught") { - state = PauseOnExceptionsState::CAUGHT; - } else if (*stateStr == "uncaught") { - state = PauseOnExceptionsState::UNCAUGHT; - } else if (*stateStr == "all") { - state = PauseOnExceptionsState::ALL; - } else { - std::stringstream ss; - ss << "Invalid 'state' value: " << *stateStr; - auto msg = ss.str(); - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INVALID_PARAMS)); - } - - handler(thread, state); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerStepInto(std::function &&handler) -{ - server_.OnCall("Debugger.stepInto", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerStepOut(std::function &&handler) -{ - server_.OnCall("Debugger.stepOut", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerStepOver(std::function &&handler) -{ - server_.OnCall("Debugger.stepOver", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerEvaluateOnCallFrame( - std::function(PtThread, const std::string &, size_t)> &&handler) -{ - // clang-format off - server_.OnCall("Debugger.evaluateOnCallFrame", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto optRequest = DebuggerEvaluationRequest::FromJson(params); - if (!optRequest) { - LOG(INFO, DEBUGGER) << optRequest.Error(); - return Unexpected(JRPCError(std::move(optRequest.Error()), ErrorCode::PARSE_ERROR)); - } - - auto optResult = handler(thread, optRequest->GetExpression(), optRequest->GetCallFrameId()); - if (!optResult) { - std::stringstream ss; - ss << "Evaluation failed: " << optResult.Error(); - auto msg = ss.str(); - LOG(DEBUG, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INTERNAL_ERROR)); - } - - return std::unique_ptr(std::make_unique(std::move(*optResult))); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerCallFunctionOn( - std::function(PtThread, const std::string &, size_t)> &&handler) -{ - // clang-format off - server_.OnCall("Debugger.callFunctionOn", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto optRequest = DebuggerCallFunctionOnRequest::FromJson(params); - if (!optRequest) { - LOG(INFO, DEBUGGER) << optRequest.Error(); - return Unexpected(JRPCError(std::move(optRequest.Error()), ErrorCode::PARSE_ERROR)); - } - - auto optResult = handler(thread, optRequest->GetFunctionDeclaration(), optRequest->GetCallFrameId()); - if (!optResult) { - std::stringstream ss; - ss << "Evaluation failed: " << optResult.Error(); - auto msg = ss.str(); - LOG(DEBUG, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INTERNAL_ERROR)); - } - - return std::unique_ptr(std::make_unique(std::move(*optResult))); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerSetMixedDebugEnabled(std::function &&handler) -{ - // clang-format off - server_.OnCall("Debugger.setMixedDebugEnabled", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - bool mixedDebugEnabled; - if (auto prop = params.GetValue("mixedDebugEnabled")) { - mixedDebugEnabled = *prop; - } else { - std::string_view msg = "No 'active' property"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INVALID_PARAMS)); - } - - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread, mixedDebugEnabled); - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallDebuggerDisable(std::function &&handler) -{ - server_.OnCall("Debugger.disable", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerClientDisconnect(std::function &&handler) -{ - server_.OnCall("Debugger.clientDisconnect", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerSetAsyncCallStackDepth(std::function &&handler) -{ - server_.OnCall("Debugger.setAsyncCallStackDepth", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerSetBlackboxPatterns(std::function &&handler) -{ - server_.OnCall("Debugger.setBlackboxPatterns", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerSmartStepInto(std::function &&handler) -{ - server_.OnCall("Debugger.smartStepInto", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerDropFrame(std::function &&handler) -{ - server_.OnCall("Debugger.dropFrame", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerSetNativeRange(std::function &&handler) -{ - server_.OnCall("Debugger.setNativeRange", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallDebuggerReplyNativeCalling(std::function &&handler) -{ - server_.OnCall("Debugger.replyNativeCalling", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallRuntimeEnable(std::function &&handler) -{ - server_.OnCall("Runtime.enable", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallRuntimeGetProperties( - std::function(PtThread, RemoteObjectId, bool)> &&handler) -{ - class Response : public JsonSerializable { - public: - explicit Response(std::vector props) : properties_(std::move(props)) {} - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("result", [&](JsonArrayBuilder &array) { - for (auto &descriptor : properties_) { - array.Add(descriptor); - } - }); - } - - private: - std::vector properties_; - }; - // clang-format off - server_.OnCall("Runtime.getProperties", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto objectId = ParseNumericId(params, "objectId"); - if (!objectId) { - LOG(INFO, DEBUGGER) << objectId.Error(); - return Unexpected(JRPCError(objectId.Error(), ErrorCode::PARSE_ERROR)); - } - - auto generatePreview = false; - if (auto prop = params.GetValue("generatePreview")) { - generatePreview = *prop; - } - - auto properties = handler(thread, *objectId, generatePreview); - return std::unique_ptr(std::make_unique(std::move(properties))); - }); - // clang-format on -} - -void InspectorServer::OnCallRuntimeRunIfWaitingForDebugger(std::function &&handler) -{ - server_.OnCall("Runtime.runIfWaitingForDebugger", [this, handler = std::move(handler)](auto &sessionId, auto &) { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - handler(thread); - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallRuntimeEvaluate( - std::function(PtThread, const std::string &)> &&handler) -{ - // clang-format off - server_.OnCall("Runtime.evaluate", - [this, handler = std::move(handler)](auto &sessionId, const JsonObject ¶ms) -> Server::MethodResponse { - auto thread = sessionManager_.GetThreadBySessionId(sessionId); - - auto *expressionStr = params.GetValue("expression"); - if (expressionStr == nullptr || expressionStr->empty()) { - std::string_view msg = "'expression' property is absent or empty"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::PARSE_ERROR)); - } - - auto optResult = handler(thread, *expressionStr); - if (!optResult) { - std::stringstream ss; - ss << "Evaluation failed: " << optResult.Error(); - auto msg = ss.str(); - LOG(DEBUG, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INTERNAL_ERROR)); - } - - return std::unique_ptr(std::make_unique(std::move(*optResult))); - }); - // clang-format on -} - -void InspectorServer::OnCallProfilerEnable() -{ - server_.OnCall("Profiler.enable", [](auto &, auto &) { return std::unique_ptr(); }); -} - -void InspectorServer::OnCallProfilerDisable() -{ - server_.OnCall("Profiler.disable", [](auto &, auto &) { return std::unique_ptr(); }); -} - -void InspectorServer::OnCallProfilerSetSamplingInterval(std::function &&handler) -{ - // clang-format off - server_.OnCall("Profiler.setSamplingInterval", - [handler = std::move(handler)](auto &, const JsonObject ¶ms) -> Server::MethodResponse { - int32_t interval = 0; - if (auto prop = params.GetValue("interval")) { - interval = *prop; - handler(interval); - } else { - std::string_view msg = "No 'interval' property"; - LOG(INFO, DEBUGGER) << msg; - return Unexpected(JRPCError(msg, ErrorCode::INTERNAL_ERROR)); - } - return std::unique_ptr(); - }); - // clang-format on -} - -void InspectorServer::OnCallProfilerStart(std::function()> &&handler) -{ - server_.OnCall("Profiler.start", [handler = std::move(handler)](auto &, auto &) -> Server::MethodResponse { - auto optResult = handler(); - if (!optResult) { - std::stringstream ss; - ss << "Profiler failed: " << optResult.Error(); - auto msg = ss.str(); - LOG(DEBUG, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INTERNAL_ERROR)); - } - return std::unique_ptr(); - }); -} - -void InspectorServer::OnCallProfilerStop(std::function()> &&handler) -{ - server_.OnCall("Profiler.stop", [handler = std::move(handler)](auto &, auto &) -> Server::MethodResponse { - auto optResult = handler(); - if (!optResult) { - std::stringstream ss; - ss << "Profiler failed: " << optResult.Error(); - auto msg = ss.str(); - LOG(DEBUG, DEBUGGER) << msg; - return Unexpected(JRPCError(std::move(msg), ErrorCode::INTERNAL_ERROR)); - } - return std::unique_ptr(std::make_unique(std::move(*optResult))); - }); -} - -void InspectorServer::SendTargetAttachedToTarget(const std::string &sessionId) -{ - server_.Call("Target.attachedToTarget", [&sessionId](auto ¶ms) { - params.AddProperty("sessionId", sessionId); - params.AddProperty("targetInfo", [&sessionId](JsonObjectBuilder &targetInfo) { - targetInfo.AddProperty("targetId", sessionId); - targetInfo.AddProperty("type", "worker"); - targetInfo.AddProperty("title", sessionId); - targetInfo.AddProperty("url", ""); - targetInfo.AddProperty("attached", true); - targetInfo.AddProperty("canAccessOpener", false); - }); - params.AddProperty("waitingForDebugger", true); - }); -} - -void InspectorServer::EnumerateCallFrames(JsonArrayBuilder &callFrames, PtThread thread, - const std::function &enumerateFrames) -{ - enumerateFrames([this, thread, &callFrames](auto frameId, auto methodName, auto sourceFile, auto lineNumber, - auto &scopeChain, auto &objThis) { - CallFrameInfo callFrameInfo {frameId, sourceFile, methodName, lineNumber}; - AddCallFrameInfo(callFrames, callFrameInfo, scopeChain, thread, objThis); - }); -} - -void InspectorServer::AddCallFrameInfo(JsonArrayBuilder &callFrames, const CallFrameInfo &callFrameInfo, - const std::vector &scopeChain, [[maybe_unused]] PtThread thread, - const std::optional &objThis) -{ - callFrames.Add([&](JsonObjectBuilder &callFrame) { - auto scriptId = sourceManager_.GetScriptId(callFrameInfo.sourceFile); - - callFrame.AddProperty("callFrameId", std::to_string(callFrameInfo.frameId)); - callFrame.AddProperty("functionName", callFrameInfo.methodName.data()); - callFrame.AddProperty("location", Location(scriptId, callFrameInfo.lineNumber)); - callFrame.AddProperty("url", callFrameInfo.sourceFile.data()); - - callFrame.AddProperty("scopeChain", [&](JsonArrayBuilder &scopeChainBuilder) { - for (auto &scope : scopeChain) { - scopeChainBuilder.Add(scope); - } - }); - - callFrame.AddProperty("this", objThis.value_or(RemoteObject::Undefined())); - callFrame.AddProperty("canBeRestarted", true); - }); -} - -void InspectorServer::AddLocations(UrlBreakpointResponse &response, const std::set &sourceFiles, - size_t lineNumber, [[maybe_unused]] PtThread thread) -{ - for (auto sourceFile : sourceFiles) { - auto scriptId = sourceManager_.GetScriptId(sourceFile); - response.AddLocation(Location {scriptId, lineNumber}); - } -} - -/* static */ -void InspectorServer::AddHitBreakpoints(JsonArrayBuilder &hitBreakpointsBuilder, - const std::vector &hitBreakpoints) -{ - for (auto id : hitBreakpoints) { - hitBreakpointsBuilder.Add(std::to_string(id)); - } -} - -/* static */ -std::string InspectorServer::GetExecutionContextUniqueId(const PtThread &thread) -{ - static int pid = os::thread::GetPid(); - std::stringstream ss; - ss << pid << ':' << thread.GetId(); - return ss.str(); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/inspector_server.h b/tooling/static/inspector_server.h deleted file mode 100644 index 545a52ef..00000000 --- a/tooling/static/inspector_server.h +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_INSPECTOR_SERVER_H -#define PANDA_TOOLING_INSPECTOR_INSPECTOR_SERVER_H - -#include -#include -#include -#include -#include -#include -#include - -#include "console_call_type.h" -#include "include/tooling/pt_thread.h" - -#include "common.h" -#include "session_manager.h" -#include "source_manager.h" -#include "debugger/thread_state.h" -#include "types/evaluation_result.h" -#include "types/numeric_id.h" -#include "types/pause_on_exceptions_state.h" -#include "types/profile_result.h" -#include "types/property_descriptor.h" -#include "types/remote_object.h" -#include "types/scope.h" - -namespace ark::tooling::inspector { -class UrlBreakpointResponse; -class Server; // NOLINT(fuchsia-virtual-inheritance) -class UrlBreakpointRequest; - -class InspectorServer final { -public: - using SetBreakpointHandler = std::optional(PtThread, SourceFileFilter &&, size_t, - std::set &, const std::string *); - using FrameInfoHandler = std::function &, const std::optional &)>; - -public: - explicit InspectorServer(Server &server); - ~InspectorServer() = default; - - NO_COPY_SEMANTIC(InspectorServer); - NO_MOVE_SEMANTIC(InspectorServer); - - void Kill(); - void Run(); - - void OnValidate(std::function &&handler); - void OnOpen(std::function &&handler); - void OnFail(std::function &&handler); - - void CallDebuggerPaused(PtThread thread, const std::vector &hitBreakpoints, - const std::optional &exception, PauseReason pauseReason, - const std::function &enumerateFrames); - void CallDebuggerResumed(PtThread thread); - void CallDebuggerScriptParsed(ScriptId scriptId, std::string_view sourceFile); - void CallRuntimeConsoleApiCalled(PtThread thread, ConsoleCallType type, uint64_t timestamp, - const std::vector &arguments); - void CallRuntimeExecutionContextCreated(PtThread thread); - void CallRuntimeExecutionContextsCleared(); - void CallTargetAttachedToTarget(PtThread thread); - void CallTargetDetachedFromTarget(PtThread thread); - - void OnCallDebuggerContinueToLocation(std::function &&handler); - void OnCallDebuggerEnable(std::function &&handler); - void OnCallDebuggerGetPossibleBreakpoints( - std::function(std::string_view, size_t, size_t, bool)> &&handler); - void OnCallDebuggerGetScriptSource(std::function &&handler); - void OnCallDebuggerPause(std::function &&handler); - void OnCallDebuggerRemoveBreakpoint(std::function &&handler); - void OnCallDebuggerRemoveBreakpointsByUrl(std::function &&handler); - void OnCallDebuggerRestartFrame(std::function &&handler); - void OnCallDebuggerResume(std::function &&handler); - void OnCallDebuggerSetAsyncCallStackDepth(std::function &&handler); - void OnCallDebuggerSetBlackboxPatterns(std::function &&handler); - void OnCallDebuggerSmartStepInto(std::function &&handler); - void OnCallDebuggerSetBreakpoint(std::function &&handler); - void OnCallDebuggerSetBreakpointByUrl(std::function &&handler); - void OnCallDebuggerGetPossibleAndSetBreakpointByUrl(std::function &&handler); - void OnCallDebuggerSetBreakpointsActive(std::function &&handler); - void OnCallDebuggerSetSkipAllPauses(std::function &&handler); - void OnCallDebuggerSetPauseOnExceptions(std::function &&handler); - void OnCallDebuggerStepInto(std::function &&handler); - void OnCallDebuggerStepOut(std::function &&handler); - void OnCallDebuggerStepOver(std::function &&handler); - void OnCallDebuggerEvaluateOnCallFrame( - std::function(PtThread, const std::string &, size_t)> &&handler); - void OnCallDebuggerClientDisconnect(std::function &&handler); - void OnCallDebuggerDisable(std::function &&handler); - void OnCallDebuggerDropFrame(std::function &&handler); - void OnCallDebuggerSetNativeRange(std::function &&handler); - void OnCallDebuggerReplyNativeCalling(std::function &&handler); - void OnCallDebuggerCallFunctionOn( - std::function(PtThread, const std::string &, size_t)> &&handler); - void OnCallDebuggerSetMixedDebugEnabled(std::function &&handler); - void OnCallRuntimeEnable(std::function &&handler); - void OnCallRuntimeGetProperties( - std::function(PtThread, RemoteObjectId, bool)> &&handler); - void OnCallRuntimeRunIfWaitingForDebugger(std::function &&handler); - void OnCallRuntimeEvaluate( - std::function(PtThread, const std::string &)> &&handler); - void OnCallProfilerEnable(); - void OnCallProfilerDisable(); - void OnCallProfilerSetSamplingInterval(std::function &&handler); - void OnCallProfilerStart(std::function()> &&handler); - void OnCallProfilerStop(std::function()> &&handler); - - SourceManager &GetSourceManager() - { - return sourceManager_; - } - -private: - struct CallFrameInfo { - FrameId frameId; - std::string_view sourceFile; - std::string_view methodName; - size_t lineNumber; - }; - -private: - void SendTargetAttachedToTarget(const std::string &sessionId); - void EnumerateCallFrames(JsonArrayBuilder &callFrames, PtThread thread, - const std::function &enumerateFrames); - void AddCallFrameInfo(JsonArrayBuilder &callFrames, const CallFrameInfo &callFrameInfo, - const std::vector &scopeChain, PtThread thread, - const std::optional &objThis); - Expected, std::string> SetBreakpointByUrl( - const std::string &sessionId, const UrlBreakpointRequest &breakpointRequest, - const std::function &handler); - void AddLocations(UrlBreakpointResponse &response, const std::set &sourceFiles, size_t lineNumber, - PtThread thread); - static void AddHitBreakpoints(JsonArrayBuilder &hitBreakpointsBuilder, - const std::vector &hitBreakpoints); - static std::string GetExecutionContextUniqueId(const PtThread &thread); - - Server &server_; - SessionManager sessionManager_; - SourceManager sourceManager_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_INSPECTOR_SERVER_H diff --git a/tooling/static/json_serialization/jrpc_error.cpp b/tooling/static/json_serialization/jrpc_error.cpp deleted file mode 100644 index 0d2105bd..00000000 --- a/tooling/static/json_serialization/jrpc_error.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "json_serialization/jrpc_error.h" - -#include "utils/json_builder.h" - -namespace ark::tooling::inspector { - -void JRPCError::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("code", static_cast(code_)); - builder.AddProperty("message", message_); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/json_serialization/jrpc_error.h b/tooling/static/json_serialization/jrpc_error.h deleted file mode 100644 index e024c97d..00000000 --- a/tooling/static/json_serialization/jrpc_error.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_JRPC_ERROR_H -#define PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_JRPC_ERROR_H - -#include "json_serialization/serializable.h" - -namespace ark::tooling::inspector { - -enum class ErrorCode { - PARSE_ERROR = -32700, - INTERNAL_ERROR = -32603, - INVALID_PARAMS = -32602, - METHOD_NOT_FOUND = -32601, - INVALID_REQUEST = -32600, - SESSION_NOT_FOUND = -32001, - SERVER_ERROR = -32000, -}; - -/// @brief Inspector error object with json-serialization capability. -class JRPCError final : public JsonSerializable { -public: - explicit JRPCError(std::string_view message, ErrorCode code = ErrorCode::INVALID_REQUEST) - : code_(code), message_(message) - { - } - - explicit JRPCError(std::string &&message, ErrorCode code = ErrorCode::INVALID_REQUEST) - : code_(code), message_(std::move(message)) - { - } - - DEFAULT_COPY_SEMANTIC(JRPCError); - DEFAULT_MOVE_SEMANTIC(JRPCError); - - ~JRPCError() override = default; - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - ErrorCode code_ {0}; - std::string message_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_JRPC_ERROR_H diff --git a/tooling/static/json_serialization/serializable.h b/tooling/static/json_serialization/serializable.h deleted file mode 100644 index 4cf3ba93..00000000 --- a/tooling/static/json_serialization/serializable.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_SERIALIZABLE_H -#define PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_SERIALIZABLE_H - -#include "macros.h" - -namespace ark { -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { - -/// Interface for inspector objects that may be serialized into json. -class JsonSerializable { -public: - JsonSerializable() = default; - virtual ~JsonSerializable() = default; - - DEFAULT_COPY_SEMANTIC(JsonSerializable); - DEFAULT_MOVE_SEMANTIC(JsonSerializable); - - virtual void Serialize(JsonObjectBuilder &builder) const = 0; - - /// Operator() necessary to use std::invoke, for example in json_builder.h::Stringify method. - void operator()(JsonObjectBuilder &builder) const - { - Serialize(builder); - } -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_JSON_SERIALIZATION_SERIALIZABLE_H diff --git a/tooling/static/session_manager.cpp b/tooling/static/session_manager.cpp deleted file mode 100644 index 168be28f..00000000 --- a/tooling/static/session_manager.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "session_manager.h" - -namespace ark::tooling::inspector { -const std::string &SessionManager::AddSession(PtThread thread) -{ - ASSERT(thread.GetManagedThread()); - - os::memory::LockHolder lock(mutex_); - return sessions_.insert({!sessions_.empty() ? std::to_string(thread.GetId()) : "", thread}).first->first; -} - -void SessionManager::RemoveSession(const std::string &id) -{ - os::memory::LockHolder lock(mutex_); - sessions_.erase(id); -} - -std::string SessionManager::GetSessionIdByThread(PtThread thread) const -{ - ASSERT(thread.GetManagedThread()); - - os::memory::LockHolder lock(mutex_); - - auto it = sessions_.find(""); - if (it != sessions_.end() && it->second == thread) { - return ""; - } - - return std::to_string(thread.GetId()); -} - -PtThread SessionManager::GetThreadBySessionId(const std::string &id) const -{ - os::memory::LockHolder lock(mutex_); - - auto it = sessions_.find(id); - if (it == sessions_.end()) { - return PtThread::NONE; - } - - return it->second; -} - -void SessionManager::EnumerateSessions(const std::function &handler) const -{ - os::memory::LockHolder lock(mutex_); - for (auto &[id, thread] : sessions_) { - handler(id, thread); - } -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/session_manager.h b/tooling/static/session_manager.h deleted file mode 100644 index 8c724dbc..00000000 --- a/tooling/static/session_manager.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_SESSION_MANAGER_H -#define PANDA_TOOLING_INSPECTOR_SESSION_MANAGER_H - -#include "include/tooling/pt_thread.h" - -namespace ark::tooling::inspector { -class SessionManager { -public: - SessionManager() = default; - ~SessionManager() = default; - - NO_COPY_SEMANTIC(SessionManager); - NO_MOVE_SEMANTIC(SessionManager); - - const std::string &AddSession(PtThread thread); - void RemoveSession(const std::string &id); - - [[nodiscard]] std::string GetSessionIdByThread(PtThread thread) const; - [[nodiscard]] PtThread GetThreadBySessionId(const std::string &id) const; - - void EnumerateSessions(const std::function &handler) const; - -private: - mutable os::memory::Mutex mutex_; - std::map sessions_ GUARDED_BY(mutex_); -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_SESSION_MANAGER_H diff --git a/tooling/static/source_manager.cpp b/tooling/static/source_manager.cpp deleted file mode 100644 index 2e01a477..00000000 --- a/tooling/static/source_manager.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "source_manager.h" - -#include -#include - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { -ScriptId SourceManager::GetScriptId(std::string_view fileName) -{ - os::memory::LockHolder lock(mutex_); - - auto p = fileNameToId_.emplace(std::string(fileName), fileNameToId_.size()); - ScriptId id(p.first->second); - - if (p.second) { - std::string_view name {p.first->first}; - idToFileName_.emplace(id, name); - } - - return id; -} - -std::string_view SourceManager::GetSourceFileName(ScriptId id) const -{ - os::memory::LockHolder lock(mutex_); - - auto it = idToFileName_.find(id); - if (it != idToFileName_.end()) { - return it->second; - } - - LOG(ERROR, DEBUGGER) << "No file with script id " << id; - - return {}; -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/source_manager.h b/tooling/static/source_manager.h deleted file mode 100644 index 8b77611e..00000000 --- a/tooling/static/source_manager.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_SOURCE_MANAGER_H -#define PANDA_TOOLING_INSPECTOR_SOURCE_MANAGER_H - -#include -#include -#include -#include -#include -#include - -#include "include/tooling/pt_thread.h" -#include "os/mutex.h" - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { -class SourceManager final { -public: - SourceManager() = default; - ~SourceManager() = default; - - NO_COPY_SEMANTIC(SourceManager); - NO_MOVE_SEMANTIC(SourceManager); - - ScriptId GetScriptId(std::string_view fileName); - [[nodiscard]] std::string_view GetSourceFileName(ScriptId id) const; - -private: - mutable os::memory::Mutex mutex_; - std::unordered_map fileNameToId_ GUARDED_BY(mutex_); - std::unordered_map idToFileName_ GUARDED_BY(mutex_); -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_SOURCE_MANAGER_H diff --git a/tooling/static/tests/base64.cpp b/tooling/static/tests/base64.cpp deleted file mode 100644 index baa35773..00000000 --- a/tooling/static/tests/base64.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "gtest/gtest.h" - -#include "evaluation/base64.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { - -class Base64DecoderTest : public testing::Test { -public: - static constexpr std::array TEST_CASES = { - std::pair {"bGlnaHQgd29yay4=", "light work."}, - std::pair {"bGlnaHQgd29yaw==", "light work"}, - std::pair {"bGlnaHQgd29y", "light wor"}, - std::pair {"TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu", - "Many hands make light work."}, - }; -}; - -static void CheckTestCase(std::string_view encoded, std::string_view decoded) -{ - Span encodedData {reinterpret_cast(encoded.data()), encoded.size()}; - auto decodedSize = Base64Decoder::DecodedSize(encodedData); - ASSERT_TRUE(decodedSize.has_value()); - ASSERT_EQ(*decodedSize, decoded.size()); - std::string decodedBuffer(decoded.size(), 0); - ASSERT_TRUE(Base64Decoder::Decode(reinterpret_cast(decodedBuffer.data()), encodedData)); - ASSERT_EQ(decodedBuffer, decoded); -} - -TEST_F(Base64DecoderTest, TestDecoding) -{ - for (auto [encoded, decoded] : TEST_CASES) { - CheckTestCase(encoded, decoded); - } -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/tests/common.h b/tooling/static/tests/common.h deleted file mode 100644 index 4608bede..00000000 --- a/tooling/static/tests/common.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TEST_COMMON_H -#define PANDA_TOOLING_INSPECTOR_TEST_COMMON_H - -#include "utils/json_builder.h" -#include "utils/json_parser.h" - -namespace ark::tooling::inspector::test { -template -inline JsonObject ToJson(const T &object) -{ - JsonObjectBuilder jsonBuilder; - object.Serialize(jsonBuilder); - return JsonObject(std::move(jsonBuilder).Build()); -} - -inline JsonObject ToObject(std::function &¶ms) -{ - JsonObjectBuilder jsonBuilder; - params(jsonBuilder); - return JsonObject(std::move(jsonBuilder).Build()); -} - -} // namespace ark::tooling::inspector::test - -#endif // PANDA_TOOLING_INSPECTOR_TEST_JSON_OBJECT_MATCHER_H diff --git a/tooling/static/tests/debug_info_cache.cpp b/tooling/static/tests/debug_info_cache.cpp deleted file mode 100644 index ca96a741..00000000 --- a/tooling/static/tests/debug_info_cache.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/** - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debugger/debug_info_cache.h" - -#include "gtest/gtest.h" - -#include "assembly-emitter.h" -#include "assembly-parser.h" -#include "runtime.h" -#include "runtime_options.h" -#include "thread_scopes.h" - -#include "test_frame.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { - -static constexpr const char *g_source = R"( - .record Test {} - - .function i32 Test.foo(u64 a0, u64 a1) { - mov v0, v1 # line 2, offset 0, 1 - mov v100, v101 # line 3, offset 2, 3, 4 - movi v0, 4 # line 4, offset 5, 6 - ldai 222 # line 5, offset 7, 8, 9 - return # line 6, offset 10 - } -)"; - -class DebugInfoCacheTest : public testing::Test { -protected: - static void SetUpTestSuite() - { - pandasm::Parser p; - - auto res = p.Parse(g_source, SOURCE_FILE_NAME.data()); - ASSERT_TRUE(res.HasValue()); - ASSERT_TRUE(pandasm::AsmEmitter::Emit(ASM_FILE_NAME.data(), res.Value())); - auto pf = panda_file::OpenPandaFile(ASM_FILE_NAME); - ASSERT_NE(pf, nullptr); - - cache.AddPandaFile(*pf); - - RuntimeOptions options; - options.SetShouldInitializeIntrinsics(false); - options.SetShouldLoadBootPandaFiles(false); - Runtime::Create(options); - - thread_ = ManagedThread::GetCurrent(); - { - ScopedManagedCodeThread s(thread_); - - ClassLinker *classLinker = Runtime::GetCurrent()->GetClassLinker(); - classLinker->AddPandaFile(std::move(pf)); - - PandaString descriptorHolder; - const auto *descriptor = ClassHelper::GetDescriptor(utf::CStringAsMutf8("Test"), &descriptorHolder); - auto *ext = classLinker->GetExtension(panda_file::SourceLang::PANDA_ASSEMBLY); - Class *klass = ext->GetClass(descriptor, true, ext->GetBootContext()); - ASSERT_NE(klass, nullptr); - - auto methods = klass->GetMethods(); - ASSERT_EQ(methods.size(), 1); - methodFoo = &methods[0]; - } - } - - static void TearDownTestSuite() - { - Runtime::Destroy(); - } - - static constexpr std::string_view ASM_FILE_NAME = "source.abc"; - // This test intentionally sets empty source file name to ensure that disassembly is used for debug info - static constexpr std::string_view SOURCE_FILE_NAME = ""; - static DebugInfoCache cache; - static ManagedThread *thread_; - static Method *methodFoo; -}; - -DebugInfoCache DebugInfoCacheTest::cache {}; -ManagedThread *DebugInfoCacheTest::thread_ = nullptr; -Method *DebugInfoCacheTest::methodFoo = nullptr; - -TEST_F(DebugInfoCacheTest, GetCurrentLineLocations) -{ - auto fr0 = TestFrame(methodFoo, 2U); // offset 2, line 3 of function - auto fr1 = TestFrame(methodFoo, 6U); // offset 6, line 4 of function - auto fr2 = TestFrame(methodFoo, 10U); // offset 10, line 6 of function - - auto curr = cache.GetCurrentLineLocations(fr0); - ASSERT_EQ(curr.size(), 3U); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 2U)), curr.end()); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 3U)), curr.end()); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 4U)), curr.end()); - - curr = cache.GetCurrentLineLocations(fr1); - ASSERT_EQ(curr.size(), 2U); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 5U)), curr.end()); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 6U)), curr.end()); - - curr = cache.GetCurrentLineLocations(fr2); - ASSERT_EQ(curr.size(), 1); - ASSERT_NE(curr.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 10U)), curr.end()); -} - -TEST_F(DebugInfoCacheTest, GetLocals) -{ - static constexpr size_t ARGUMENTS_COUNT = 2U; - static constexpr size_t LOCALS_COUNT = 103U; - - auto fr0 = TestFrame(methodFoo, 2U); // offset 2, line 3 of function - - for (size_t i = 0; i < ARGUMENTS_COUNT; i++) { - fr0.SetArgument(i, i + 1); - fr0.SetArgumentKind(i, PtFrame::RegisterKind::PRIMITIVE); - } - for (size_t i = 0; i < LOCALS_COUNT; i++) { - fr0.SetVReg(i, i); - fr0.SetVRegKind(i, PtFrame::RegisterKind::PRIMITIVE); - } - auto mapLocals = cache.GetLocals(fr0); - ASSERT_EQ(ARGUMENTS_COUNT + LOCALS_COUNT, mapLocals.size()); - - EXPECT_NO_THROW(mapLocals.at("a0")); - EXPECT_NO_THROW(mapLocals.at("a1")); - EXPECT_NO_THROW(mapLocals.at("v101")); - - ASSERT_EQ(mapLocals.at("a0").GetAsU64(), 1U); - ASSERT_EQ(mapLocals.at("a1").GetAsU64(), 2U); - ASSERT_EQ(mapLocals.at("v101").GetAsU64(), 101U); -} - -TEST_F(DebugInfoCacheTest, GetSourceLocation) -{ - auto fr0 = TestFrame(methodFoo, 2U); // offset 2, line 3 of function - auto fr1 = TestFrame(methodFoo, 6U); // offset 6, line 4 of function - - std::string_view disasm_file; - std::string_view method_name; - size_t line_number = 0; - - cache.GetSourceLocation(fr0, disasm_file, method_name, line_number); - ASSERT_NE(disasm_file.find(ASM_FILE_NAME.data()), std::string::npos); - ASSERT_EQ(method_name, "foo"); - ASSERT_EQ(line_number, 3U); - - cache.GetSourceLocation(fr1, disasm_file, method_name, line_number); - ASSERT_NE(disasm_file.find(ASM_FILE_NAME.data()), std::string::npos); - ASSERT_EQ(method_name, "foo"); - ASSERT_EQ(line_number, 4U); - - auto set_locs = cache.GetContinueToLocations(disasm_file, 4U); - ASSERT_EQ(set_locs.size(), 2U); - ASSERT_NE(set_locs.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 6U)), set_locs.end()); - ASSERT_NE(set_locs.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 5U)), set_locs.end()); - - set_locs = cache.GetContinueToLocations(disasm_file, 6U); - ASSERT_EQ(set_locs.size(), 1); - ASSERT_NE(set_locs.find(PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 10U)), set_locs.end()); - - set_locs = cache.GetContinueToLocations(disasm_file, 1); - ASSERT_EQ(set_locs.size(), 0); - - auto valid_locs = cache.GetValidLineNumbers(disasm_file, 0U, 100U, false); - ASSERT_EQ(valid_locs.size(), 5U); - - ASSERT_NE(valid_locs.find(2U), valid_locs.end()); - ASSERT_NE(valid_locs.find(3U), valid_locs.end()); - ASSERT_NE(valid_locs.find(4U), valid_locs.end()); - ASSERT_NE(valid_locs.find(5U), valid_locs.end()); - ASSERT_NE(valid_locs.find(6U), valid_locs.end()); - - auto s = cache.GetSourceCode(disasm_file); - ASSERT_NE(s.find(".function i32 Test.foo(u64 a0, u64 a1)"), std::string::npos); - - s = cache.GetSourceCode("source.pa"); - ASSERT_TRUE(s.empty()); - - std::set sets; - auto breaks = cache.GetBreakpointLocations([](auto) { return true; }, 4U, sets); - ASSERT_EQ(breaks.size(), 1); - ASSERT_EQ(sets.size(), 1); - ASSERT_EQ(*sets.begin(), disasm_file); - - ASSERT_NE(std::find(breaks.begin(), breaks.end(), PtLocation(ASM_FILE_NAME.data(), methodFoo->GetFileId(), 5U)), - breaks.end()); -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/tests/inspector_server.cpp b/tooling/static/tests/inspector_server.cpp deleted file mode 100644 index 9eeefa86..00000000 --- a/tooling/static/tests/inspector_server.cpp +++ /dev/null @@ -1,910 +0,0 @@ -/** - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "inspector_server.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "assembly-emitter.h" -#include "assembly-parser.h" -#include "runtime.h" -#include "types/location.h" -#include "utils/json_builder.h" - -#include "connection/server.h" - -#include "common.h" -#include "json_object_matcher.h" - -// NOLINTBEGIN - -using namespace std::placeholders; - -namespace ark::tooling::inspector::test { - -class TestServer : public Server { -public: - void OnValidate([[maybe_unused]] std::function &&handler) override {}; - void OnOpen([[maybe_unused]] std::function &&handler) override {}; - void OnFail([[maybe_unused]] std::function &&handler) override {}; - - void Call(const std::string &session, const char *method_call, - std::function &¶meters) override - { - std::string tmp(method_call); - CallMock(session, tmp, std::move(parameters)); - } - - void OnCall(const char *method_call, Handler &&handler) override - { - std::string tmp(method_call); - OnCallMock(tmp, std::move(handler)); - } - - MOCK_METHOD(void, CallMock, - (const std::string &session, const std::string &method_call, - std::function &¶meters)); - - MOCK_METHOD(void, OnCallMock, (const std::string &method_call, Handler &&handler)); - - bool RunOne() override - { - return true; - }; -}; - -static PtThread g_mthread = PtThread(PtThread::NONE); -static const std::string g_sessionId; -static const std::string g_sourceFile = "source"; -static bool g_handlerCalled = false; - -class ServerTest : public testing::Test { -public: - void SetUp() override - { - RuntimeOptions options; - options.SetShouldInitializeIntrinsics(false); - options.SetShouldLoadBootPandaFiles(false); - Runtime::Create(options); - g_mthread = PtThread(ManagedThread::GetCurrent()); - g_handlerCalled = false; - } - void TearDown() override - { - Runtime::Destroy(); - } - TestServer server; - InspectorServer inspectorServer {server}; -}; - -TEST_F(ServerTest, CallDebuggerResumed) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - EXPECT_CALL(server, CallMock(g_sessionId, "Debugger.resumed", testing::_)).Times(1); - - inspectorServer.CallDebuggerResumed(g_mthread); -} - -TEST_F(ServerTest, CallDebuggerScriptParsed) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - size_t scriptId = 4; - EXPECT_CALL(server, CallMock(g_sessionId, "Debugger.scriptParsed", testing::_)) - .WillOnce([&](testing::Unused, testing::Unused, auto s) { - ASSERT_THAT(ToObject(std::move(s)), - JsonProperties(JsonProperty {"executionContextId", 0}, - JsonProperty {"scriptId", std::to_string(scriptId)}, - JsonProperty {"startLine", 0}, - JsonProperty {"startColumn", 0}, - JsonProperty {"endLine", std::numeric_limits::max()}, - JsonProperty {"endColumn", std::numeric_limits::max()}, - JsonProperty {"hash", ""}, - JsonProperty {"url", g_sourceFile.c_str()})); - }); - inspectorServer.CallDebuggerScriptParsed(ScriptId(scriptId), g_sourceFile); -} - -using ResultHolder = std::optional; - -static void GetResult(Expected, JRPCError> &&returned, ResultHolder &result) -{ - ASSERT_TRUE(returned.HasValue()); - if (returned.Value() != nullptr) { - JsonObjectBuilder builder; - returned.Value()->Serialize(builder); - result.emplace(std::move(builder).Build()); - } else { - result.emplace("{}"); - } -} - -TEST_F(ServerTest, DebuggerEnable) -{ - TestServer server1; - EXPECT_CALL(server1, OnCallMock("Debugger.enable", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ResultHolder result; - GetResult(std::move(res), result); - std::vector> protocols; - ASSERT_THAT(*result, - JsonProperties(JsonProperty {"debuggerId", 0}, - JsonProperty {"protocols", JsonElementsAreArray(protocols)})); - }); - InspectorServer inspector_server1(server1); - inspector_server1.OnCallDebuggerEnable([] {}); -} - -static auto g_simpleHandler = []([[maybe_unused]] auto unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); -}; - -TEST_F(ServerTest, OnCallDebuggerPause) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.pause", testing::_)).WillOnce(g_simpleHandler); - inspectorServer.OnCallDebuggerPause([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerRemoveBreakpoint) -{ - size_t break_id = 14; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.removeBreakpoint", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ASSERT_FALSE(res.HasValue()); - ASSERT_FALSE(g_handlerCalled); - }); - - auto breaks = [break_id](PtThread thread, BreakpointId bid) { - ASSERT_EQ(bid, BreakpointId(break_id)); - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }; - inspectorServer.OnCallDebuggerRemoveBreakpoint(std::move(breaks)); - - EXPECT_CALL(server, OnCallMock("Debugger.removeBreakpoint", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("breakpointId", std::to_string(break_id)); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerRemoveBreakpoint(std::move(breaks)); -} - -TEST_F(ServerTest, OnCallDebuggerRestartFrame) -{ - size_t fid = 5; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.restartFrame", testing::_)).WillOnce([&](testing::Unused, auto handler) { - std::vector> callFrames; - JsonObjectBuilder params; - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ASSERT_FALSE(res.HasValue()); - ASSERT_FALSE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerRestartFrame([&](auto, auto) { g_handlerCalled = true; }); - - EXPECT_CALL(server, OnCallMock("Debugger.restartFrame", testing::_)).WillOnce([&](testing::Unused, auto handler) { - std::vector> callFrames; - JsonObjectBuilder params; - params.AddProperty("callFrameId", std::to_string(fid)); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, - JsonProperties(JsonProperty {"callFrames", JsonElementsAreArray(callFrames)})); - ASSERT_TRUE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerRestartFrame([&](PtThread thread, FrameId id) { - ASSERT_EQ(id, FrameId(fid)); - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerResume) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.resume", testing::_)).WillOnce(g_simpleHandler); - inspectorServer.OnCallDebuggerResume([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -static JsonObject CreatePossibleBreakpointsRequest(ScriptId startScriptId, size_t start, ScriptId endScriptId, - size_t end, bool restrictToFunction) -{ - JsonObjectBuilder params; - params.AddProperty("start", Location(startScriptId, start)); - params.AddProperty("end", Location(endScriptId, end)); - params.AddProperty("restrictToFunction", restrictToFunction); - return JsonObject(std::move(params).Build()); -} - -static auto g_getPossibleBreakpointsHandler = [](ScriptId scriptId, size_t start, size_t end, bool restrictToFunction, - testing::Unused, auto handler) { - auto res = - handler(g_sessionId, CreatePossibleBreakpointsRequest(scriptId, start, scriptId, end, restrictToFunction)); - ResultHolder result; - GetResult(std::move(res), result); - std::vector> locations; - for (auto i = start; i < end; i++) { - locations.push_back( - testing::Pointee(JsonProperties(JsonProperty {"scriptId", std::to_string(scriptId)}, - JsonProperty {"lineNumber", i}))); - } - ASSERT_THAT(*result, - JsonProperties(JsonProperty {"locations", JsonElementsAreArray(locations)})); -}; - -static void DefaultFrameEnumerator(const InspectorServer::FrameInfoHandler &handler) -{ - std::optional objThis; - auto scope_chain = std::vector {Scope(Scope::Type::LOCAL, RemoteObject::Number(72))}; - handler(FrameId(0), std::to_string(0), g_sourceFile, 0, scope_chain, objThis); -} - -TEST_F(ServerTest, OnCallDebuggerGetPossibleBreakpoints) -{ - auto scriptId = 0; - size_t start = 5; - size_t end = 5; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - inspectorServer.CallDebuggerPaused(g_mthread, {}, {}, PauseReason::OTHER, DefaultFrameEnumerator); - - EXPECT_CALL(server, OnCallMock("Debugger.getPossibleBreakpoints", testing::_)) - .WillOnce(std::bind(g_getPossibleBreakpointsHandler, scriptId, start, end, // NOLINT(modernize-avoid-bind) - true, _1, _2)); - auto getLinesTrue = [](std::string_view source, size_t startLine, size_t endLine, bool restrictToFunction) { - std::set result; - if ((source == g_sourceFile) && restrictToFunction) { - for (auto i = startLine; i < endLine; i++) { - result.insert(i); - } - } - return result; - }; - inspectorServer.OnCallDebuggerGetPossibleBreakpoints(getLinesTrue); - - EXPECT_CALL(server, OnCallMock("Debugger.getPossibleBreakpoints", testing::_)) - .WillOnce(std::bind(g_getPossibleBreakpointsHandler, scriptId, start, end, // NOLINT(modernize-avoid-bind) - false, _1, _2)); - auto getLinesFalse = [](std::string_view source, size_t startLine, size_t endLine, bool restrictToFunction) { - std::set result; - if ((source == g_sourceFile) && !restrictToFunction) { - for (auto i = startLine; i < endLine; i++) { - result.insert(i); - } - } - return result; - }; - inspectorServer.OnCallDebuggerGetPossibleBreakpoints(getLinesFalse); - - EXPECT_CALL(server, OnCallMock("Debugger.getPossibleBreakpoints", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - auto res = - handler(g_sessionId, CreatePossibleBreakpointsRequest(scriptId, start, scriptId + 1, end, false)); - ASSERT_FALSE(res.HasValue()); - }); - inspectorServer.OnCallDebuggerGetPossibleBreakpoints(getLinesFalse); -} - -TEST_F(ServerTest, OnCallDebuggerGetScriptSource) -{ - auto scriptId = 0; - - EXPECT_CALL(server, CallMock(g_sessionId, "Debugger.paused", testing::_)) - .WillOnce([&](testing::Unused, testing::Unused, auto s) { ToObject(std::move(s)); }); - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - inspectorServer.CallDebuggerPaused(g_mthread, {}, {}, PauseReason::OTHER, DefaultFrameEnumerator); - - EXPECT_CALL(server, OnCallMock("Debugger.getScriptSource", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("scriptId", std::to_string(scriptId)); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties(JsonProperty {"scriptSource", g_sourceFile})); - }); - inspectorServer.OnCallDebuggerGetScriptSource([](auto source) { - std::string s(source); - return s; - }); - - EXPECT_CALL(server, OnCallMock("Debugger.getScriptSource", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ASSERT_FALSE(res.HasValue()); - }); - inspectorServer.OnCallDebuggerGetScriptSource([](auto) { return "a"; }); -} - -TEST_F(ServerTest, OnCallDebuggerStepOut) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.stepOut", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerStepOut([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerStepInto) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.stepInto", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerStepInto([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerStepOver) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.stepOver", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerStepOver([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -std::optional handlerForSetBreak([[maybe_unused]] PtThread thread, - [[maybe_unused]] const std::function &comp, - size_t line, [[maybe_unused]] std::set &sources, - [[maybe_unused]] const std::string *condition) -{ - sources.insert("source"); - return BreakpointId(line); -} - -std::optional handlerForSetBreakEmpty([[maybe_unused]] PtThread thread, - [[maybe_unused]] const std::function &comp, - [[maybe_unused]] size_t line, - [[maybe_unused]] std::set &sources, - [[maybe_unused]] const std::string *condition) -{ - sources.insert("source"); - return {}; -} - -TEST_F(ServerTest, OnCallDebuggerSetBreakpoint) -{ - auto scriptId = 0; - size_t start = 5; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - inspectorServer.CallDebuggerPaused(g_mthread, {}, {}, PauseReason::OTHER, DefaultFrameEnumerator); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpoint", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("location", Location(scriptId, start)); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, - JsonProperties(JsonProperty {"breakpointId", std::to_string(start)}, - JsonProperty { - "actualLocation", - testing::Pointee(JsonProperties( - JsonProperty {"scriptId", std::to_string(scriptId)}, - JsonProperty {"lineNumber", start - 1}))})); - }); - - inspectorServer.OnCallDebuggerSetBreakpoint(handlerForSetBreak); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpoint", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ASSERT_FALSE(res.HasValue()); - }); - - inspectorServer.OnCallDebuggerSetBreakpoint(handlerForSetBreak); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpoint", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("location", Location(scriptId, start)); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ASSERT_FALSE(res.HasValue()); - }); - - inspectorServer.OnCallDebuggerSetBreakpoint(handlerForSetBreakEmpty); -} - -TEST_F(ServerTest, OnCallDebuggerSetBreakpointByUrl) -{ - auto scriptId = 0; - size_t start = 5; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpointByUrl", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("lineNumber", start); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ASSERT_FALSE(res.HasValue()); - }); - - inspectorServer.OnCallDebuggerSetBreakpointByUrl(handlerForSetBreak); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpointByUrl", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("lineNumber", start); - params.AddProperty("url", "file://source"); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - - std::vector> locations; - locations.push_back(testing::Pointee( - JsonProperties(JsonProperty {"scriptId", std::to_string(scriptId)}, - JsonProperty {"lineNumber", start}))); - auto expected = - JsonProperties(JsonProperty {"breakpointId", std::to_string(start + 1)}, - JsonProperty {"locations", JsonElementsAreArray(locations)}); - - ASSERT_THAT(*result, expected); - }); - - inspectorServer.OnCallDebuggerSetBreakpointByUrl(handlerForSetBreak); -} - -TEST_F(ServerTest, OnCallDebuggerSetBreakpointsActive) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpointsActive", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ASSERT_FALSE(res.HasValue()); - ASSERT_FALSE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerSetBreakpointsActive([](auto thread, auto value) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - ASSERT_FALSE(value); - g_handlerCalled = true; - }); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpointsActive", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("active", true); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - g_handlerCalled = false; - }); - - inspectorServer.OnCallDebuggerSetBreakpointsActive([](auto thread, auto value) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - ASSERT_TRUE(value); - g_handlerCalled = true; - }); - - EXPECT_CALL(server, OnCallMock("Debugger.setBreakpointsActive", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("active", false); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerSetBreakpointsActive([](auto thread, auto value) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - ASSERT_FALSE(value); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSetPauseOnExceptions) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setPauseOnExceptions", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("state", "none"); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - }); - - inspectorServer.OnCallDebuggerSetPauseOnExceptions([](PtThread thread, PauseOnExceptionsState state) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - ASSERT_EQ(PauseOnExceptionsState::NONE, state); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerDisable) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.disable", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerDisable([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerClientDisconnect) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.clientDisconnect", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerClientDisconnect([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSetAsyncCallStackDepth) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setAsyncCallStackDepth", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerSetAsyncCallStackDepth([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSetBlackboxPatterns) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setBlackboxPatterns", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerSetBlackboxPatterns([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSmartStepInto) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.smartStepInto", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerSmartStepInto([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerDropFrame) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.dropFrame", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerDropFrame([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSetNativeRange) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setNativeRange", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerSetNativeRange([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerReplyNativeCalling) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.replyNativeCalling", testing::_)).WillOnce(g_simpleHandler); - - inspectorServer.OnCallDebuggerReplyNativeCalling([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerContinueToLocation) -{ - auto scriptId = 0; - size_t start = 5; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.continueToLocation", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("location", Location(scriptId, start)); - handler(g_sessionId, JsonObject(std::move(params).Build())); - }); - - inspectorServer.OnCallDebuggerContinueToLocation([](PtThread thread, std::string_view, size_t) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallDebuggerSetSkipAllPauses) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.setSkipAllPauses", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("skip", true); - handler(g_sessionId, JsonObject(std::move(params).Build())); - }); - - inspectorServer.OnCallDebuggerSetSkipAllPauses([](PtThread thread, bool) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -Expected handlerForEvaluateFailed([[maybe_unused]] PtThread thread, - [[maybe_unused]] const std::string &bytecodeBase64, - [[maybe_unused]] size_t frameNumber) -{ - return Unexpected(std::string("evaluate failed")); -} - -Expected handlerForEvaluate([[maybe_unused]] PtThread thread, - [[maybe_unused]] const std::string &bytecodeBase64, - [[maybe_unused]] size_t frameNumber) -{ - return Unexpected(std::string("evaluation failed")); -} - -TEST_F(ServerTest, OnCallDebuggerEvaluateOnCallFrame) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.evaluateOnCallFrame", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("callFrameId", -1); - params.AddProperty("expression", "any expression"); - - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ASSERT_FALSE(res.HasValue()); - }); - - inspectorServer.OnCallDebuggerEvaluateOnCallFrame(handlerForEvaluateFailed); -} - -TEST_F(ServerTest, OnCallDebuggerCallFunctionOn) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.callFunctionOn", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("callFrameId", -1); - params.AddProperty("functionDeclaration", "any functionDeclaration"); - - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ASSERT_FALSE(res.HasValue()); - }); - - inspectorServer.OnCallDebuggerCallFunctionOn(handlerForEvaluateFailed); -} - -TEST_F(ServerTest, OnCallDebuggerGetPossibleAndSetBreakpointByUrl) -{ - auto scriptId = 0; - size_t start1 = 5; - size_t start2 = 6; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Debugger.getPossibleAndSetBreakpointByUrl", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - class RequestLocation : public JsonSerializable { - public: - explicit RequestLocation(std::string url, size_t lineNumber) : url_(url), lineNumber_(lineNumber) {} - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("url", url_); - builder.AddProperty("lineNumber", lineNumber_); - } - - private: - std::string url_; - size_t lineNumber_; - }; - std::vector requestLocations = {RequestLocation("file://source", start1), - RequestLocation("file://source", start2)}; - JsonObjectBuilder builder; - builder.AddProperty("locations", [&](JsonArrayBuilder &locations) { - for (const auto &loc : requestLocations) { - locations.Add(loc); - } - }); - - auto res = handler(g_sessionId, JsonObject(std::move(builder).Build())); - ResultHolder result; - GetResult(std::move(res), result); - - std::vector> locations; - locations.push_back(testing::Pointee(JsonProperties(JsonProperty {"scriptId", scriptId}, - JsonProperty {"lineNumber", start1}, - JsonProperty {"columnNumber", 0}, - JsonProperty {"id", "6"}))); - locations.push_back(testing::Pointee(JsonProperties(JsonProperty {"scriptId", scriptId}, - JsonProperty {"lineNumber", start2}, - JsonProperty {"columnNumber", 0}, - JsonProperty {"id", "7"}))); - auto expected = - JsonProperties(JsonProperty {"locations", JsonElementsAreArray(locations)}); - - ASSERT_THAT(*result, expected); - }); - - inspectorServer.OnCallDebuggerGetPossibleAndSetBreakpointByUrl(handlerForSetBreak); -} - -TEST_F(ServerTest, OnCallRuntimeEnable) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Runtime.enable", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - }); - inspectorServer.OnCallRuntimeEnable([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -TEST_F(ServerTest, OnCallRuntimeGetProperties) -{ - auto object_id = 6; - auto preview = true; - - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Runtime.getProperties", testing::_)).WillOnce([&](testing::Unused, auto handler) { - JsonObjectBuilder params; - params.AddProperty("objectId", std::to_string(object_id)); - params.AddProperty("generatePreview", preview); - auto res = handler(g_sessionId, JsonObject(std::move(params).Build())); - ResultHolder result; - GetResult(std::move(res), result); - - std::vector> expected; - expected.push_back(testing::Pointee(JsonProperties( - JsonProperty {"name", "object"}, - JsonProperty { - "value", testing::Pointee(JsonProperties(JsonProperty {"value", object_id}, - JsonProperty {"type", "number"}))}, - JsonProperty {"writable", testing::_}, - JsonProperty {"configurable", testing::_}, - JsonProperty {"enumerable", testing::_}))); - expected.push_back(testing::Pointee(JsonProperties( - JsonProperty {"name", "preview"}, - JsonProperty { - "value", testing::Pointee(JsonProperties(JsonProperty {"value", preview}, - JsonProperty {"type", "boolean"}))}, - JsonProperty {"writable", testing::_}, - JsonProperty {"configurable", testing::_}, - JsonProperty {"enumerable", testing::_}))); - expected.push_back(testing::Pointee(JsonProperties( - JsonProperty {"name", "threadId"}, - JsonProperty { - "value", testing::Pointee(JsonProperties(JsonProperty {"value", g_mthread.GetId()}, - JsonProperty {"type", "number"}))}, - JsonProperty {"writable", testing::_}, - JsonProperty {"configurable", testing::_}, - JsonProperty {"enumerable", testing::_}))); - - ASSERT_THAT(*result, - JsonProperties(JsonProperty {"result", JsonElementsAreArray(expected)})); - }); - - auto getProperties = [](PtThread thread, RemoteObjectId id, bool need_preview) { - std::vector res; - res.push_back(PropertyDescriptor("object", RemoteObject::Number(id))); - res.push_back(PropertyDescriptor("preview", RemoteObject::Boolean(need_preview))); - res.push_back(PropertyDescriptor("threadId", RemoteObject::Number(thread.GetId()))); - return res; - }; - - inspectorServer.OnCallRuntimeGetProperties(getProperties); -} - -TEST_F(ServerTest, OnCallRuntimeRunIfWaitingForDebugger) -{ - inspectorServer.CallTargetAttachedToTarget(g_mthread); - - EXPECT_CALL(server, OnCallMock("Runtime.runIfWaitingForDebugger", testing::_)) - .WillOnce([&](testing::Unused, auto handler) { - JsonObject empty; - auto res = handler(g_sessionId, empty); - ResultHolder result; - GetResult(std::move(res), result); - ASSERT_THAT(*result, JsonProperties()); - ASSERT_TRUE(g_handlerCalled); - }); - - inspectorServer.OnCallRuntimeRunIfWaitingForDebugger([](PtThread thread) { - ASSERT_EQ(thread.GetId(), g_mthread.GetId()); - g_handlerCalled = true; - }); -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/tests/json_object_matcher.cpp b/tooling/static/tests/json_object_matcher.cpp deleted file mode 100644 index 6e8a68f2..00000000 --- a/tooling/static/tests/json_object_matcher.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "json_object_matcher.h" - -namespace ark { - -std::ostream &operator<<(std::ostream &os, const JsonObject::Value &value) -{ - if (auto *string = value.Get()) { - return os << std::quoted(*string); - } - if (auto *number = value.Get()) { - return os << *number; - } - if (auto *boolean = value.Get()) { - return os << std::boolalpha << *boolean; - } - if (auto *array = value.Get()) { - return os << *array; - } - if (auto *object = value.Get()) { - if (*object) { - return os << **object; - } - return os << "null"; - } - - UNREACHABLE(); -} - -} // namespace ark diff --git a/tooling/static/tests/json_object_matcher.h b/tooling/static/tests/json_object_matcher.h deleted file mode 100644 index e6fb9bcf..00000000 --- a/tooling/static/tests/json_object_matcher.h +++ /dev/null @@ -1,238 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TEST_JSON_OBJECT_MATCHER_H -#define PANDA_TOOLING_INSPECTOR_TEST_JSON_OBJECT_MATCHER_H - -#include -#include -#include -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "macros.h" -#include "utils/json_parser.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { -template -constexpr const char *PropertyTypeName(); - -template <> -constexpr const char *PropertyTypeName() -{ - return "array"; -} - -template <> -constexpr const char *PropertyTypeName() -{ - return "boolean"; -} - -template <> -constexpr const char *PropertyTypeName() -{ - return "object"; -} - -template <> -constexpr const char *PropertyTypeName() -{ - return "number"; -} - -template <> -constexpr const char *PropertyTypeName() -{ - return "string"; -} - -template -struct JsonProperty { - const char *key; - testing::Matcher value_matcher; - - template - void DescribeKeyTo(OutputStream *os) const - { - *os << "property " << std::quoted(key) << " of type " << PropertyTypeName(); - } - - void DescribeTo(std::ostream *os) const - { - DescribeKeyTo(os); - *os << " which "; - value_matcher.DescribeTo(os); - } -}; - -template -class HasJsonPropertyMatcher : public testing::MatcherInterface { -public: - explicit HasJsonPropertyMatcher(JsonProperty property) : property_(std::move(property)) {} - - HasJsonPropertyMatcher(const char *key, testing::Matcher value_matcher) - : property_ {key, value_matcher} - { - } - - void DescribeTo(std::ostream *os) const override - { - *os << "has "; - property_.DescribeTo(os); - } - - void DescribeNegationTo(std::ostream *os) const override - { - *os << "does not have a "; - property_.DescribeTo(os); - } - - bool MatchAndExplain(const JsonObject &object, testing::MatchResultListener *os) const override - { - auto value_ptr = object.GetValue(property_.key); - - if (!value_ptr) { - *os << "no "; - property_.DescribeKeyTo(os); - return false; - } - - return property_.value_matcher.MatchAndExplain(*value_ptr, os); - } - -private: - JsonProperty property_; -}; - -template -class JsonObjectMatcher : public testing::MatcherInterface { -public: - explicit JsonObjectMatcher(JsonProperty... property) : properties_ {property...} {} - - void DescribeTo(std::ostream *os) const override - { - *os << "is "; - DescribeInternalTo(os); - } - - void DescribeNegationTo(std::ostream *os) const override - { - *os << "isn't "; - DescribeInternalTo(os); - } - - bool MatchAndExplain(const JsonObject &object, testing::MatchResultListener *os) const override - { - if (object.GetSize() != sizeof...(PropertyType)) { - *os << "number of properties doesn't match"; - return false; - } - - return std::apply( - [&](JsonProperty... property) { - return (HasJsonPropertyMatcher(property).MatchAndExplain(object, os) && ...); - }, - properties_); - } - -private: - void DescribeInternalTo(std::ostream *os) const - { - if constexpr (sizeof...(PropertyType) == 0) { - *os << "an empty JsonObject"; - } else { - *os << "a JsonObject with properties: "; - - std::apply( - [os](auto first_property, auto... property) { - first_property.DescribeTo(os); - ((*os << ", ", property.DescribeTo(os)), ...); - }, - properties_); - } - } - - std::tuple...> properties_; -}; - -template -auto JsonProperties(JsonProperty... property) -{ - return testing::Matcher(new JsonObjectMatcher(property...)); -} - -template -auto JsonElements(testing::Matcher... matcher) -{ - return testing::ElementsAre( - Property(PropertyTypeName(), &JsonObject::Value::Get, Pointee(matcher))...); -} - -template class Container, typename... Param> -auto JsonElementsAreArray(const Container, Param...> &container) -{ - std::vector> elements; - - std::transform(container.begin(), container.end(), std::back_inserter(elements), [](auto &matcher) { - return Property(PropertyTypeName(), &JsonObject::Value::Get, Pointee(matcher)); - }); - - return ElementsAreArray(elements); -} -} // namespace ark::tooling::inspector::test - -namespace ark { -std::ostream &operator<<(std::ostream &os, const JsonObject::Value &value); - -inline std::ostream &operator<<(std::ostream &os, const JsonObject &object) -{ - os << '{'; - - const char *delim = ""; - - for (auto &[key, value] : object.GetUnorderedMap()) { - os << delim << std::quoted(key) << ": " << value; - delim = ", "; - } - - return os << '}'; -} - -inline std::ostream &operator<<(std::ostream &os, const JsonObject::ArrayT &array) -{ - os << '['; - - const char *delim = ""; - - for (auto &value : array) { - os << delim << value; - delim = ", "; - } - - return os << ']'; -} -} // namespace ark - -// NOLINTEND - -#endif // PANDA_TOOLING_INSPECTOR_TEST_JSON_OBJECT_MATCHER_H diff --git a/tooling/static/tests/object_repository.cpp b/tooling/static/tests/object_repository.cpp deleted file mode 100644 index 84b89f63..00000000 --- a/tooling/static/tests/object_repository.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debugger/object_repository.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "assembly-emitter.h" -#include "assembly-parser.h" -#include "runtime.h" -#include "runtime_options.h" -#include "tooling/debugger.h" - -#include "types/numeric_id.h" - -#include "common.h" -#include "json_object_matcher.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { - -static constexpr const char *g_source = R"( - .record Test {} - - .function i32 Test.foo() { - ldai 111 - return - } -)"; - -class ObjectRepositoryTest : public testing::Test { -protected: - static void SetUpTestSuite() - { - RuntimeOptions options; - options.SetShouldInitializeIntrinsics(false); - options.SetShouldLoadBootPandaFiles(false); - Runtime::Create(options); - thread_ = ark::MTManagedThread::GetCurrent(); - thread_->ManagedCodeBegin(); - - pandasm::Parser p; - - auto res = p.Parse(g_source, "source.pa"); - ASSERT_TRUE(res.HasValue()); - auto pf = pandasm::AsmEmitter::Emit(res.Value()); - ASSERT(pf); - ClassLinker *classLinker = Runtime::GetCurrent()->GetClassLinker(); - classLinker->AddPandaFile(std::move(pf)); - - PandaString descriptor; - auto *ext = classLinker->GetExtension(panda_file::SourceLang::PANDA_ASSEMBLY); - Class *klass = ext->GetClass(ClassHelper::GetDescriptor(utf::CStringAsMutf8("Test"), &descriptor)); - ASSERT_NE(klass, nullptr); - - auto methods = klass->GetMethods(); - ASSERT_EQ(methods.size(), 1); - - clsObject = klass->GetManagedObject(); - methodFoo = &methods[0]; - } - - static void TearDownTestSuite() - { - thread_->ManagedCodeEnd(); - Runtime::Destroy(); - } - - static constexpr uint16_t U16_VALUE = 43602; - static constexpr int32_t I32_VALUE = -2345678; - static constexpr int64_t I64_VALUE = 200000000000002; - static constexpr double F64_VALUE = 6.547; - - static ark::MTManagedThread *thread_; - static Method *methodFoo; - static ObjectHeader *clsObject; -}; - -ark::MTManagedThread *ObjectRepositoryTest::thread_ = nullptr; -Method *ObjectRepositoryTest::methodFoo = nullptr; -ObjectHeader *ObjectRepositoryTest::clsObject = nullptr; - -template -static auto GetPrimitiveProperties(const char *type, V value, const char *valueName = "value") -{ - return JsonProperties(JsonProperty {"type", type}, JsonProperty {valueName, value}); -} - -template -static auto GetObjectProperties(NameT className, DescT description, const char *objectId) -{ - return JsonProperties(JsonProperty {"type", "object"}, - JsonProperty {"className", className}, - JsonProperty {"description", description}, - JsonProperty {"objectId", objectId}); -} - -template -static auto GetFrameObjectProperties(NameT name, V valueProperties) -{ - return JsonProperties(JsonProperty {"name", name}, - JsonProperty {"value", valueProperties}, - JsonProperty {"writable", testing::_}, - JsonProperty {"configurable", testing::_}, - JsonProperty {"enumerable", testing::_}); -} - -TEST_F(ObjectRepositoryTest, S) -{ - ObjectRepository obj; - - auto clsObj = obj.CreateObject(TypedValue::Reference(clsObject)); - ASSERT_EQ(clsObj.GetObjectId(), RemoteObjectId(1)); - ASSERT_THAT(ToJson(clsObj), GetObjectProperties(testing::_, testing::_, "1")); - - auto nullObj = obj.CreateObject(TypedValue::Reference(nullptr)); - ASSERT_THAT(ToJson(nullObj), JsonProperties(JsonProperty {"type", "object"}, - JsonProperty {"subtype", "null"}, - JsonProperty {"value", testing::IsNull()})); - - auto invObj = obj.CreateObject(TypedValue::Invalid()); - ASSERT_THAT(ToJson(invObj), JsonProperties(JsonProperty {"type", "undefined"})); - - auto boolObj = obj.CreateObject(TypedValue::U1(true)); - ASSERT_THAT(ToJson(boolObj), GetPrimitiveProperties("boolean", true)); - - auto numObj = obj.CreateObject(TypedValue::U16(U16_VALUE)); - ASSERT_THAT(ToJson(numObj), GetPrimitiveProperties("number", U16_VALUE)); - - auto negObj = obj.CreateObject(TypedValue::I32(I32_VALUE)); - ASSERT_THAT(ToJson(negObj), GetPrimitiveProperties("number", I32_VALUE)); - - auto hugeObj = obj.CreateObject(TypedValue::I64(I64_VALUE)); - ASSERT_THAT(ToJson(hugeObj), - GetPrimitiveProperties("bigint", "200000000000002", "unserializableValue")); - - auto doubObj = obj.CreateObject(TypedValue::F64(F64_VALUE)); - ASSERT_THAT(ToJson(doubObj), GetPrimitiveProperties("number", testing::DoubleEq(F64_VALUE))); - - auto globObj1 = obj.CreateGlobalObject(); - ASSERT_THAT(ToJson(globObj1), GetObjectProperties("[Global]", "Global object", "0")); - - auto globObj2 = obj.CreateGlobalObject(); - ASSERT_THAT(ToJson(globObj2), GetObjectProperties("[Global]", "Global object", "0")); - - PtDebugFrame frame(methodFoo, nullptr); - std::map locals; - locals.emplace("a", TypedValue::U16(56U)); - locals.emplace("ref", TypedValue::Reference(clsObject)); - // "this" parameter for static languages. Note that ArkTS uses "=t" instead of "this". - locals.emplace("this", TypedValue::Reference(clsObject)); - - std::optional objThis; - auto frameObj = obj.CreateFrameObject(frame, locals, objThis); - ASSERT_EQ(frameObj.GetObjectId().value(), RemoteObjectId(2UL)); - - auto properties = obj.GetProperties(frameObj.GetObjectId().value(), false); - ASSERT_EQ(properties.size(), 2UL); - ASSERT_EQ(properties[0].GetName(), "a"); - - ASSERT_THAT(ToJson(frameObj), GetObjectProperties("", "Frame #0", "2")); - - ASSERT_THAT( - ToJson(properties[0]), - GetFrameObjectProperties("a", testing::Pointee(GetPrimitiveProperties("number", 56U)))); - - ASSERT_THAT(ToJson(properties[1]), - GetFrameObjectProperties("ref", testing::Pointee(GetObjectProperties(testing::_, testing::_, "1")))); - - // Call to "CreateFrameObject" must find and fill "this" parameter. - ASSERT_TRUE(objThis.has_value()); - auto idThis = objThis->GetObjectId(); - ASSERT_TRUE(idThis.has_value()); - ASSERT_EQ(idThis.value(), 1U); -} - -TEST_F(ObjectRepositoryTest, TestFrameObjectNoThis) -{ - ObjectRepository obj; - - PtDebugFrame frame(methodFoo, nullptr); - std::map locals; - locals.emplace("a", TypedValue::U16(56U)); - locals.emplace("ref", TypedValue::Reference(clsObject)); - - std::optional objThis; - auto frameObj = obj.CreateFrameObject(frame, locals, objThis); - ASSERT_EQ(frameObj.GetObjectId().value(), RemoteObjectId(2UL)); - - auto properties = obj.GetProperties(frameObj.GetObjectId().value(), true); - ASSERT_EQ(properties.size(), 2UL); - - // No "this" parameter was provided. - ASSERT_FALSE(objThis.has_value()); -} -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/tests/session_manager.cpp b/tooling/static/tests/session_manager.cpp deleted file mode 100644 index 278f8aba..00000000 --- a/tooling/static/tests/session_manager.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "session_manager.h" - -#include - -#include "gtest/gtest.h" - -#include "runtime.h" -#include "runtime_options.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { -class SessionManagerTest : public testing::Test { -protected: - void SetUp() - { - RuntimeOptions options; - options.SetShouldInitializeIntrinsics(false); - options.SetShouldLoadBootPandaFiles(false); - Runtime::Create(options); - } - void TearDown() - { - Runtime::Destroy(); - } - - SessionManager sm_; -}; - -class SessionManagerTestDeath : public SessionManagerTest {}; - -void RunMThread(std::atomic *sync_flag, [[maybe_unused]] PtThread *thread) -{ - auto *m_thr = MTManagedThread::Create(Runtime::GetCurrent(), Runtime::GetCurrent()->GetPandaVM()); - auto pt_thr = PtThread(m_thr); - *thread = pt_thr; - - *sync_flag = true; - - while (*sync_flag) { - } - m_thr->Destroy(); -} - -TEST_F(SessionManagerTest, Test) -{ - std::atomic sync_flag0 = false; - std::atomic sync_flag1 = false; - std::atomic sync_flag2 = false; - - std::vector pt_threads = {PtThread::NONE, PtThread::NONE, PtThread::NONE, - PtThread(ManagedThread::GetCurrent())}; - - std::thread thread0(RunMThread, &sync_flag0, &pt_threads[0U]); - std::thread thread1(RunMThread, &sync_flag1, &pt_threads[1U]); - std::thread thread2(RunMThread, &sync_flag2, &pt_threads[2U]); - - while (!sync_flag0 || !sync_flag1 || !sync_flag2) { - ; - } - - for (auto thread : pt_threads) { - ASSERT_NE(thread, PtThread::NONE); - auto id = sm_.AddSession(thread); - ASSERT_EQ(sm_.GetSessionIdByThread(thread), id); - - auto test = sm_.GetThreadBySessionId(id); - ASSERT_EQ(test, thread); - } - - size_t sessions = 0; - sm_.EnumerateSessions([&sessions, &pt_threads](auto, auto thread) { - sessions++; - ASSERT_NE(std::find(pt_threads.begin(), pt_threads.end(), thread), pt_threads.end()); - }); - ASSERT_EQ(sessions, 4UL); - - sm_.RemoveSession(sm_.GetSessionIdByThread(pt_threads[0])); - sm_.EnumerateSessions([&sessions, &pt_threads](auto, auto thread) { - sessions++; - ASSERT_NE(std::find(pt_threads.begin(), pt_threads.end(), thread), pt_threads.end()); - }); - ASSERT_EQ(sessions, 7UL); - - sync_flag0 = false; - sync_flag1 = false; - sync_flag2 = false; - - thread0.join(); - thread1.join(); - thread2.join(); -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND \ No newline at end of file diff --git a/tooling/static/tests/source_manager.cpp b/tooling/static/tests/source_manager.cpp deleted file mode 100644 index 0230cfa5..00000000 --- a/tooling/static/tests/source_manager.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gtest/gtest.h" - -#include "runtime.h" -#include "runtime_options.h" -#include "source_manager.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { -class SourceManagerTest : public testing::Test { -protected: - void SetUp() - { - RuntimeOptions options; - options.SetShouldInitializeIntrinsics(false); - options.SetShouldLoadBootPandaFiles(false); - Runtime::Create(options); - } - void TearDown() - { - Runtime::Destroy(); - } - - SourceManager sm_; -}; - -void RunManagedThread(std::atomic *sync_flag, [[maybe_unused]] PtThread *thread) -{ - auto *m_thr = MTManagedThread::Create(Runtime::GetCurrent(), Runtime::GetCurrent()->GetPandaVM()); - auto pt_thr = PtThread(m_thr); - *thread = pt_thr; - - *sync_flag = true; - - while (*sync_flag) { - } - m_thr->Destroy(); -} - -TEST_F(SourceManagerTest, General) -{ - std::atomic sync_flag1 = false; - PtThread pt_thread1 = PtThread::NONE; - std::thread mthread1(RunManagedThread, &sync_flag1, &pt_thread1); - - while (!sync_flag1) { - ; - } - - auto test_id0 = sm_.GetScriptId("test.pa"); - ASSERT_EQ(test_id0, ScriptId(0)); - - ASSERT_EQ(sm_.GetSourceFileName(test_id0), "test.pa"); - ASSERT_EQ(sm_.GetSourceFileName(ScriptId(1)), ""); - - test_id0 = sm_.GetScriptId("test.pa"); - ASSERT_EQ(test_id0, ScriptId(0)); - - auto test_id1 = sm_.GetScriptId("test1.pa"); - ASSERT_EQ(test_id1, ScriptId(1)); - - auto test_id2 = sm_.GetScriptId("test2.pa"); - auto test_id3 = sm_.GetScriptId("test3.pa"); - ASSERT_EQ(sm_.GetSourceFileName(test_id2), "test2.pa"); - ASSERT_EQ(sm_.GetSourceFileName(test_id3), "test3.pa"); - - ASSERT_EQ(sm_.GetSourceFileName(ScriptId(5U)), ""); - - ASSERT_EQ(sm_.GetSourceFileName(test_id2), "test2.pa"); - - test_id0 = sm_.GetScriptId("test.pa"); - ASSERT_EQ(test_id0, ScriptId(0)); - - sync_flag1 = false; - - mthread1.join(); -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/tests/test_frame.h b/tooling/static/tests/test_frame.h deleted file mode 100644 index 74160a65..00000000 --- a/tooling/static/tests/test_frame.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TEST_TEST_FRAME_H -#define PANDA_TOOLING_INSPECTOR_TEST_TEST_FRAME_H - -#include -#include -#include - -#include "include/method.h" -#include "include/tooling/debug_interface.h" -#include "include/tooling/pt_thread.h" -#include "macros.h" -#include "utils/list.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { -class TestFrame : public PtFrame { -public: - explicit TestFrame(Method *method, uint32_t bytecode_offset) : method_(method), bytecode_offset_(bytecode_offset) {} - - ~TestFrame() override {} - - bool IsInterpreterFrame() const override - { - return true; - } - - void SetMethod(Method *method) - { - method_ = method; - } - - Method *GetMethod() const override - { - return method_; - } - - void SetVReg(size_t index, uint64_t value) - { - if (vregs_.size() <= index) { - vregs_.resize(index + 1); - } - vregs_[index] = value; - } - - uint64_t GetVReg(size_t index) const override - { - return vregs_[index]; - } - - void SetVRegKind(size_t index, RegisterKind value) - { - if (vreg_kinds_.size() <= index) { - vreg_kinds_.resize(index + 1); - } - vreg_kinds_[index] = value; - } - - RegisterKind GetVRegKind(size_t i) const override - { - return vreg_kinds_[i]; - } - - size_t GetVRegNum() const override - { - return vregs_.size(); - } - - void SetArgument(size_t index, uint64_t value) - { - if (args_.size() <= index) { - args_.resize(index + 1); - } - args_[index] = value; - } - - uint64_t GetArgument(size_t index) const override - { - return args_[index]; - } - - void SetArgumentKind(size_t index, RegisterKind value) - { - if (arg_kinds_.size() <= index) { - arg_kinds_.resize(index + 1); - } - arg_kinds_[index] = value; - } - - RegisterKind GetArgumentKind(size_t i) const override - { - return arg_kinds_[i]; - } - - size_t GetArgumentNum() const override - { - return args_.size(); - } - - void SetAccumulator(uint64_t value) - { - acc_ = value; - } - - uint64_t GetAccumulator() const override - { - return acc_; - } - - RegisterKind GetAccumulatorKind() const override - { - return acc_kind_; - } - - panda_file::File::EntityId GetMethodId() const override - { - return method_->GetFileId(); - } - - void SetBytecodeOffset(uint32_t bytecode_offset) - { - bytecode_offset_ = bytecode_offset; - } - - uint32_t GetBytecodeOffset() const override - { - return bytecode_offset_; - } - - std::string GetPandaFile() const override - { - return method_->GetPandaFile()->GetFilename(); - } - - uint32_t GetFrameId() const override - { - return reinterpret_cast(this); - } - -private: - Method *method_ {nullptr}; - uint32_t bytecode_offset_ {0}; - - uint64_t acc_ {0}; - std::vector args_; - std::vector vregs_; - PandaVector vreg_kinds_; - PandaVector arg_kinds_; - RegisterKind acc_kind_ {PtFrame::RegisterKind::PRIMITIVE}; -}; -} // namespace ark::tooling::inspector::test - -// NOLINTEND - -#endif // PANDA_TOOLING_INSPECTOR_TEST_TEST_FRAME_H diff --git a/tooling/static/tests/thread_state.cpp b/tooling/static/tests/thread_state.cpp deleted file mode 100644 index 025e7926..00000000 --- a/tooling/static/tests/thread_state.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/** - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "debugger/thread_state.h" - -#include "gtest/gtest.h" - -#include "evaluation/evaluation_engine.h" -#include "file.h" -#include "object_header.h" -#include "runtime_options.h" -#include "runtime.h" -#include "typed_value.h" - -// NOLINTBEGIN - -namespace ark::tooling::inspector::test { -class MockEvaluationEngine final : public EvaluationEngine { -public: - Expected, Error> EvaluateExpression( - [[maybe_unused]] uint32_t frameNumber, [[maybe_unused]] const ExpressionWrapper &bytecode, - [[maybe_unused]] Method **method) override - { - return std::make_pair(TypedValue::Invalid(), nullptr); - } -}; - -class ThreadStateTest : public testing::Test { - void SetUp() - { - state = std::make_unique(mockEvaluationEngine_, bpStorage_); - } - -protected: - MockEvaluationEngine mockEvaluationEngine_; - BreakpointStorage bpStorage_; - std::unique_ptr state; - PtLocation fake = PtLocation("", {}, 0); - PtLocation location0 = PtLocation("test.abc", panda_file::File::EntityId(1), 0); - PtLocation location1 = PtLocation("test.abc", panda_file::File::EntityId(1), 1); - PtLocation location2 = PtLocation("test.abc", panda_file::File::EntityId(1), 2); - PtLocation location3 = PtLocation("test.abc", panda_file::File::EntityId(1), 3); - const char *source = "/test.ets"; -}; - -TEST_F(ThreadStateTest, BreakOnStart) -{ - ASSERT_FALSE(state->IsPaused()); - state->OnSingleStep(fake, source); - ASSERT_FALSE(state->IsPaused()); - - state->BreakOnStart(); - state->OnSingleStep(fake, source); - ASSERT_TRUE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, PauseAndContinue) -{ - state->Pause(); - state->OnSingleStep(fake, source); - ASSERT_TRUE(state->IsPaused()); - state->Continue(); - state->OnSingleStep(fake, source); - ASSERT_FALSE(state->IsPaused()); - - state->Pause(); - ASSERT_FALSE(state->IsPaused()); - state->Continue(); - state->OnSingleStep(fake, source); - ASSERT_FALSE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, StepInto) -{ - state->Pause(); - state->OnSingleStep(fake, source); - - std::unordered_set locs; - locs.insert(location1); - locs.insert(location2); - - ASSERT_TRUE(state->IsPaused()); - state->StepInto(locs); - state->OnSingleStep(location2, source); - ASSERT_FALSE(state->IsPaused()); - state->OnSingleStep(location3, source); - ASSERT_TRUE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, ContinueTo) -{ - state->Pause(); - state->OnSingleStep(fake, source); - - std::unordered_set locs; - locs.insert(location1); - locs.insert(location2); - - ASSERT_TRUE(state->IsPaused()); - state->ContinueTo(locs); - state->OnSingleStep(location0, source); - ASSERT_FALSE(state->IsPaused()); - state->OnSingleStep(location1, source); - ASSERT_TRUE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, StepOut) -{ - state->Pause(); - state->OnSingleStep(fake, source); - - ASSERT_TRUE(state->IsPaused()); - state->StepOut(); - state->OnSingleStep(location0, source); - ASSERT_FALSE(state->IsPaused()); - state->OnSingleStep(location1, source); - ASSERT_FALSE(state->IsPaused()); - state->OnSingleStep(location2, source); - ASSERT_FALSE(state->IsPaused()); - state->OnFramePop(); - state->OnSingleStep(fake, source); - ASSERT_TRUE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, StepOver) -{ - state->Pause(); - state->OnSingleStep(fake, source); - - std::unordered_set locs; - locs.insert(location1); - locs.insert(location2); - - ASSERT_TRUE(state->IsPaused()); - state->StepOver(locs); - state->OnSingleStep(location1, source); - ASSERT_FALSE(state->IsPaused()); - state->OnMethodEntry(); - state->OnSingleStep(fake, source); - ASSERT_FALSE(state->IsPaused()); - state->OnFramePop(); - state->OnSingleStep(location2, source); - ASSERT_FALSE(state->IsPaused()); - state->OnFramePop(); - state->OnSingleStep(fake, source); - ASSERT_TRUE(state->IsPaused()); -} - -TEST_F(ThreadStateTest, OnException) -{ - ASSERT_FALSE(state->IsPaused()); - - state->SetPauseOnExceptions(PauseOnExceptionsState::NONE); - state->OnException(false); - ASSERT_FALSE(state->IsPaused()); - state->OnException(true); - ASSERT_FALSE(state->IsPaused()); - - state->SetPauseOnExceptions(PauseOnExceptionsState::CAUGHT); - state->OnException(true); - ASSERT_FALSE(state->IsPaused()); - state->OnException(false); - ASSERT_TRUE(state->IsPaused()); - state->Continue(); - ASSERT_FALSE(state->IsPaused()); - - state->SetPauseOnExceptions(PauseOnExceptionsState::UNCAUGHT); - state->OnException(false); - ASSERT_FALSE(state->IsPaused()); - state->OnException(true); - ASSERT_TRUE(state->IsPaused()); - state->Continue(); - ASSERT_FALSE(state->IsPaused()); - - state->SetPauseOnExceptions(PauseOnExceptionsState::ALL); - state->OnException(false); - ASSERT_TRUE(state->IsPaused()); - state->Continue(); - ASSERT_FALSE(state->IsPaused()); - state->OnException(true); - ASSERT_TRUE(state->IsPaused()); -} - -} // namespace ark::tooling::inspector::test - -// NOLINTEND diff --git a/tooling/static/types/custom_url_breakpoint_response.cpp b/tooling/static/types/custom_url_breakpoint_response.cpp deleted file mode 100644 index a9c5c7e4..00000000 --- a/tooling/static/types/custom_url_breakpoint_response.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/custom_url_breakpoint_response.h" - -#include "utils/json_builder.h" - -namespace ark::tooling::inspector { - -void CustomUrlBreakpointResponse::Serialize(JsonObjectBuilder &builder) const -{ - std::string id = id_.has_value() ? std::to_string(*id_) : "invalid"; - builder.AddProperty("id", id); - // NOTE(fangting, #IC98WJ): make 0-based line numbers default for Inspector - builder.AddProperty("lineNumber", lineNumber_ - 1); - builder.AddProperty("columnNumber", columnNumber_); - builder.AddProperty("scriptId", scriptId_); -} - -void CustomUrlBreakpointLocations::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("locations", [this](JsonArrayBuilder &arrayBuilder) { - for (const auto &loc : locations_) { - arrayBuilder.Add(loc); - } - }); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/custom_url_breakpoint_response.h b/tooling/static/types/custom_url_breakpoint_response.h deleted file mode 100644 index 3a4090c4..00000000 --- a/tooling/static/types/custom_url_breakpoint_response.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_CUSTOM_URL_BREAKPOINT_RESPONSE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_CUSTOM_URL_BREAKPOINT_RESPONSE_H - -#include "json_serialization/serializable.h" - -#include - -#include "macros.h" - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -/// @brief Response for single breakpoint set by custom "Debugger.getPossibleAndSetBreakpointByUrl" -class CustomUrlBreakpointResponse final : public JsonSerializable { -public: - explicit CustomUrlBreakpointResponse(size_t lineNumber) : lineNumber_(lineNumber) {} - - DEFAULT_COPY_SEMANTIC(CustomUrlBreakpointResponse); - DEFAULT_MOVE_SEMANTIC(CustomUrlBreakpointResponse); - - ~CustomUrlBreakpointResponse() override = default; - - CustomUrlBreakpointResponse &SetLineNumber(size_t lineNumber) - { - lineNumber_ = lineNumber; - return *this; - } - - CustomUrlBreakpointResponse &SetColumnNumber(std::optional optColumnNumber) - { - columnNumber_ = optColumnNumber.has_value() ? *optColumnNumber : DEFAULT_COLUMN_NUMBER; - return *this; - } - - CustomUrlBreakpointResponse &SetScriptId(ScriptId scriptId) - { - scriptId_ = scriptId; - return *this; - } - - CustomUrlBreakpointResponse &SetBreakpointId(BreakpointId id) - { - id_ = id; - return *this; - } - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - // CC-OFFNXT(G.NAM.03-CPP) project code style - static constexpr size_t DEFAULT_COLUMN_NUMBER = 0; - -private: - // Default values are selected for compatibility - size_t lineNumber_ {0}; - size_t columnNumber_ {DEFAULT_COLUMN_NUMBER}; - ScriptId scriptId_ {0}; - std::optional id_ {}; // "invalid" default value -}; - -class CustomUrlBreakpointLocations final : public JsonSerializable { -public: - void Serialize(JsonObjectBuilder &builder) const override; - - void Add(CustomUrlBreakpointResponse &&loc) - { - locations_.emplace_back(std::move(loc)); - } - -private: - std::vector locations_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_CUSTOM_URL_BREAKPOINT_RESPONSE_H diff --git a/tooling/static/types/debugger_call_function_on_request.cpp b/tooling/static/types/debugger_call_function_on_request.cpp deleted file mode 100644 index d1242a2c..00000000 --- a/tooling/static/types/debugger_call_function_on_request.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/debugger_call_function_on_request.h" -#include "utils/json_parser.h" - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -Expected DebuggerCallFunctionOnRequest::FromJson(const JsonObject &object) -{ - DebuggerCallFunctionOnRequest parsed; - - auto optFrameId = ParseNumericId(object, "callFrameId"); - if (!optFrameId) { - return Unexpected(optFrameId.Error()); - } - parsed.callFrameId_ = *optFrameId; - - const auto *optFunctionDeclaration = object.GetValue("functionDeclaration"); - if (optFunctionDeclaration == nullptr) { - return Unexpected(std::string("no 'functionDeclaration' field")); - } - parsed.functionDeclaration_ = optFunctionDeclaration; - - auto optSilent = object.GetValue("silent"); - if (optSilent != nullptr) { - parsed.silent_ = *optSilent; - } - - auto optReturnByValue = object.GetValue("returnByValue"); - if (optReturnByValue != nullptr) { - parsed.returnByValue_ = *optReturnByValue; - } - - auto optGeneratePreview = object.GetValue("generatePreview"); - if (optGeneratePreview != nullptr) { - parsed.generatePreview_ = *optGeneratePreview; - } - - return parsed; -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/debugger_call_function_on_request.h b/tooling/static/types/debugger_call_function_on_request.h deleted file mode 100644 index 4fb58ddf..00000000 --- a/tooling/static/types/debugger_call_function_on_request.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_CALL_FUNCTION_ON_REQUEST_H -#define PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_CALL_FUNCTION_ON_REQUEST_H - -#include "macros.h" -#include "utils/expected.h" - -namespace ark { -class JsonObject; -} // namespace ark - -namespace ark::tooling::inspector { - -/** - * @brief Request parameters of `Debugger.callFunctionOn` method. - * Instances of this class must not outlive the source `JsonObject`. - * Parameters: - * - `callFrameId_`: size_t - The identifier of the call frame where the function will be executed. (Required) - * - `functionDeclaration_`: std::string - The function declaration string to be executed. (Required) - * - `objectId_`: size_t - The identifier of the object on which the function will be called. (Optional) - * - `arguments_`: std::vector> - A list of arguments to pass to the function. (Optional) - * - `silent_`: bool - Whether to suppress execution side effects. (Optional) - * - `returnByValue_`: bool - Whether to return the result as a value or by reference. (Optional) - * - `generatePreview_`: bool - Whether to generate a preview of the result. (Optional) - * - `userGesture_`: bool - Whether the function call is triggered by a user gesture. (Optional) - * - `awaitPromise_`: bool - Whether to await the promise returned by the function. (Optional) - * - `executionContextId_`: size_t - The identifier of the execution context where the function will be executed. - * (Optional) - * - `objectGroup_`: std::string - The group name for the result object. (Optional) - * - `throwOnSideEffect_`: bool - Whether to throw an exception if the function has side effects. (Optional) - */ -class DebuggerCallFunctionOnRequest final { -public: - static Expected FromJson(const JsonObject &object); - - DEFAULT_COPY_SEMANTIC(DebuggerCallFunctionOnRequest); - DEFAULT_MOVE_SEMANTIC(DebuggerCallFunctionOnRequest); - - ~DebuggerCallFunctionOnRequest() = default; - - size_t GetCallFrameId() const - { - return callFrameId_; - } - - const std::string &GetFunctionDeclaration() const - { - return *functionDeclaration_; - } - -private: - DebuggerCallFunctionOnRequest() = default; - -private: - size_t callFrameId_ {0}; - const std::string *functionDeclaration_ {nullptr}; - bool silent_ {false}; - bool returnByValue_ {false}; - bool generatePreview_ {false}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_CALL_FUNCTION_ON_REQUEST_H diff --git a/tooling/static/types/debugger_evaluation_request.cpp b/tooling/static/types/debugger_evaluation_request.cpp deleted file mode 100644 index 7a846714..00000000 --- a/tooling/static/types/debugger_evaluation_request.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/debugger_evaluation_request.h" - -#include "utils/json_parser.h" - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -Expected DebuggerEvaluationRequest::FromJson(const JsonObject &object) -{ - DebuggerEvaluationRequest parsed; - - auto optFrameId = ParseNumericId(object, "callFrameId"); - if (!optFrameId) { - return Unexpected(optFrameId.Error()); - } - parsed.callFrameId_ = *optFrameId; - - const auto *optExpression = object.GetValue("expression"); - if (optExpression == nullptr) { - return Unexpected(std::string("no 'expression' field")); - } - parsed.expression_ = optExpression; - - auto optSilent = object.GetValue("silent"); - if (optSilent != nullptr) { - parsed.silent_ = *optSilent; - } - - auto optReturnByValue = object.GetValue("returnByValue"); - if (optReturnByValue != nullptr) { - parsed.returnByValue_ = *optReturnByValue; - } - - auto optGeneratePreview = object.GetValue("generatePreview"); - if (optGeneratePreview != nullptr) { - parsed.generatePreview_ = *optGeneratePreview; - } - - return parsed; -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/debugger_evaluation_request.h b/tooling/static/types/debugger_evaluation_request.h deleted file mode 100644 index 1e2c6efc..00000000 --- a/tooling/static/types/debugger_evaluation_request.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_EVALUATION_REQUEST_H -#define PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_EVALUATION_REQUEST_H - -#include "macros.h" -#include "utils/expected.h" - -namespace ark { -class JsonObject; -} // namespace ark - -namespace ark::tooling::inspector { - -/** - * @brief Request parameters of `Debugger.evaluateOnCallFrame` method. - * Instances of this class must not outlive the source `JsonObject`. - */ -class DebuggerEvaluationRequest final { -public: - static Expected FromJson(const JsonObject &object); - - DEFAULT_COPY_SEMANTIC(DebuggerEvaluationRequest); - DEFAULT_MOVE_SEMANTIC(DebuggerEvaluationRequest); - - ~DebuggerEvaluationRequest() = default; - - size_t GetCallFrameId() const - { - return callFrameId_; - } - - const std::string &GetExpression() const - { - return *expression_; - } - -private: - DebuggerEvaluationRequest() = default; - -private: - size_t callFrameId_ {0}; - const std::string *expression_ {nullptr}; - bool silent_ {false}; - bool returnByValue_ {false}; - bool generatePreview_ {false}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_DEBUGGER_EVALUATION_REQUEST_H diff --git a/tooling/static/types/evaluation_result.h b/tooling/static/types/evaluation_result.h deleted file mode 100644 index 08f79ad5..00000000 --- a/tooling/static/types/evaluation_result.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_EVALUATION_RESULT_H -#define PANDA_TOOLING_INSPECTOR_TYPES_EVALUATION_RESULT_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include "macros.h" -#include "utils/json_builder.h" - -#include "types/exception_details.h" -#include "types/remote_object.h" - -namespace ark::tooling::inspector { - -class EvaluationResult : public JsonSerializable { -public: - explicit EvaluationResult(RemoteObject &&res, std::optional &&exc) - : result_(std::move(res)), exceptionDetails_(std::move(exc)) // NOLINT(bugprone-throw-keyword-missing) - { - } - - DEFAULT_COPY_SEMANTIC(EvaluationResult); - DEFAULT_MOVE_SEMANTIC(EvaluationResult); - - ~EvaluationResult() override = default; - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("result", result_); - if (exceptionDetails_) { - builder.AddProperty("exceptionDetails", *exceptionDetails_); - } - } - -private: - RemoteObject result_; - std::optional exceptionDetails_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_EVALUATION_RESULT_H diff --git a/tooling/static/types/exception_details.cpp b/tooling/static/types/exception_details.cpp deleted file mode 100644 index ab414615..00000000 --- a/tooling/static/types/exception_details.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/exception_details.h" - -#include "utils/json_builder.h" - -namespace ark::tooling::inspector { - -void ExceptionDetails::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("exceptionId", exceptionId_); - builder.AddProperty("text", text_); - builder.AddProperty("lineNumber", lineNumber_); - builder.AddProperty("columnNumber", columnNumber_); - - if (scriptId_) { - builder.AddProperty("scriptId", *scriptId_); - } - if (url_) { - builder.AddProperty("url", *url_); - } - if (exception_) { - builder.AddProperty("exception", *exception_); - } - if (executionContextId_) { - builder.AddProperty("executionContextId", *executionContextId_); - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/exception_details.h b/tooling/static/types/exception_details.h deleted file mode 100644 index 935890b1..00000000 --- a/tooling/static/types/exception_details.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PANDA_TOOLING_INSPECTOR_EXCEPTION_DETAILS_H -#define PANDA_TOOLING_INSPECTOR_EXCEPTION_DETAILS_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include -#include - -#include "macros.h" -#include "types/numeric_id.h" -#include "types/remote_object.h" - -namespace ark { -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { -class ExceptionDetails final : public JsonSerializable { -public: - ExceptionDetails(size_t exceptionId, std::string text, size_t lineNumber, size_t columnNumber) - : exceptionId_(exceptionId), text_(std::move(text)), lineNumber_(lineNumber), columnNumber_(columnNumber) - { - } - - void Serialize(JsonObjectBuilder &builder) const override; - - size_t GetExceptionId() const - { - return exceptionId_; - } - - const std::string &GetText() const - { - return text_; - } - - size_t GetLine() const - { - return lineNumber_; - } - - size_t GetColumn() const - { - return columnNumber_; - } - - ScriptId GetScriptId() const - { - return scriptId_.value_or(0); - } - - ExceptionDetails &SetScriptId(ScriptId scriptId) - { - scriptId_ = scriptId; - return *this; - } - - bool HasScriptId() const - { - return scriptId_.has_value(); - } - - const std::string &GetUrl() const - { - ASSERT(HasUrl()); - return url_.value(); - } - - ExceptionDetails &SetUrl(std::string_view url) - { - url_ = url; - return *this; - } - - bool HasUrl() const - { - return url_.has_value(); - } - - const std::optional &GetExceptionObject() const - { - return exception_; - } - - ExceptionDetails &SetExceptionObject(RemoteObject &&exception) - { - exception_ = std::move(exception); - return *this; - } - - bool HasExceptionObject() const - { - return exception_.has_value(); - } - - ExecutionContextId GetExecutionContextId() const - { - return executionContextId_.value_or(-1); - } - - ExceptionDetails &SetExecutionContextId(ExecutionContextId executionContextId) - { - executionContextId_ = executionContextId; - return *this; - } - - bool HasExecutionContextId() const - { - return executionContextId_.has_value(); - } - -private: - size_t exceptionId_ {0}; - std::string text_; - size_t lineNumber_ {0}; - size_t columnNumber_ {0}; - std::optional scriptId_; - std::optional url_; - std::optional exception_; - std::optional executionContextId_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_EXCEPTION_DETAILS_H diff --git a/tooling/static/types/location.cpp b/tooling/static/types/location.cpp deleted file mode 100644 index 3f6fbde9..00000000 --- a/tooling/static/types/location.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/location.h" - -#include -#include -#include - -#include "utils/expected.h" -#include "utils/json_builder.h" -#include "utils/json_parser.h" - -#include "types/numeric_id.h" - -using namespace std::literals::string_literals; // NOLINT(google-build-using-namespace) - -namespace ark::tooling::inspector { -Expected Location::FromJsonProperty(const JsonObject &object, const char *propertyName) -{ - auto property = object.GetValue(propertyName); - if (property == nullptr) { - return Unexpected("No such property: "s + propertyName); - } - - auto scriptId = ParseNumericId(**property, "scriptId"); - if (!scriptId) { - return Unexpected(scriptId.Error()); - } - - auto optLineNumber = ParseSizeProperty(**property, "lineNumber"); - if (!optLineNumber) { - return Unexpected(optLineNumber.Error()); - } - - return Location(*scriptId, optLineNumber.Value() + 1); -} - -void Location::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("scriptId", std::to_string(scriptId_)); - builder.AddProperty("lineNumber", lineNumber_ - 1); - if (columnNumber_) { - builder.AddProperty("columnNumber", *columnNumber_); - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/location.h b/tooling/static/types/location.h deleted file mode 100644 index ff73eeac..00000000 --- a/tooling/static/types/location.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_LOCATION_H -#define PANDA_TOOLING_INSPECTOR_TYPES_LOCATION_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include -#include -#include - -#include "utils/expected.h" - -#include "types/numeric_id.h" - -namespace ark { -class JsonObject; -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { -class Location final : public JsonSerializable { -public: - Location(ScriptId scriptId, size_t lineNumber, std::optional columnNumber = {}) - : scriptId_(scriptId), lineNumber_(lineNumber), columnNumber_(columnNumber) - { - } - - static Expected FromJsonProperty(const JsonObject &object, const char *propertyName); - - ScriptId GetScriptId() const - { - return scriptId_; - } - - size_t GetLineNumber() const - { - return lineNumber_; - } - - void SetLineNumber(size_t lineNumber) - { - lineNumber_ = lineNumber; - } - - std::optional GetColumnNumber() const - { - return columnNumber_; - } - - void SetColumnNumber(size_t columnNumber) - { - columnNumber_ = columnNumber; - } - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - ScriptId scriptId_; - size_t lineNumber_; - std::optional columnNumber_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_LOCATION_H diff --git a/tooling/static/types/numeric_id.h b/tooling/static/types/numeric_id.h deleted file mode 100644 index 53f5c5f5..00000000 --- a/tooling/static/types/numeric_id.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_NUMERIC_ID_H -#define PANDA_TOOLING_INSPECTOR_TYPES_NUMERIC_ID_H - -#include -#include -#include -#include -#include -#include -#include - -#include "utils/expected.h" -#include "utils/json_parser.h" -#include "utils/string_helpers.h" - -namespace ark::tooling::inspector { -using BreakpointId = size_t; -using CallFrameId = std::string; -using ExecutionContextId = uint32_t; -using FrameId = uint32_t; -using RemoteObjectId = size_t; -using ScriptId = size_t; - -template >> -Expected ParseNumericId(const JsonObject &object, std::string_view propertyName) -{ - auto property = object.GetValue(propertyName.data()); - if (!property) { - return Unexpected("No such property: " + std::string(propertyName)); - } - - intmax_t value; - if (!helpers::string::ParseInt(*property, &value, INTMAX_C(0)) || value < 0 || - std::numeric_limits::max() < static_cast(value)) { - return Unexpected("Invalid id: " + *property); - } - - return static_cast(value); -} - -inline Expected ParseSizeProperty(const JsonObject &object, std::string_view propertyName) -{ - auto value = object.GetValue(propertyName.data()); - if (value == nullptr) { - return Unexpected("No '" + std::string(propertyName) + "' property"); - } - auto valueTrunc = std::trunc(*value); - if (*value < 0 || *value - valueTrunc > valueTrunc * DBL_EPSILON) { - return Unexpected("Invalid line number: " + std::to_string(*value)); - } - return valueTrunc; -} -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_NUMERIC_ID_H diff --git a/tooling/static/types/object_preview.cpp b/tooling/static/types/object_preview.cpp deleted file mode 100644 index 2bcdda94..00000000 --- a/tooling/static/types/object_preview.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "tooling/inspector/types/object_preview.h" -#include "tooling/inspector/types/property_descriptor.h" - -#include "utils/string_helpers.h" - -namespace ark::tooling::inspector { - -// Number of maximum count of properties that can be previewed. -static constexpr size_t PROPERTIES_NMB_LIMIT = 10; - -namespace { -std::optional GetPropertyPreviewValue(const RemoteObjectType::TypeValue &remobjValue) -{ - std::optional propPreviewValue; - - if (std::holds_alternative(remobjValue)) { - propPreviewValue.emplace("null"); - } else if (auto boolean = std::get_if(&remobjValue)) { - propPreviewValue.emplace(*boolean ? "true" : "false"); - } else if (auto number = std::get_if(&remobjValue)) { - if (auto integer = std::get_if(number)) { - propPreviewValue.emplace(std::to_string(*integer)); - } else if (auto floatingPoint = std::get_if(number)) { - propPreviewValue.emplace( - ark::helpers::string::Format("%g", *floatingPoint)); // NOLINT(cppcoreguidelines-pro-type-vararg) - } else { - UNREACHABLE(); - } - } else if (auto bigint = std::get_if(&remobjValue)) { - propPreviewValue.emplace(RemoteObject::GetDescription(*bigint)); - } else if (auto string = std::get_if(&remobjValue)) { - propPreviewValue.emplace(*string); - } else if (auto symbol = std::get_if(&remobjValue)) { - propPreviewValue.emplace(symbol->description); - } else if (auto object = std::get_if(&remobjValue)) { - propPreviewValue.emplace(RemoteObject::GetDescription(*object)); - } else if (auto array = std::get_if(&remobjValue)) { - propPreviewValue.emplace(RemoteObject::GetDescription(*array)); - } else if (auto function = std::get_if(&remobjValue)) { - propPreviewValue.emplace(function->name); - } - - return propPreviewValue; -} -} // namespace - -ObjectPreview::ObjectPreview(RemoteObjectType type, const std::vector &properties) - : type_(std::move(type)) -{ - overflow_ = (properties.size() > PROPERTIES_NMB_LIMIT); - - auto start = properties.begin(); - auto end = start + std::min(properties.size(), PROPERTIES_NMB_LIMIT); - - for (auto propertyIt = start; propertyIt != end; ++propertyIt) { - if (!propertyIt->IsEnumerable()) { - continue; - } - - if (propertyIt->IsAccessor()) { - properties_.emplace_back(propertyIt->GetName(), RemoteObjectType::Accessor()); - continue; - } - - auto propPreviewValue = GetPropertyPreviewValue(propertyIt->GetValue().GetValue()); - - properties_.emplace_back(propertyIt->GetName(), propertyIt->GetValue().GetType(), std::move(*propPreviewValue)); - } -} - -void ObjectPreview::Serialize(JsonObjectBuilder &builder) const -{ - type_.Serialize(builder); - builder.AddProperty("overflow", overflow_); - - builder.AddProperty("properties", [&](JsonArrayBuilder &propertiesBuilder) { - for (auto &propertyPreview : properties_) { - propertiesBuilder.Add(propertyPreview); - } - }); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/object_preview.h b/tooling/static/types/object_preview.h deleted file mode 100644 index 97b6042d..00000000 --- a/tooling/static/types/object_preview.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_OBJECT_PREVIEW_H -#define PANDA_TOOLING_INSPECTOR_TYPES_OBJECT_PREVIEW_H - -#include "types/remote_object_type.h" -#include "types/property_preview.h" - -namespace ark::tooling::inspector { - -class PropertyDescriptor; - -class ObjectPreview final : public JsonSerializable { -public: - ObjectPreview(RemoteObjectType type, const std::vector &properties); - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - RemoteObjectType type_; - - bool overflow_ {false}; - - std::vector properties_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_OBJECT_PREVIEW_H diff --git a/tooling/static/types/pause_on_exceptions_state.h b/tooling/static/types/pause_on_exceptions_state.h deleted file mode 100644 index e21f960e..00000000 --- a/tooling/static/types/pause_on_exceptions_state.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_PAUSE_ON_EXCEPTIONS_STATE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_PAUSE_ON_EXCEPTIONS_STATE_H - -namespace ark::tooling::inspector { -enum class PauseOnExceptionsState { NONE = 0x0, CAUGHT = 0x1, UNCAUGHT = 0x2, ALL = 0x3 }; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_PAUSE_ON_EXCEPTIONS_STATE_H diff --git a/tooling/static/types/possible_breakpoints_response.h b/tooling/static/types/possible_breakpoints_response.h deleted file mode 100644 index 0a657ecc..00000000 --- a/tooling/static/types/possible_breakpoints_response.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_POSSIBLE_BREAKPOINTS_RESPONSE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_POSSIBLE_BREAKPOINTS_RESPONSE_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include "utils/json_builder.h" - -#include "types/location.h" - -namespace ark::tooling::inspector { - -class PossibleBreakpointsResponse final : public JsonSerializable { -public: - void Add(const Location &loc) - { - locations_.emplace_back(loc); - } - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("locations", [this](JsonArrayBuilder &arrayBuilder) { - for (const auto &loc : locations_) { - arrayBuilder.Add(loc); - } - }); - } - -private: - std::vector locations_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_POSSIBLE_BREAKPOINTS_RESPONSE_H diff --git a/tooling/static/types/profile_result.cpp b/tooling/static/types/profile_result.cpp deleted file mode 100644 index c41395bc..00000000 --- a/tooling/static/types/profile_result.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/profile_result.h" - -namespace ark::tooling::inspector { -void Profile::Serialize(JsonObjectBuilder &builder) const -{ - if (!profileInfos_) { - return; - } - builder.AddProperty("profile", - [this](JsonArrayBuilder &arrayBuilder) { this->SerializeProfileInfos(arrayBuilder); }); -} - -void Profile::SerializeProfileInfos(JsonArrayBuilder &arrayBuilder) const -{ - for (const auto &profileInfoPtr : *profileInfos_) { - if (!profileInfoPtr) { - continue; - } - arrayBuilder.Add([this, &profileInfoPtr](JsonObjectBuilder &objBuilder) { - this->SerializeSingleProfileInfo(objBuilder, *profileInfoPtr); - }); - } -} - -void Profile::SerializeSingleProfileInfo(JsonObjectBuilder &builder, const sampler::ProfileInfo &profileInfo) const -{ - // add normal data - builder.AddProperty("tid", profileInfo.tid); - builder.AddProperty("startTime", profileInfo.startTime); - builder.AddProperty("endTime", profileInfo.stopTime); - builder.AddProperty("gcTime", profileInfo.gcTime); - builder.AddProperty("cInterpreterTime", profileInfo.cInterpreterTime); - builder.AddProperty("asmInterpreterTime", profileInfo.asmInterpreterTime); - builder.AddProperty("aotTime", profileInfo.aotTime); - builder.AddProperty("builtinTime", profileInfo.builtinTime); - builder.AddProperty("napiTime", profileInfo.napiTime); - builder.AddProperty("arkuiEngineTime", profileInfo.arkuiEngineTime); - builder.AddProperty("runtimeTime", profileInfo.runtimeTime); - builder.AddProperty("otherTime", profileInfo.otherTime); - - // add nodes array - SerializeNodes(builder, profileInfo); - - // add sample and timeDeltas array - builder.AddProperty("samples", [&profileInfo](JsonArrayBuilder &arrayBuilder) { - for (const auto &child : profileInfo.samples) { - arrayBuilder.Add(child); - } - }); - builder.AddProperty("timeDeltas", [&profileInfo](JsonArrayBuilder &arrayBuilder) { - for (const auto &child : profileInfo.timeDeltas) { - arrayBuilder.Add(child); - } - }); -} -void Profile::SerializeNodes(JsonObjectBuilder &builder, const sampler::ProfileInfo &profileInfo) const -{ - builder.AddProperty("nodes", [this, &profileInfo](JsonArrayBuilder &arrayBuilder) { - for (int i = 0; i < profileInfo.nodeCount; ++i) { - arrayBuilder.Add([this, &profileInfo, i](JsonObjectBuilder &objBuilder) { - objBuilder.AddProperty("id", profileInfo.nodes[i].id); - this->SerializeCallFrame(objBuilder, profileInfo.nodes[i].codeEntry); - objBuilder.AddProperty("hitCount", profileInfo.nodes[i].hitCount); - this->SerializeChildren(objBuilder, profileInfo.nodes[i].children); - }); - } - }); -} - -void Profile::SerializeChildren(JsonObjectBuilder &builder, const std::vector children) const -{ - builder.AddProperty("children", [&children](JsonArrayBuilder &childrenBuilder) { - for (const auto &child : children) { - childrenBuilder.Add(child); - } - }); -} - -void Profile::SerializeCallFrame(JsonObjectBuilder &builder, const struct sampler::FrameInfo &codeEntry) const -{ - builder.AddProperty("callFrame", [&codeEntry](JsonObjectBuilder &objBuilder) { - objBuilder.AddProperty("functionName", codeEntry.functionName); - objBuilder.AddProperty("moduleName", codeEntry.moduleName); - objBuilder.AddProperty("scriptId", codeEntry.scriptId); - objBuilder.AddProperty("url", codeEntry.url); - objBuilder.AddProperty("lineNumber", codeEntry.lineNumber); - objBuilder.AddProperty("columnNumber", codeEntry.columnNumber); - }); -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/profile_result.h b/tooling/static/types/profile_result.h deleted file mode 100644 index f03de7ac..00000000 --- a/tooling/static/types/profile_result.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_PROFILE_RESULT_H -#define PANDA_TOOLING_INSPECTOR_TYPES_PROFILE_RESULT_H - -#include "json_serialization/serializable.h" -#include "runtime/tooling/sampler/samples_record.h" -#include "utils/json_builder.h" - -namespace ark::tooling::inspector { -class Profile final : public JsonSerializable { -public: - explicit Profile(std::unique_ptr>> profileInfos) - : profileInfos_(std::move(profileInfos)) - { - } - void Serialize(JsonObjectBuilder &builder) const override; - -private: - void SerializeProfileInfos(JsonArrayBuilder &arrayBuilder) const; - void SerializeSingleProfileInfo(JsonObjectBuilder &builder, const sampler::ProfileInfo &profileInfo) const; - void SerializeNodes(JsonObjectBuilder &builder, const sampler::ProfileInfo &profileInfo) const; - void SerializeChildren(JsonObjectBuilder &builder, const std::vector children) const; - void SerializeCallFrame(JsonObjectBuilder &builder, const struct sampler::FrameInfo &codeEntry) const; - std::unique_ptr>> profileInfos_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_PROFILE_RESULT_H diff --git a/tooling/static/types/property_descriptor.h b/tooling/static/types/property_descriptor.h deleted file mode 100644 index 325e2100..00000000 --- a/tooling/static/types/property_descriptor.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_DESCRIPTOR_H -#define PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_DESCRIPTOR_H - -#include "macros.h" - -#include "tooling/inspector/types/remote_object.h" -#include "tooling/inspector/json_serialization/serializable.h" - -#include "remote_object.h" - -namespace ark::tooling::inspector { -class PropertyDescriptor final : public JsonSerializable { -public: - PropertyDescriptor(std::string name, RemoteObject value) : name_(std::move(name)), value_(std::move(value)) {} - - static PropertyDescriptor Accessor(std::string name, RemoteObject getter) - { - PropertyDescriptor property(std::move(name), std::move(getter)); - property.isAccessor_ = true; - return property; - } - - bool IsAccessor() const - { - return isAccessor_; - } - - bool IsConfigurable() const - { - return configurable_; - } - - bool IsEnumerable() const - { - return enumerable_; - } - - bool IsWritable() const - { - ASSERT(!IsAccessor()); - return writable_; - } - - const RemoteObject &GetGetter() const - { - ASSERT(IsAccessor()); - return value_; - } - - const std::string &GetName() const - { - return name_; - } - - const std::optional &GetSymbol() const - { - return symbol_; - } - - const RemoteObject &GetValue() const - { - ASSERT(!IsAccessor()); - return value_; - } - - RemoteObject &GetValue() - { - ASSERT(!IsAccessor()); - return value_; - } - - void SetConfigurable(bool configurable) - { - configurable_ = configurable; - } - - void SetEnumerable(bool enumerable) - { - enumerable_ = enumerable; - } - - void SetSymbol(RemoteObject symbol) - { - symbol_.emplace(std::move(symbol)); - } - - void SetWritable(bool writable) - { - ASSERT(!IsAccessor()); - writable_ = writable; - } - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("name", name_); - - if (symbol_) { - builder.AddProperty("symbol", *symbol_); - } - - if (isAccessor_) { - builder.AddProperty("get", value_); - } else { - builder.AddProperty("value", value_); - builder.AddProperty("writable", writable_); - } - - builder.AddProperty("configurable", configurable_); - builder.AddProperty("enumerable", enumerable_); - } - -private: - std::string name_; - std::optional symbol_; - RemoteObject value_; - bool isAccessor_ {false}; - bool configurable_ {false}; - bool enumerable_ {true}; - bool writable_ {true}; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_DESCRIPTOR_H diff --git a/tooling/static/types/property_preview.h b/tooling/static/types/property_preview.h deleted file mode 100644 index 29a6b651..00000000 --- a/tooling/static/types/property_preview.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_PREVIEW_H -#define PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_PREVIEW_H - -#include "tooling/inspector/types/remote_object_type.h" -#include "tooling/inspector/json_serialization/serializable.h" - -#include -#include - -namespace ark::tooling::inspector { - -class PropertyPreview final : public JsonSerializable { -public: - PropertyPreview(std::string name, RemoteObjectType type) : name_(std::move(name)), type_(std::move(type)) {} - - PropertyPreview(std::string name, RemoteObjectType type, const std::string &value) - : PropertyPreview(std::move(name), std::move(type)) - { - value_ = value; - } - - void Serialize(JsonObjectBuilder &builder) const override - { - type_.Serialize(builder); - builder.AddProperty("name", name_); - - if (value_) { - builder.AddProperty("value", *value_); - } - } - -private: - std::string name_; - RemoteObjectType type_; - std::optional value_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_PROPERTY_PREVIEW_H diff --git a/tooling/static/types/remote_object.cpp b/tooling/static/types/remote_object.cpp deleted file mode 100644 index 508e4dc9..00000000 --- a/tooling/static/types/remote_object.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/remote_object.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libpandafile/helpers.h" -#include "macros.h" -#include "utils/json_builder.h" - -#include "types/object_preview.h" -#include "types/property_descriptor.h" - -namespace ark::tooling::inspector { - -std::string RemoteObject::GetDescription(const RemoteObjectType::BigIntT &bigint) -{ - return (bigint.sign >= 0 ? "" : "-") + std::to_string(bigint.value); -} - -std::string RemoteObject::GetDescription(const RemoteObjectType::ObjectT &object) -{ - return object.description.value_or(object.className); -} - -std::string RemoteObject::GetDescription(const RemoteObjectType::ArrayT &array) -{ - return array.className + "(" + std::to_string(array.length) + ")"; -} - -std::string RemoteObject::GetDescription(const RemoteObjectType::FunctionT &function) -{ - std::stringstream desc; - - desc << "function " << function.name << "("; - - for (auto argIdx = 0U; argIdx < function.length; ++argIdx) { - if (argIdx != 0) { - desc << ", "; - } - desc << static_cast('a' + argIdx); - } - - desc << ") { [not available] }"; - - return desc.str(); -} - -std::optional RemoteObject::GetObjectId() const -{ - if (auto object = std::get_if(&value_)) { - return object->objectId; - } - if (auto array = std::get_if(&value_)) { - return array->objectId; - } - if (auto function = std::get_if(&value_)) { - return function->objectId; - } - return {}; -} - -RemoteObjectType RemoteObject::GetType() const -{ - if (std::holds_alternative(value_)) { - return RemoteObjectType("undefined"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("object", "null"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("boolean"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("number"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("bigint"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("string"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("symbol"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("object"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("object", "array"); - } - if (std::holds_alternative(value_)) { - return RemoteObjectType("function"); - } - - UNREACHABLE(); -} - -void RemoteObject::Serialize(JsonObjectBuilder &builder) const -{ - GetType().Serialize(builder); - - if (std::holds_alternative(value_)) { - builder.AddProperty("value", nullptr); - } else if (auto boolean = std::get_if(&value_)) { - builder.AddProperty("value", *boolean); - } else if (auto number = std::get_if(&value_)) { - if (auto integer = std::get_if(number)) { - builder.AddProperty("value", *integer); - } else if (auto floatingPoint = std::get_if(number)) { - builder.AddProperty("value", *floatingPoint); - } else { - UNREACHABLE(); - } - } else if (auto bigint = std::get_if(&value_)) { - builder.AddProperty("unserializableValue", GetDescription(*bigint)); - } else if (auto string = std::get_if(&value_)) { - builder.AddProperty("value", *string); - } else if (auto symbol = std::get_if(&value_)) { - builder.AddProperty("description", symbol->description); - } else if (auto object = std::get_if(&value_)) { - builder.AddProperty("className", object->className); - builder.AddProperty("description", GetDescription(*object)); - } else if (auto array = std::get_if(&value_)) { - builder.AddProperty("className", array->className); - builder.AddProperty("description", GetDescription(*array)); - } else if (auto function = std::get_if(&value_)) { - builder.AddProperty("className", function->className); - builder.AddProperty("description", GetDescription(*function)); - } - - if (auto objectId = GetObjectId()) { - builder.AddProperty("objectId", std::to_string(*objectId)); - } - - if (preview_.has_value()) { - builder.AddProperty("preview", *preview_); - } -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/remote_object.h b/tooling/static/types/remote_object.h deleted file mode 100644 index 13583444..00000000 --- a/tooling/static/types/remote_object.h +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_H -#define PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "types/numeric_id.h" -#include "types/remote_object_type.h" -#include "types/object_preview.h" - -namespace ark { -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { - -class RemoteObject final : public JsonSerializable { -public: - static RemoteObject Undefined() - { - return RemoteObject(); - } - - static RemoteObject Null() - { - return RemoteObject(nullptr); - } - - static RemoteObject Boolean(bool boolean) - { - return RemoteObject(boolean); - } - - static RemoteObject Number(int32_t number) - { - return RemoteObject(RemoteObjectType::NumberT {number}); - } - - template , int> = 0> - static RemoteObject Number(T number) - { - return RemoteObject(RemoteObjectType::NumberT {number}); - } - - template && std::is_signed_v && sizeof(int32_t) < sizeof(T), int> = 0> - static RemoteObject Number(T number) - { - if (INT32_MIN <= number && number <= INT32_MAX) { - return RemoteObject(RemoteObjectType::NumberT {static_cast(number)}); - } - if (number < 0) { - return RemoteObject(RemoteObjectType::BigIntT {-1, -static_cast(number)}); - } - return RemoteObject(RemoteObjectType::BigIntT {1, static_cast(number)}); - } - - template && sizeof(int32_t) <= sizeof(T), int> = 0> - static RemoteObject Number(T number) - { - if (number <= INT32_MAX) { - return RemoteObject(RemoteObjectType::NumberT {static_cast(number)}); - } - return RemoteObject(RemoteObjectType::BigIntT {1, number}); - } - - static RemoteObject String(std::string string) - { - return RemoteObject(std::move(string)); - } - - static RemoteObject Symbol(std::string description) - { - return RemoteObject(RemoteObjectType::SymbolT {std::move(description)}); - } - - static RemoteObject Object(std::string className, std::optional objectId = std::nullopt, - std::optional description = std::nullopt) - { - return RemoteObject(RemoteObjectType::ObjectT {std::move(className), objectId, std::move(description)}); - } - - static RemoteObject Array(std::string className, size_t length, - std::optional objectId = std::nullopt) - { - return RemoteObject(RemoteObjectType::ArrayT {std::move(className), objectId, length}); - } - - static RemoteObject Function(std::string className, std::string name, size_t length, - std::optional objectId = std::nullopt) - { - return RemoteObject(RemoteObjectType::FunctionT {std::move(className), objectId, std::move(name), length}); - } - - std::optional GetObjectId() const; - - void Serialize(JsonObjectBuilder &builder) const override; - - RemoteObjectType GetType() const; - - void SetObjectPreview(ObjectPreview preview) - { - preview_ = std::move(preview); - } - - RemoteObjectType::TypeValue &GetValue() - { - return value_; - } - - const RemoteObjectType::TypeValue &GetValue() const - { - return value_; - } - - static std::string GetDescription(const RemoteObjectType::BigIntT &bigint); - static std::string GetDescription(const RemoteObjectType::ObjectT &object); - static std::string GetDescription(const RemoteObjectType::ArrayT &array); - static std::string GetDescription(const RemoteObjectType::FunctionT &function); - -private: - template - explicit RemoteObject(T &&...value) : value_(std::forward(value)...) - { - } - -private: - RemoteObjectType::TypeValue value_; - - std::optional preview_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_H diff --git a/tooling/static/types/remote_object_type.h b/tooling/static/types/remote_object_type.h deleted file mode 100644 index 84be7c87..00000000 --- a/tooling/static/types/remote_object_type.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_TYPE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_TYPE_H - -#include "utils/json_builder.h" -#include "tooling/inspector/types/numeric_id.h" -#include "tooling/inspector/json_serialization/serializable.h" - -#include -#include - -namespace ark::tooling::inspector { - -class RemoteObjectType final : public JsonSerializable { -public: - using NumberT = std::variant; - - struct BigIntT { - int8_t sign; - uintmax_t value; - }; - - struct SymbolT { - std::string description; - }; - - struct ObjectT { - std::string className; - std::optional objectId; - std::optional description; - }; - - struct ArrayT { - std::string className; - std::optional objectId; - size_t length; - }; - - struct FunctionT { - std::string className; - std::optional objectId; - std::string name; - size_t length; - }; - - using TypeValue = std::variant; - -public: - explicit RemoteObjectType(const char *type, const char *subtype = nullptr) : type_(type), subtype_(subtype) {} - - static RemoteObjectType Accessor() - { - return RemoteObjectType("accessor"); - } - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("type", type_); - - if (subtype_ != nullptr) { - builder.AddProperty("subtype", subtype_); - } - } - -private: - const char *type_ {nullptr}; - const char *subtype_ {nullptr}; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_REMOTE_OBJECT_TYPE_H diff --git a/tooling/static/types/scope.cpp b/tooling/static/types/scope.cpp deleted file mode 100644 index 200baf93..00000000 --- a/tooling/static/types/scope.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/scope.h" - -#include "libpandabase/utils/json_builder.h" - -namespace ark::tooling::inspector { -static const char *GetTypeString(Scope::Type type) -{ - switch (type) { - case Scope::Type::GLOBAL: - return "global"; - case Scope::Type::LOCAL: - return "local"; - default: - UNREACHABLE(); - return nullptr; - } -} - -Scope::Scope(Scope::Type type, RemoteObject object, std::optional name) - : type_(type), object_(std::move(object)), name_(std::move(name)) -{ -} - -void Scope::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("type", GetTypeString(type_)); - builder.AddProperty("object", object_); - if (name_) { - builder.AddProperty("name", *name_); - } -} -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/scope.h b/tooling/static/types/scope.h deleted file mode 100644 index 6800d258..00000000 --- a/tooling/static/types/scope.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_SCOPE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_SCOPE_H - -#include "runtime/tooling/inspector/types/remote_object.h" -#include "runtime/tooling/inspector/json_serialization/serializable.h" - -#include -#include - -namespace ark { -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { -class Scope final : public JsonSerializable { -public: - enum class Type { GLOBAL, LOCAL }; - - Scope(Type type, RemoteObject object, std::optional name = {}); - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - Type type_; - RemoteObject object_; - std::optional name_; -}; -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_SCOPE_H diff --git a/tooling/static/types/script_source_response.h b/tooling/static/types/script_source_response.h deleted file mode 100644 index 27f50086..00000000 --- a/tooling/static/types/script_source_response.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_SCRIPT_SOURCE_RESPONSE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_SCRIPT_SOURCE_RESPONSE_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include "macros.h" -#include "utils/json_builder.h" - -namespace ark::tooling::inspector { - -class ScriptSourceResponse final : public JsonSerializable { -public: - explicit ScriptSourceResponse(std::string_view source) : scriptSource_(source) {} - explicit ScriptSourceResponse(std::string &&source) : scriptSource_(std::move(source)) {} - - DEFAULT_COPY_SEMANTIC(ScriptSourceResponse); - DEFAULT_MOVE_SEMANTIC(ScriptSourceResponse); - - ~ScriptSourceResponse() override = default; - - void Serialize(JsonObjectBuilder &builder) const override - { - builder.AddProperty("scriptSource", scriptSource_); - } - -private: - std::string scriptSource_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_SCRIPT_SOURCE_RESPONSE_H diff --git a/tooling/static/types/url_breakpoint_request.cpp b/tooling/static/types/url_breakpoint_request.cpp deleted file mode 100644 index 1f147984..00000000 --- a/tooling/static/types/url_breakpoint_request.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/url_breakpoint_request.h" - -#include -#include - -#include "utils/json_parser.h" - -#include "types/numeric_id.h" - -namespace ark::tooling::inspector { - -Expected UrlBreakpointRequest::FromJson(const JsonObject &object) -{ - UrlBreakpointRequest parsed; - - auto optLineNumber = ParseSizeProperty(object, "lineNumber"); - if (!optLineNumber) { - return Unexpected(optLineNumber.Error()); - } - parsed.lineNumber_ = optLineNumber.Value() + 1; - - if (auto url = object.GetValue("url")) { - parsed.url_ = *url; - } else if (auto urlRegex = object.GetValue("urlRegex")) { - parsed.urlRegex_ = *urlRegex; - } else { - return Unexpected(std::string("Either 'url' or 'urlRegex' must be specified")); - } - - if (auto condition = object.template GetValue("condition")) { - parsed.condition_ = *condition; - } - - return parsed; -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/url_breakpoint_request.h b/tooling/static/types/url_breakpoint_request.h deleted file mode 100644 index 35074ecf..00000000 --- a/tooling/static/types/url_breakpoint_request.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_REQUEST_H -#define PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_REQUEST_H - -#include - -#include "macros.h" -#include "utils/expected.h" - -namespace ark { -class JsonObject; -} // namespace ark - -namespace ark::tooling::inspector { - -/// @brief Request parameters of `Debugger.setBreakpointByUrl` method -class UrlBreakpointRequest final { -public: - static Expected FromJson(const JsonObject &object); - - DEFAULT_COPY_SEMANTIC(UrlBreakpointRequest); - DEFAULT_MOVE_SEMANTIC(UrlBreakpointRequest); - - ~UrlBreakpointRequest() = default; - - size_t GetLineNumber() const - { - return lineNumber_; - } - - const std::optional &GetUrl() const - { - return url_; - } - - const std::optional &GetUrlRegex() const - { - return urlRegex_; - } - - const std::optional &GetCondition() const - { - return condition_; - } - -private: - UrlBreakpointRequest() = default; - -private: - size_t lineNumber_ {0}; - std::optional url_; - std::optional urlRegex_; - std::optional condition_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_REQUEST_H diff --git a/tooling/static/types/url_breakpoint_response.cpp b/tooling/static/types/url_breakpoint_response.cpp deleted file mode 100644 index 56e423cf..00000000 --- a/tooling/static/types/url_breakpoint_response.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "types/url_breakpoint_response.h" - -#include "utils/json_builder.h" - -#include "types/custom_url_breakpoint_response.h" - -namespace ark::tooling::inspector { - -void UrlBreakpointResponse::Serialize(JsonObjectBuilder &builder) const -{ - builder.AddProperty("breakpointId", std::to_string(breakpointId_)); - builder.AddProperty("locations", [this](JsonArrayBuilder &locations) { - for (const auto &loc : locations_) { - locations.Add(loc); - } - }); -} - -CustomUrlBreakpointResponse UrlBreakpointResponse::ToCustomUrlBreakpointResponse() const -{ - ASSERT(!GetLocations().empty()); - const auto &loc = GetLocations()[0]; - CustomUrlBreakpointResponse converted(loc.GetLineNumber()); - return converted.SetColumnNumber(loc.GetColumnNumber()) - .SetScriptId(loc.GetScriptId()) - .SetBreakpointId(GetBreakpointId()); -} - -} // namespace ark::tooling::inspector diff --git a/tooling/static/types/url_breakpoint_response.h b/tooling/static/types/url_breakpoint_response.h deleted file mode 100644 index 8b2358e8..00000000 --- a/tooling/static/types/url_breakpoint_response.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_RESPONSE_H -#define PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_RESPONSE_H - -#include "tooling/inspector/json_serialization/serializable.h" - -#include - -#include "macros.h" - -#include "types/location.h" -#include "types/numeric_id.h" - -namespace ark { -class JsonObject; -class JsonObjectBuilder; -} // namespace ark - -namespace ark::tooling::inspector { - -class CustomUrlBreakpointResponse; - -class UrlBreakpointResponse final : public JsonSerializable { -public: - UrlBreakpointResponse(BreakpointId id, std::vector &&locations) - : breakpointId_(id), locations_(std::move(locations)) - { - } - - explicit UrlBreakpointResponse(BreakpointId id) : breakpointId_(id) {} - - DEFAULT_COPY_SEMANTIC(UrlBreakpointResponse); - DEFAULT_MOVE_SEMANTIC(UrlBreakpointResponse); - - ~UrlBreakpointResponse() override = default; - - BreakpointId GetBreakpointId() const - { - return breakpointId_; - } - - void SetBreakpointId(BreakpointId id) - { - breakpointId_ = id; - } - - const std::vector &GetLocations() const - { - return locations_; - } - - void AddLocation(Location &&loc) - { - locations_.emplace_back(std::move(loc)); - } - - CustomUrlBreakpointResponse ToCustomUrlBreakpointResponse() const; - - void Serialize(JsonObjectBuilder &builder) const override; - -private: - BreakpointId breakpointId_ {0}; - std::vector locations_; -}; - -} // namespace ark::tooling::inspector - -#endif // PANDA_TOOLING_INSPECTOR_TYPES_URL_BREAKPOINT_RESPONSE_H diff --git a/tooling/dynamic/test/BUILD.gn b/tooling/test/BUILD.gn similarity index 96% rename from tooling/dynamic/test/BUILD.gn rename to tooling/test/BUILD.gn index 9e4992d6..1cfca62b 100644 --- a/tooling/dynamic/test/BUILD.gn +++ b/tooling/test/BUILD.gn @@ -14,7 +14,7 @@ import("//arkcompiler/toolchain/test/test_helper.gni") import("$build_root/config/components/ets_frontend/es2abc_config.gni") -module_output_path = "toolchain/toolchain" +module_output_path = "toolchain" config("debug_api_test") { visibility = [ ":*" ] @@ -27,11 +27,12 @@ config("debug_api_test") { include_dirs = [ "$toolchain_root/websocket", + "//arkcompiler/ets_runtime", "../..", ] } -test_js_path = "//arkcompiler/toolchain/tooling/dynamic/test/testcases/js/" +test_js_path = "//arkcompiler/toolchain/tooling/test/testcases/js/" # When new js test file added, pls modify ohos_test.xml in test/resource accordingly. test_js_files = [ @@ -113,7 +114,7 @@ ohos_shared_library("jsdebugtest") { configs = [ ":debug_api_test", - "//arkcompiler/toolchain/tooling/dynamic:ark_ecma_debugger_config", + "//arkcompiler/toolchain/tooling:ark_ecma_debugger_config", ] test_abc_dir = "/data/test/" @@ -301,7 +302,7 @@ host_unittest_action("DebuggerClientTest") { deps = [ ":debugger_client_resource", "..:libark_ecma_debugger_test", - "../client:libark_client_set", + "../client:libark_client", ] # hiviewdfx libraries @@ -348,7 +349,7 @@ host_unittest_action("DebuggerCIntClientTest") { deps = [ ":debugger_client_resource", "..:libark_ecma_debugger_test", - "../client:libark_client_set", + "../client:libark_client", ] # hiviewdfx libraries @@ -377,7 +378,7 @@ group("debugger_entry_resource") { group("debugger_client_resource") { testonly = true - deps = [ "../../../inspector:ark_debugger" ] + deps = [ "../../inspector:ark_debugger" ] foreach(file, test_js_files) { deps += [ ":gen_${file}_abc" ] } diff --git a/tooling/dynamic/test/animation_impl_test.cpp b/tooling/test/animation_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/animation_impl_test.cpp rename to tooling/test/animation_impl_test.cpp diff --git a/tooling/dynamic/test/client_utils/test_actions.h b/tooling/test/client_utils/test_actions.h similarity index 100% rename from tooling/dynamic/test/client_utils/test_actions.h rename to tooling/test/client_utils/test_actions.h diff --git a/tooling/dynamic/test/client_utils/test_list.cpp b/tooling/test/client_utils/test_list.cpp similarity index 60% rename from tooling/dynamic/test/client_utils/test_list.cpp rename to tooling/test/client_utils/test_list.cpp index 3928710e..91d58bd9 100644 --- a/tooling/dynamic/test/client_utils/test_list.cpp +++ b/tooling/test/client_utils/test_list.cpp @@ -13,65 +13,65 @@ * limitations under the License. */ -#include "tooling/dynamic/test/client_utils/test_list.h" +#include "tooling/test/client_utils/test_list.h" -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" // testcase list -#include "tooling/dynamic/test/testcases/js_accelerate_launch_test.h" -#include "tooling/dynamic/test/testcases/js_allocationtrack_loop_test.h" -#include "tooling/dynamic/test/testcases/js_allocationtrack_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_allocationtrack_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_arrow_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_async_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_cannot_hit_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_in_different_branch.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_loop_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_switch_test.h" -#include "tooling/dynamic/test/testcases/js_breakpoint_test.h" -#include "tooling/dynamic/test/testcases/js_closure_scope_test.h" -#include "tooling/dynamic/test/testcases/js_container_test.h" -#include "tooling/dynamic/test/testcases/js_exception_test.h" -#include "tooling/dynamic/test/testcases/js_heapdump_loop_test.h" -#include "tooling/dynamic/test/testcases/js_heapdump_test.h" -#include "tooling/dynamic/test/testcases/js_heapusage_async_test.h" -#include "tooling/dynamic/test/testcases/js_heapusage_loop_test.h" -#include "tooling/dynamic/test/testcases/js_heapusage_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_heapusage_step_test.h" -#include "tooling/dynamic/test/testcases/js_heapusage_test.h" -#include "tooling/dynamic/test/testcases/js_local_variable_scope_test.h" -#include "tooling/dynamic/test/testcases/js_module_variable_test.h" -#include "tooling/dynamic/test/testcases/js_multiple_breakpoint_in_function_test.h" -#include "tooling/dynamic/test/testcases/js_multiple_common_breakpoint_test.h" -#include "tooling/dynamic/test/testcases/js_smart_stepInto_test.h" -#include "tooling/dynamic/test/testcases/js_source_test.h" -#include "tooling/dynamic/test/testcases/js_special_location_breakpoint_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_and_stepout_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_arrow_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_async_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_loop_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_switch_test.h" -#include "tooling/dynamic/test/testcases/js_stepinto_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_arrow_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_async_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_before_function_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_loop_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_switch_test.h" -#include "tooling/dynamic/test/testcases/js_stepout_test.h" -#include "tooling/dynamic/test/testcases/js_stepover_loop_test.h" -#include "tooling/dynamic/test/testcases/js_stepover_recursion_test.h" -#include "tooling/dynamic/test/testcases/js_stepover_switch_test.h" -#include "tooling/dynamic/test/testcases/js_stepover_test.h" -#include "tooling/dynamic/test/testcases/js_tracing_test.h" -#include "tooling/dynamic/test/testcases/js_watch_basic_type_test.h" -#include "tooling/dynamic/test/testcases/js_watch_closure_variable_test.h" -#include "tooling/dynamic/test/testcases/js_watch_other_type_test.h" -#include "tooling/dynamic/test/testcases/js_watch_set_type_test.h" -#include "tooling/dynamic/test/testcases/js_watch_test.h" -#include "tooling/dynamic/test/testcases/js_watch_variable_test.h" +#include "tooling/test/testcases/js_accelerate_launch_test.h" +#include "tooling/test/testcases/js_allocationtrack_loop_test.h" +#include "tooling/test/testcases/js_allocationtrack_recursion_test.h" +#include "tooling/test/testcases/js_allocationtrack_test.h" +#include "tooling/test/testcases/js_breakpoint_arrow_test.h" +#include "tooling/test/testcases/js_breakpoint_async_test.h" +#include "tooling/test/testcases/js_breakpoint_cannot_hit_test.h" +#include "tooling/test/testcases/js_breakpoint_in_different_branch.h" +#include "tooling/test/testcases/js_breakpoint_loop_test.h" +#include "tooling/test/testcases/js_breakpoint_recursion_test.h" +#include "tooling/test/testcases/js_breakpoint_switch_test.h" +#include "tooling/test/testcases/js_breakpoint_test.h" +#include "tooling/test/testcases/js_closure_scope_test.h" +#include "tooling/test/testcases/js_container_test.h" +#include "tooling/test/testcases/js_exception_test.h" +#include "tooling/test/testcases/js_heapdump_loop_test.h" +#include "tooling/test/testcases/js_heapdump_test.h" +#include "tooling/test/testcases/js_heapusage_async_test.h" +#include "tooling/test/testcases/js_heapusage_loop_test.h" +#include "tooling/test/testcases/js_heapusage_recursion_test.h" +#include "tooling/test/testcases/js_heapusage_step_test.h" +#include "tooling/test/testcases/js_heapusage_test.h" +#include "tooling/test/testcases/js_local_variable_scope_test.h" +#include "tooling/test/testcases/js_module_variable_test.h" +#include "tooling/test/testcases/js_multiple_breakpoint_in_function_test.h" +#include "tooling/test/testcases/js_multiple_common_breakpoint_test.h" +#include "tooling/test/testcases/js_smart_stepInto_test.h" +#include "tooling/test/testcases/js_source_test.h" +#include "tooling/test/testcases/js_special_location_breakpoint_test.h" +#include "tooling/test/testcases/js_stepinto_and_stepout_test.h" +#include "tooling/test/testcases/js_stepinto_arrow_test.h" +#include "tooling/test/testcases/js_stepinto_async_test.h" +#include "tooling/test/testcases/js_stepinto_loop_test.h" +#include "tooling/test/testcases/js_stepinto_recursion_test.h" +#include "tooling/test/testcases/js_stepinto_switch_test.h" +#include "tooling/test/testcases/js_stepinto_test.h" +#include "tooling/test/testcases/js_stepout_arrow_test.h" +#include "tooling/test/testcases/js_stepout_async_test.h" +#include "tooling/test/testcases/js_stepout_before_function_test.h" +#include "tooling/test/testcases/js_stepout_loop_test.h" +#include "tooling/test/testcases/js_stepout_recursion_test.h" +#include "tooling/test/testcases/js_stepout_switch_test.h" +#include "tooling/test/testcases/js_stepout_test.h" +#include "tooling/test/testcases/js_stepover_loop_test.h" +#include "tooling/test/testcases/js_stepover_recursion_test.h" +#include "tooling/test/testcases/js_stepover_switch_test.h" +#include "tooling/test/testcases/js_stepover_test.h" +#include "tooling/test/testcases/js_tracing_test.h" +#include "tooling/test/testcases/js_watch_basic_type_test.h" +#include "tooling/test/testcases/js_watch_closure_variable_test.h" +#include "tooling/test/testcases/js_watch_other_type_test.h" +#include "tooling/test/testcases/js_watch_set_type_test.h" +#include "tooling/test/testcases/js_watch_test.h" +#include "tooling/test/testcases/js_watch_variable_test.h" namespace panda::ecmascript::tooling::test { static std::string g_currentTestName = ""; diff --git a/tooling/dynamic/test/client_utils/test_list.h b/tooling/test/client_utils/test_list.h similarity index 100% rename from tooling/dynamic/test/client_utils/test_list.h rename to tooling/test/client_utils/test_list.h diff --git a/tooling/dynamic/test/client_utils/test_util.cpp b/tooling/test/client_utils/test_util.cpp similarity index 96% rename from tooling/dynamic/test/client_utils/test_util.cpp rename to tooling/test/client_utils/test_util.cpp index c39e7f05..3d045c2b 100644 --- a/tooling/dynamic/test/client_utils/test_util.cpp +++ b/tooling/test/client_utils/test_util.cpp @@ -13,12 +13,12 @@ * limitations under the License. */ -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" -#include "tooling/dynamic/client/domain/debugger_client.h" -#include "tooling/dynamic/client/domain/runtime_client.h" -#include "tooling/dynamic/client/utils/cli_command.h" -#include "tooling/dynamic/client/session/session.h" +#include "tooling/client/domain/debugger_client.h" +#include "tooling/client/domain/runtime_client.h" +#include "tooling/client/utils/cli_command.h" +#include "tooling/client/session/session.h" #include "websocket/client/websocket_client.h" #include diff --git a/tooling/dynamic/test/client_utils/test_util.h b/tooling/test/client_utils/test_util.h similarity index 91% rename from tooling/dynamic/test/client_utils/test_util.h rename to tooling/test/client_utils/test_util.h index 7b3fdaf0..5fe22bbe 100644 --- a/tooling/dynamic/test/client_utils/test_util.h +++ b/tooling/test/client_utils/test_util.h @@ -16,11 +16,11 @@ #ifndef ECMASCRIPT_TOOLING_TEST_UTILS_TEST_UTIL_H #define ECMASCRIPT_TOOLING_TEST_UTILS_TEST_UTIL_H -#include "tooling/dynamic/test/client_utils/test_actions.h" +#include "tooling/test/client_utils/test_actions.h" -#include "tooling/dynamic/client/domain/debugger_client.h" -#include "tooling/dynamic/client/domain/runtime_client.h" -#include "tooling/dynamic/client/manager/domain_manager.h" +#include "tooling/client/domain/debugger_client.h" +#include "tooling/client/domain/runtime_client.h" +#include "tooling/client/manager/domain_manager.h" #include "ecmascript/jspandafile/js_pandafile_manager.h" #include "ecmascript/debugger/js_debugger.h" #include "os/mutex.h" diff --git a/tooling/dynamic/test/debugger_cint_client_test.cpp b/tooling/test/debugger_cint_client_test.cpp similarity index 95% rename from tooling/dynamic/test/debugger_cint_client_test.cpp rename to tooling/test/debugger_cint_client_test.cpp index 9c225bb9..c56746cc 100644 --- a/tooling/dynamic/test/debugger_cint_client_test.cpp +++ b/tooling/test/debugger_cint_client_test.cpp @@ -18,8 +18,8 @@ #include "ecmascript/ecma_vm.h" #include "ecmascript/napi/include/jsnapi.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/test/client_utils/test_list.h" -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_list.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { using panda::test::TestHelper; diff --git a/tooling/dynamic/test/debugger_cinterp_test.cpp b/tooling/test/debugger_cinterp_test.cpp similarity index 97% rename from tooling/dynamic/test/debugger_cinterp_test.cpp rename to tooling/test/debugger_cinterp_test.cpp index 71940889..3e7452fa 100644 --- a/tooling/dynamic/test/debugger_cinterp_test.cpp +++ b/tooling/test/debugger_cinterp_test.cpp @@ -16,7 +16,7 @@ #include "ecmascript/ecma_vm.h" #include "ecmascript/napi/include/jsnapi.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/test/utils/test_list.h" +#include "tooling/test/utils/test_list.h" #include "ecmascript/debugger/js_debugger.h" namespace panda::ecmascript::tooling::test { diff --git a/tooling/dynamic/test/debugger_client_test.cpp b/tooling/test/debugger_client_test.cpp similarity index 95% rename from tooling/dynamic/test/debugger_client_test.cpp rename to tooling/test/debugger_client_test.cpp index d68fd1e9..b4600761 100644 --- a/tooling/dynamic/test/debugger_client_test.cpp +++ b/tooling/test/debugger_client_test.cpp @@ -18,8 +18,8 @@ #include "ecmascript/ecma_vm.h" #include "ecmascript/napi/include/jsnapi.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/test/client_utils/test_list.h" -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_list.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { using panda::test::TestHelper; diff --git a/tooling/dynamic/test/debugger_commands_test.cpp b/tooling/test/debugger_commands_test.cpp similarity index 95% rename from tooling/dynamic/test/debugger_commands_test.cpp rename to tooling/test/debugger_commands_test.cpp index 8464391c..6a9fbdaf 100644 --- a/tooling/dynamic/test/debugger_commands_test.cpp +++ b/tooling/test/debugger_commands_test.cpp @@ -19,8 +19,8 @@ #include "ecmascript/debugger/js_debugger.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/base/pt_params.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_params.h" +#include "tooling/base/pt_returns.h" #include "debugger_service.h" #include "dispatcher.h" diff --git a/tooling/dynamic/test/debugger_entry_test.cpp b/tooling/test/debugger_entry_test.cpp similarity index 97% rename from tooling/dynamic/test/debugger_entry_test.cpp rename to tooling/test/debugger_entry_test.cpp index 8d2ec89e..6710e86a 100644 --- a/tooling/dynamic/test/debugger_entry_test.cpp +++ b/tooling/test/debugger_entry_test.cpp @@ -16,7 +16,7 @@ #include "ecmascript/ecma_vm.h" #include "ecmascript/napi/include/jsnapi.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/test/utils/test_list.h" +#include "tooling/test/utils/test_list.h" #include "ecmascript/debugger/js_debugger.h" namespace panda::ecmascript::tooling::test { diff --git a/tooling/dynamic/test/debugger_events_test.cpp b/tooling/test/debugger_events_test.cpp similarity index 99% rename from tooling/dynamic/test/debugger_events_test.cpp rename to tooling/test/debugger_events_test.cpp index 248a30f1..08a344fe 100644 --- a/tooling/dynamic/test/debugger_events_test.cpp +++ b/tooling/test/debugger_events_test.cpp @@ -17,8 +17,8 @@ #include "ecmascript/js_tagged_value-inl.h" #include "ecmascript/object_factory.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/base/pt_events.h" -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_events.h" +#include "tooling/base/pt_types.h" #include "dispatcher.h" using namespace panda::ecmascript; diff --git a/tooling/dynamic/test/debugger_impl_test.cpp b/tooling/test/debugger_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/debugger_impl_test.cpp rename to tooling/test/debugger_impl_test.cpp diff --git a/tooling/dynamic/test/debugger_params_test.cpp b/tooling/test/debugger_params_test.cpp similarity index 97% rename from tooling/dynamic/test/debugger_params_test.cpp rename to tooling/test/debugger_params_test.cpp index 4a96c9df..f01dcc53 100644 --- a/tooling/dynamic/test/debugger_params_test.cpp +++ b/tooling/test/debugger_params_test.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_types.h" -#include "tooling/dynamic/base/pt_params.h" +#include "tooling/base/pt_types.h" +#include "tooling/base/pt_params.h" #include "dispatcher.h" #include "ecmascript/js_array.h" diff --git a/tooling/dynamic/test/debugger_returns_test.cpp b/tooling/test/debugger_returns_test.cpp similarity index 99% rename from tooling/dynamic/test/debugger_returns_test.cpp rename to tooling/test/debugger_returns_test.cpp index ede1ba87..abe1dfd4 100644 --- a/tooling/dynamic/test/debugger_returns_test.cpp +++ b/tooling/test/debugger_returns_test.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_types.h" -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_types.h" +#include "tooling/base/pt_returns.h" #include "dispatcher.h" #include "ecmascript/js_array.h" diff --git a/tooling/dynamic/test/debugger_script_test.cpp b/tooling/test/debugger_script_test.cpp similarity index 96% rename from tooling/dynamic/test/debugger_script_test.cpp rename to tooling/test/debugger_script_test.cpp index 0251ff2b..38562947 100644 --- a/tooling/dynamic/test/debugger_script_test.cpp +++ b/tooling/test/debugger_script_test.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_params.h" -#include "tooling/dynamic/base/pt_returns.h" -#include "tooling/dynamic/base/pt_script.h" +#include "tooling/base/pt_params.h" +#include "tooling/base/pt_returns.h" +#include "tooling/base/pt_script.h" #include "debugger_service.h" #include "dispatcher.h" diff --git a/tooling/dynamic/test/debugger_service_test.cpp b/tooling/test/debugger_service_test.cpp similarity index 100% rename from tooling/dynamic/test/debugger_service_test.cpp rename to tooling/test/debugger_service_test.cpp diff --git a/tooling/dynamic/test/debugger_types_test.cpp b/tooling/test/debugger_types_test.cpp similarity index 99% rename from tooling/dynamic/test/debugger_types_test.cpp rename to tooling/test/debugger_types_test.cpp index 2d5d21f3..ea33eba4 100644 --- a/tooling/dynamic/test/debugger_types_test.cpp +++ b/tooling/test/debugger_types_test.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" #include "dispatcher.h" #include "ecmascript/js_array.h" diff --git a/tooling/dynamic/test/dispatcher_test.cpp b/tooling/test/dispatcher_test.cpp similarity index 100% rename from tooling/dynamic/test/dispatcher_test.cpp rename to tooling/test/dispatcher_test.cpp diff --git a/tooling/dynamic/test/dom_impl_test.cpp b/tooling/test/dom_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/dom_impl_test.cpp rename to tooling/test/dom_impl_test.cpp diff --git a/tooling/dynamic/test/entry/test_debugger_entry.cpp b/tooling/test/entry/test_debugger_entry.cpp similarity index 94% rename from tooling/dynamic/test/entry/test_debugger_entry.cpp rename to tooling/test/entry/test_debugger_entry.cpp index 57dad11f..f425a638 100644 --- a/tooling/dynamic/test/entry/test_debugger_entry.cpp +++ b/tooling/test/entry/test_debugger_entry.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/test/utils/test_entry.h" +#include "tooling/test/utils/test_entry.h" namespace panda::ecmascript::tooling::test { extern "C" bool StartDebug(const std::string &name, EcmaVM *vm, bool isDebugMode) diff --git a/tooling/dynamic/test/heapprofiler_impl_test.cpp b/tooling/test/heapprofiler_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/heapprofiler_impl_test.cpp rename to tooling/test/heapprofiler_impl_test.cpp diff --git a/tooling/dynamic/test/js_pt_hooks_test.cpp b/tooling/test/js_pt_hooks_test.cpp similarity index 97% rename from tooling/dynamic/test/js_pt_hooks_test.cpp rename to tooling/test/js_pt_hooks_test.cpp index 34ea1dac..5d261d31 100755 --- a/tooling/dynamic/test/js_pt_hooks_test.cpp +++ b/tooling/test/js_pt_hooks_test.cpp @@ -15,8 +15,8 @@ #include "agent/debugger_impl.h" #include "backend/js_pt_hooks.h" -#include "tooling/dynamic/base/pt_types.h" -#include "tooling/dynamic/base/pt_events.h" +#include "tooling/base/pt_types.h" +#include "tooling/base/pt_events.h" #include "dispatcher.h" #include "ecmascript/debugger/js_debugger.h" diff --git a/tooling/dynamic/test/overlay_impl_test.cpp b/tooling/test/overlay_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/overlay_impl_test.cpp rename to tooling/test/overlay_impl_test.cpp diff --git a/tooling/dynamic/test/page_impl_test.cpp b/tooling/test/page_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/page_impl_test.cpp rename to tooling/test/page_impl_test.cpp diff --git a/tooling/dynamic/test/profiler_impl_test.cpp b/tooling/test/profiler_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/profiler_impl_test.cpp rename to tooling/test/profiler_impl_test.cpp diff --git a/tooling/dynamic/test/protocol_handler_test.cpp b/tooling/test/protocol_handler_test.cpp similarity index 100% rename from tooling/dynamic/test/protocol_handler_test.cpp rename to tooling/test/protocol_handler_test.cpp diff --git a/tooling/dynamic/test/pt_base64_test.cpp b/tooling/test/pt_base64_test.cpp similarity index 99% rename from tooling/dynamic/test/pt_base64_test.cpp rename to tooling/test/pt_base64_test.cpp index dad1bacc..d18c2e6e 100644 --- a/tooling/dynamic/test/pt_base64_test.cpp +++ b/tooling/test/pt_base64_test.cpp @@ -14,7 +14,7 @@ */ #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/base/pt_base64.h" +#include "tooling/base/pt_base64.h" using namespace panda::ecmascript::tooling; diff --git a/tooling/dynamic/test/pt_json_test.cpp b/tooling/test/pt_json_test.cpp similarity index 99% rename from tooling/dynamic/test/pt_json_test.cpp rename to tooling/test/pt_json_test.cpp index ac9fda13..c128aedb 100644 --- a/tooling/dynamic/test/pt_json_test.cpp +++ b/tooling/test/pt_json_test.cpp @@ -14,7 +14,7 @@ */ #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/base/pt_json.h" +#include "tooling/base/pt_json.h" using namespace panda::ecmascript::tooling; diff --git a/tooling/dynamic/test/pt_params_test.cpp b/tooling/test/pt_params_test.cpp similarity index 99% rename from tooling/dynamic/test/pt_params_test.cpp rename to tooling/test/pt_params_test.cpp index 6b991262..414158da 100644 --- a/tooling/dynamic/test/pt_params_test.cpp +++ b/tooling/test/pt_params_test.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_params.h" +#include "tooling/base/pt_params.h" #include "ecmascript/tests/test_helper.h" #include "protocol_handler.h" diff --git a/tooling/dynamic/test/pt_returns_test.cpp b/tooling/test/pt_returns_test.cpp similarity index 99% rename from tooling/dynamic/test/pt_returns_test.cpp rename to tooling/test/pt_returns_test.cpp index 4d26ac0e..017ef1e6 100644 --- a/tooling/dynamic/test/pt_returns_test.cpp +++ b/tooling/test/pt_returns_test.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_returns.h" +#include "tooling/base/pt_returns.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda::ecmascript; using namespace panda::ecmascript::tooling; diff --git a/tooling/dynamic/test/pt_types_test.cpp b/tooling/test/pt_types_test.cpp similarity index 99% rename from tooling/dynamic/test/pt_types_test.cpp rename to tooling/test/pt_types_test.cpp index f472cd82..16373a24 100644 --- a/tooling/dynamic/test/pt_types_test.cpp +++ b/tooling/test/pt_types_test.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "tooling/dynamic/base/pt_types.h" +#include "tooling/base/pt_types.h" #include "ecmascript/tests/test_helper.h" #include "protocol_handler.h" diff --git a/tooling/dynamic/test/runtime_impl_test.cpp b/tooling/test/runtime_impl_test.cpp similarity index 96% rename from tooling/dynamic/test/runtime_impl_test.cpp rename to tooling/test/runtime_impl_test.cpp index a53e5dbf..510e8ab4 100644 --- a/tooling/dynamic/test/runtime_impl_test.cpp +++ b/tooling/test/runtime_impl_test.cpp @@ -15,7 +15,7 @@ #include "agent/runtime_impl.h" #include "ecmascript/tests/test_helper.h" -#include "tooling/dynamic/protocol_handler.h" +#include "tooling/protocol_handler.h" using namespace panda::ecmascript; using namespace panda::ecmascript::tooling; diff --git a/tooling/dynamic/test/target_impl_test.cpp b/tooling/test/target_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/target_impl_test.cpp rename to tooling/test/target_impl_test.cpp diff --git a/tooling/dynamic/test/testcases/js/arrow_func.js b/tooling/test/testcases/js/arrow_func.js similarity index 100% rename from tooling/dynamic/test/testcases/js/arrow_func.js rename to tooling/test/testcases/js/arrow_func.js diff --git a/tooling/dynamic/test/testcases/js/async_func.js b/tooling/test/testcases/js/async_func.js similarity index 100% rename from tooling/dynamic/test/testcases/js/async_func.js rename to tooling/test/testcases/js/async_func.js diff --git a/tooling/dynamic/test/testcases/js/branch.js b/tooling/test/testcases/js/branch.js similarity index 100% rename from tooling/dynamic/test/testcases/js/branch.js rename to tooling/test/testcases/js/branch.js diff --git a/tooling/dynamic/test/testcases/js/closure_scope.js b/tooling/test/testcases/js/closure_scope.js similarity index 100% rename from tooling/dynamic/test/testcases/js/closure_scope.js rename to tooling/test/testcases/js/closure_scope.js diff --git a/tooling/dynamic/test/testcases/js/closure_variable.js b/tooling/test/testcases/js/closure_variable.js similarity index 100% rename from tooling/dynamic/test/testcases/js/closure_variable.js rename to tooling/test/testcases/js/closure_variable.js diff --git a/tooling/dynamic/test/testcases/js/common_func.js b/tooling/test/testcases/js/common_func.js similarity index 100% rename from tooling/dynamic/test/testcases/js/common_func.js rename to tooling/test/testcases/js/common_func.js diff --git a/tooling/dynamic/test/testcases/js/container.js b/tooling/test/testcases/js/container.js similarity index 100% rename from tooling/dynamic/test/testcases/js/container.js rename to tooling/test/testcases/js/container.js diff --git a/tooling/dynamic/test/testcases/js/dropframe.js b/tooling/test/testcases/js/dropframe.js similarity index 100% rename from tooling/dynamic/test/testcases/js/dropframe.js rename to tooling/test/testcases/js/dropframe.js diff --git a/tooling/dynamic/test/testcases/js/exception.js b/tooling/test/testcases/js/exception.js similarity index 100% rename from tooling/dynamic/test/testcases/js/exception.js rename to tooling/test/testcases/js/exception.js diff --git a/tooling/dynamic/test/testcases/js/export_variable_first.js b/tooling/test/testcases/js/export_variable_first.js similarity index 100% rename from tooling/dynamic/test/testcases/js/export_variable_first.js rename to tooling/test/testcases/js/export_variable_first.js diff --git a/tooling/dynamic/test/testcases/js/export_variable_second.js b/tooling/test/testcases/js/export_variable_second.js similarity index 100% rename from tooling/dynamic/test/testcases/js/export_variable_second.js rename to tooling/test/testcases/js/export_variable_second.js diff --git a/tooling/dynamic/test/testcases/js/local_variable_scope.js b/tooling/test/testcases/js/local_variable_scope.js similarity index 100% rename from tooling/dynamic/test/testcases/js/local_variable_scope.js rename to tooling/test/testcases/js/local_variable_scope.js diff --git a/tooling/dynamic/test/testcases/js/module_variable.js b/tooling/test/testcases/js/module_variable.js similarity index 100% rename from tooling/dynamic/test/testcases/js/module_variable.js rename to tooling/test/testcases/js/module_variable.js diff --git a/tooling/dynamic/test/testcases/js/range_error.js b/tooling/test/testcases/js/range_error.js similarity index 100% rename from tooling/dynamic/test/testcases/js/range_error.js rename to tooling/test/testcases/js/range_error.js diff --git a/tooling/dynamic/test/testcases/js/sample.js b/tooling/test/testcases/js/sample.js similarity index 100% rename from tooling/dynamic/test/testcases/js/sample.js rename to tooling/test/testcases/js/sample.js diff --git a/tooling/dynamic/test/testcases/js/smart_stepInto.js b/tooling/test/testcases/js/smart_stepInto.js similarity index 100% rename from tooling/dynamic/test/testcases/js/smart_stepInto.js rename to tooling/test/testcases/js/smart_stepInto.js diff --git a/tooling/dynamic/test/testcases/js/step.js b/tooling/test/testcases/js/step.js similarity index 100% rename from tooling/dynamic/test/testcases/js/step.js rename to tooling/test/testcases/js/step.js diff --git a/tooling/dynamic/test/testcases/js/syntax_exception.js b/tooling/test/testcases/js/syntax_exception.js similarity index 100% rename from tooling/dynamic/test/testcases/js/syntax_exception.js rename to tooling/test/testcases/js/syntax_exception.js diff --git a/tooling/dynamic/test/testcases/js/throw_exception.js b/tooling/test/testcases/js/throw_exception.js similarity index 100% rename from tooling/dynamic/test/testcases/js/throw_exception.js rename to tooling/test/testcases/js/throw_exception.js diff --git a/tooling/dynamic/test/testcases/js/variable_first.js b/tooling/test/testcases/js/variable_first.js similarity index 100% rename from tooling/dynamic/test/testcases/js/variable_first.js rename to tooling/test/testcases/js/variable_first.js diff --git a/tooling/dynamic/test/testcases/js/variable_second.js b/tooling/test/testcases/js/variable_second.js similarity index 100% rename from tooling/dynamic/test/testcases/js/variable_second.js rename to tooling/test/testcases/js/variable_second.js diff --git a/tooling/dynamic/test/testcases/js/watch_variable.js b/tooling/test/testcases/js/watch_variable.js similarity index 100% rename from tooling/dynamic/test/testcases/js/watch_variable.js rename to tooling/test/testcases/js/watch_variable.js diff --git a/tooling/dynamic/test/testcases/js_accelerate_launch_test.h b/tooling/test/testcases/js_accelerate_launch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_accelerate_launch_test.h rename to tooling/test/testcases/js_accelerate_launch_test.h index 2bb890c7..f73f632d 100644 --- a/tooling/dynamic/test/testcases/js_accelerate_launch_test.h +++ b/tooling/test/testcases/js_accelerate_launch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ACCELERATE_LAUNCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ACCELERATE_LAUNCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsAccelerateLaunchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_allocationtrack_loop_test.h b/tooling/test/testcases/js_allocationtrack_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_allocationtrack_loop_test.h rename to tooling/test/testcases/js_allocationtrack_loop_test.h index 7b576ce4..d03802ec 100644 --- a/tooling/dynamic/test/testcases/js_allocationtrack_loop_test.h +++ b/tooling/test/testcases/js_allocationtrack_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsAllocationTrackLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_allocationtrack_recursion_test.h b/tooling/test/testcases/js_allocationtrack_recursion_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_allocationtrack_recursion_test.h rename to tooling/test/testcases/js_allocationtrack_recursion_test.h index 3a123409..7b6c3d8b 100644 --- a/tooling/dynamic/test/testcases/js_allocationtrack_recursion_test.h +++ b/tooling/test/testcases/js_allocationtrack_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsAllocationTrackRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_allocationtrack_test.h b/tooling/test/testcases/js_allocationtrack_test.h similarity index 96% rename from tooling/dynamic/test/testcases/js_allocationtrack_test.h rename to tooling/test/testcases/js_allocationtrack_test.h index 0876ce61..4006309a 100755 --- a/tooling/dynamic/test/testcases/js_allocationtrack_test.h +++ b/tooling/test/testcases/js_allocationtrack_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_ALLOCATIONTRACK_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsAllocationtrackTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_arrow_test.h b/tooling/test/testcases/js_breakpoint_arrow_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_breakpoint_arrow_test.h rename to tooling/test/testcases/js_breakpoint_arrow_test.h index 6d278002..757ec0be 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_arrow_test.h +++ b/tooling/test/testcases/js_breakpoint_arrow_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_ARROW_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_ARROW_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointArrowTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_async_test.h b/tooling/test/testcases/js_breakpoint_async_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_breakpoint_async_test.h rename to tooling/test/testcases/js_breakpoint_async_test.h index e6b2989f..1b033ec1 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_async_test.h +++ b/tooling/test/testcases/js_breakpoint_async_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_ASYNC_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_ASYNC_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointAsyncTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_cannot_hit_test.h b/tooling/test/testcases/js_breakpoint_cannot_hit_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_breakpoint_cannot_hit_test.h rename to tooling/test/testcases/js_breakpoint_cannot_hit_test.h index 54363bf5..6a384b79 100755 --- a/tooling/dynamic/test/testcases/js_breakpoint_cannot_hit_test.h +++ b/tooling/test/testcases/js_breakpoint_cannot_hit_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_CANNOT_HIT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_CANNOT_HIT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointCannotHitTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_in_different_branch.h b/tooling/test/testcases/js_breakpoint_in_different_branch.h similarity index 98% rename from tooling/dynamic/test/testcases/js_breakpoint_in_different_branch.h rename to tooling/test/testcases/js_breakpoint_in_different_branch.h index f632af66..bb3f4c0e 100755 --- a/tooling/dynamic/test/testcases/js_breakpoint_in_different_branch.h +++ b/tooling/test/testcases/js_breakpoint_in_different_branch.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_IN_DIFFERENT_BRANCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_IN_DIFFERENT_BRANCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointInDifferentBranchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_loop_test.h b/tooling/test/testcases/js_breakpoint_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_breakpoint_loop_test.h rename to tooling/test/testcases/js_breakpoint_loop_test.h index bc5b4f2c..03f87e8d 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_loop_test.h +++ b/tooling/test/testcases/js_breakpoint_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_recursion_test.h b/tooling/test/testcases/js_breakpoint_recursion_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_breakpoint_recursion_test.h rename to tooling/test/testcases/js_breakpoint_recursion_test.h index d89b2bea..45c269e5 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_recursion_test.h +++ b/tooling/test/testcases/js_breakpoint_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_switch_test.h b/tooling/test/testcases/js_breakpoint_switch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_breakpoint_switch_test.h rename to tooling/test/testcases/js_breakpoint_switch_test.h index 524ab31d..2fbcfa88 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_switch_test.h +++ b/tooling/test/testcases/js_breakpoint_switch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_SWITCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_SWITCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointSwitchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_breakpoint_test.h b/tooling/test/testcases/js_breakpoint_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_breakpoint_test.h rename to tooling/test/testcases/js_breakpoint_test.h index fbf66dcc..219a6705 100644 --- a/tooling/dynamic/test/testcases/js_breakpoint_test.h +++ b/tooling/test/testcases/js_breakpoint_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_BREAKPOINT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsBreakpointTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_closure_scope_test.h b/tooling/test/testcases/js_closure_scope_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_closure_scope_test.h rename to tooling/test/testcases/js_closure_scope_test.h index fc167040..7ba2706b 100644 --- a/tooling/dynamic/test/testcases/js_closure_scope_test.h +++ b/tooling/test/testcases/js_closure_scope_test.h @@ -17,7 +17,7 @@ #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CLOSURE_SCOPE_TEST_H #include -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsClosureScopeTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_container_test.h b/tooling/test/testcases/js_container_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_container_test.h rename to tooling/test/testcases/js_container_test.h index ec1c971c..4d71bb84 100644 --- a/tooling/dynamic/test/testcases/js_container_test.h +++ b/tooling/test/testcases/js_container_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CONTAINER_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CONTAINER_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsContainerTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_cpuprofile_async_test.h b/tooling/test/testcases/js_cpuprofile_async_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_cpuprofile_async_test.h rename to tooling/test/testcases/js_cpuprofile_async_test.h index 44182c1d..ab05794c 100755 --- a/tooling/dynamic/test/testcases/js_cpuprofile_async_test.h +++ b/tooling/test/testcases/js_cpuprofile_async_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_ASYNC_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_ASYNC_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsCpuprofileAsyncTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_cpuprofile_loop_test.h b/tooling/test/testcases/js_cpuprofile_loop_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_cpuprofile_loop_test.h rename to tooling/test/testcases/js_cpuprofile_loop_test.h index 7daace2f..2cddcdbb 100644 --- a/tooling/dynamic/test/testcases/js_cpuprofile_loop_test.h +++ b/tooling/test/testcases/js_cpuprofile_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsCpuprofileLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_cpuprofile_recursion_test.h b/tooling/test/testcases/js_cpuprofile_recursion_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_cpuprofile_recursion_test.h rename to tooling/test/testcases/js_cpuprofile_recursion_test.h index 3f5c7341..d2cfd3c1 100644 --- a/tooling/dynamic/test/testcases/js_cpuprofile_recursion_test.h +++ b/tooling/test/testcases/js_cpuprofile_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsCpuprofileRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_cpuprofile_step_test.h b/tooling/test/testcases/js_cpuprofile_step_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_cpuprofile_step_test.h rename to tooling/test/testcases/js_cpuprofile_step_test.h index 9eaaa7d1..126ddf82 100755 --- a/tooling/dynamic/test/testcases/js_cpuprofile_step_test.h +++ b/tooling/test/testcases/js_cpuprofile_step_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_STEP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_STEP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsCpuprofileStepTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_cpuprofile_test.h b/tooling/test/testcases/js_cpuprofile_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_cpuprofile_test.h rename to tooling/test/testcases/js_cpuprofile_test.h index 3cb44a17..cf492e1d 100755 --- a/tooling/dynamic/test/testcases/js_cpuprofile_test.h +++ b/tooling/test/testcases/js_cpuprofile_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_CPUPROFILE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsCpuprofileTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_dropframe_test.h b/tooling/test/testcases/js_dropframe_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_dropframe_test.h rename to tooling/test/testcases/js_dropframe_test.h diff --git a/tooling/dynamic/test/testcases/js_exception_test.h b/tooling/test/testcases/js_exception_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_exception_test.h rename to tooling/test/testcases/js_exception_test.h index e314f2ec..ac64be7e 100644 --- a/tooling/dynamic/test/testcases/js_exception_test.h +++ b/tooling/test/testcases/js_exception_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_EXCEPTION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_EXCEPTION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsExceptionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapdump_loop_test.h b/tooling/test/testcases/js_heapdump_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_heapdump_loop_test.h rename to tooling/test/testcases/js_heapdump_loop_test.h index 9bfd1adb..6dc4e2a6 100644 --- a/tooling/dynamic/test/testcases/js_heapdump_loop_test.h +++ b/tooling/test/testcases/js_heapdump_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPDUMP_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPDUMP_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapdumpLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapdump_test.h b/tooling/test/testcases/js_heapdump_test.h similarity index 96% rename from tooling/dynamic/test/testcases/js_heapdump_test.h rename to tooling/test/testcases/js_heapdump_test.h index f9adf936..abfbc0a2 100755 --- a/tooling/dynamic/test/testcases/js_heapdump_test.h +++ b/tooling/test/testcases/js_heapdump_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPDUMP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPDUMP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapdumpTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapprofiler_dump_test.h b/tooling/test/testcases/js_heapprofiler_dump_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapprofiler_dump_test.h rename to tooling/test/testcases/js_heapprofiler_dump_test.h index a9c3d2fb..09331699 100644 --- a/tooling/dynamic/test/testcases/js_heapprofiler_dump_test.h +++ b/tooling/test/testcases/js_heapprofiler_dump_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPPROFILER_DUMP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPPROFILER_DUMP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapProfilerDumpTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapsampling_loop_test.h b/tooling/test/testcases/js_heapsampling_loop_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapsampling_loop_test.h rename to tooling/test/testcases/js_heapsampling_loop_test.h index a37f6c54..3d37e3eb 100644 --- a/tooling/dynamic/test/testcases/js_heapsampling_loop_test.h +++ b/tooling/test/testcases/js_heapsampling_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPSAMPLING_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPSAMPLING_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapSamplingLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapsampling_test.h b/tooling/test/testcases/js_heapsampling_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapsampling_test.h rename to tooling/test/testcases/js_heapsampling_test.h index 054e041b..0ef339af 100644 --- a/tooling/dynamic/test/testcases/js_heapsampling_test.h +++ b/tooling/test/testcases/js_heapsampling_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPSAMPLING_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPSAMPLING_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapsamplingTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapusage_async_test.h b/tooling/test/testcases/js_heapusage_async_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapusage_async_test.h rename to tooling/test/testcases/js_heapusage_async_test.h index 79ddb988..208a6688 100755 --- a/tooling/dynamic/test/testcases/js_heapusage_async_test.h +++ b/tooling/test/testcases/js_heapusage_async_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_ASYNC_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_ASYNC_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapusageAsyncTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapusage_loop_test.h b/tooling/test/testcases/js_heapusage_loop_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapusage_loop_test.h rename to tooling/test/testcases/js_heapusage_loop_test.h index 85ac9415..221df178 100644 --- a/tooling/dynamic/test/testcases/js_heapusage_loop_test.h +++ b/tooling/test/testcases/js_heapusage_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapusageLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapusage_recursion_test.h b/tooling/test/testcases/js_heapusage_recursion_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_heapusage_recursion_test.h rename to tooling/test/testcases/js_heapusage_recursion_test.h index c5e13b9c..7930f49c 100644 --- a/tooling/dynamic/test/testcases/js_heapusage_recursion_test.h +++ b/tooling/test/testcases/js_heapusage_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapusageRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapusage_step_test.h b/tooling/test/testcases/js_heapusage_step_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_heapusage_step_test.h rename to tooling/test/testcases/js_heapusage_step_test.h index e0748d40..698d3e5a 100755 --- a/tooling/dynamic/test/testcases/js_heapusage_step_test.h +++ b/tooling/test/testcases/js_heapusage_step_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_STEP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_STEP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapusageStepTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_heapusage_test.h b/tooling/test/testcases/js_heapusage_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_heapusage_test.h rename to tooling/test/testcases/js_heapusage_test.h index 4a3baa2f..542c9c58 100755 --- a/tooling/dynamic/test/testcases/js_heapusage_test.h +++ b/tooling/test/testcases/js_heapusage_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_HEAPUSAGE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsHeapusageTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_local_variable_scope_test.h b/tooling/test/testcases/js_local_variable_scope_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_local_variable_scope_test.h rename to tooling/test/testcases/js_local_variable_scope_test.h index 943850f0..4f7187be 100644 --- a/tooling/dynamic/test/testcases/js_local_variable_scope_test.h +++ b/tooling/test/testcases/js_local_variable_scope_test.h @@ -17,7 +17,7 @@ #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_LOCAL_VARIABLE_SCOPE_TEST_H #include -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsLocalVariableScopeTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_module_variable_test.h b/tooling/test/testcases/js_module_variable_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_module_variable_test.h rename to tooling/test/testcases/js_module_variable_test.h index 5fe34472..52424f86 100644 --- a/tooling/dynamic/test/testcases/js_module_variable_test.h +++ b/tooling/test/testcases/js_module_variable_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MODULE_VARIABLE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MODULE_VARIABLE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsModuleVariableTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_multiple_breakpoint_in_function_test.h b/tooling/test/testcases/js_multiple_breakpoint_in_function_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_multiple_breakpoint_in_function_test.h rename to tooling/test/testcases/js_multiple_breakpoint_in_function_test.h index 12546ee6..eca5003e 100755 --- a/tooling/dynamic/test/testcases/js_multiple_breakpoint_in_function_test.h +++ b/tooling/test/testcases/js_multiple_breakpoint_in_function_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MULTIPLE_BREAKPOINT_IN_FUNCTION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MULTIPLE_BREAKPOINT_IN_FUNCTION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsMultipleBreakpointInFunctionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_multiple_common_breakpoint_test.h b/tooling/test/testcases/js_multiple_common_breakpoint_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_multiple_common_breakpoint_test.h rename to tooling/test/testcases/js_multiple_common_breakpoint_test.h index 285093c3..0b8e8fba 100755 --- a/tooling/dynamic/test/testcases/js_multiple_common_breakpoint_test.h +++ b/tooling/test/testcases/js_multiple_common_breakpoint_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MULTIPLE_COMMON_BREAKPOINT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_MULTIPLE_COMMON_BREAKPOINT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsMultipleCommonBreakpointTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_range_error_test.h b/tooling/test/testcases/js_range_error_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_range_error_test.h rename to tooling/test/testcases/js_range_error_test.h diff --git a/tooling/dynamic/test/testcases/js_single_step_test.h b/tooling/test/testcases/js_single_step_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_single_step_test.h rename to tooling/test/testcases/js_single_step_test.h diff --git a/tooling/dynamic/test/testcases/js_smart_stepInto_test.h b/tooling/test/testcases/js_smart_stepInto_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_smart_stepInto_test.h rename to tooling/test/testcases/js_smart_stepInto_test.h index 5b9d515d..5616afe9 100644 --- a/tooling/dynamic/test/testcases/js_smart_stepInto_test.h +++ b/tooling/test/testcases/js_smart_stepInto_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SMART_STEPINTO_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SMART_STEPINTO_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsSmartStepoutTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_source_test.h b/tooling/test/testcases/js_source_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_source_test.h rename to tooling/test/testcases/js_source_test.h index 1cc7117d..e02cf9bc 100644 --- a/tooling/dynamic/test/testcases/js_source_test.h +++ b/tooling/test/testcases/js_source_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SOURCE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SOURCE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsSourceTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_special_location_breakpoint_test.h b/tooling/test/testcases/js_special_location_breakpoint_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_special_location_breakpoint_test.h rename to tooling/test/testcases/js_special_location_breakpoint_test.h index 6141800c..373ba198 100755 --- a/tooling/dynamic/test/testcases/js_special_location_breakpoint_test.h +++ b/tooling/test/testcases/js_special_location_breakpoint_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SPECIAL_LOCATION_BREAKPOINT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_SPECIAL_LOCATION_BREAKPOINT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsSpecialLocationBreakpointTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_step_into_test.h b/tooling/test/testcases/js_step_into_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_step_into_test.h rename to tooling/test/testcases/js_step_into_test.h diff --git a/tooling/dynamic/test/testcases/js_step_out_test.h b/tooling/test/testcases/js_step_out_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_step_out_test.h rename to tooling/test/testcases/js_step_out_test.h diff --git a/tooling/dynamic/test/testcases/js_step_over_test.h b/tooling/test/testcases/js_step_over_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_step_over_test.h rename to tooling/test/testcases/js_step_over_test.h diff --git a/tooling/dynamic/test/testcases/js_stepinto_and_stepout_test.h b/tooling/test/testcases/js_stepinto_and_stepout_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_and_stepout_test.h rename to tooling/test/testcases/js_stepinto_and_stepout_test.h index ab8dbbf1..ca3eaf1d 100755 --- a/tooling/dynamic/test/testcases/js_stepinto_and_stepout_test.h +++ b/tooling/test/testcases/js_stepinto_and_stepout_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_AND_STEPOUT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_AND_STEPOUT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoAndStepoutTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_arrow_test.h b/tooling/test/testcases/js_stepinto_arrow_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_arrow_test.h rename to tooling/test/testcases/js_stepinto_arrow_test.h index f8b5dea7..cc813a51 100755 --- a/tooling/dynamic/test/testcases/js_stepinto_arrow_test.h +++ b/tooling/test/testcases/js_stepinto_arrow_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_ARROW_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_ARROW_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoArrowTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_async_test.h b/tooling/test/testcases/js_stepinto_async_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_async_test.h rename to tooling/test/testcases/js_stepinto_async_test.h index 3faccecc..a0a68792 100755 --- a/tooling/dynamic/test/testcases/js_stepinto_async_test.h +++ b/tooling/test/testcases/js_stepinto_async_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_ASYNC_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_ASYNC_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoAsyncTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_loop_test.h b/tooling/test/testcases/js_stepinto_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_loop_test.h rename to tooling/test/testcases/js_stepinto_loop_test.h index 690b8d57..0aff1fb2 100644 --- a/tooling/dynamic/test/testcases/js_stepinto_loop_test.h +++ b/tooling/test/testcases/js_stepinto_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_recursion_test.h b/tooling/test/testcases/js_stepinto_recursion_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_recursion_test.h rename to tooling/test/testcases/js_stepinto_recursion_test.h index c040f792..d3cebe6a 100644 --- a/tooling/dynamic/test/testcases/js_stepinto_recursion_test.h +++ b/tooling/test/testcases/js_stepinto_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_switch_test.h b/tooling/test/testcases/js_stepinto_switch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_switch_test.h rename to tooling/test/testcases/js_stepinto_switch_test.h index 9d78242e..be4f1cf6 100644 --- a/tooling/dynamic/test/testcases/js_stepinto_switch_test.h +++ b/tooling/test/testcases/js_stepinto_switch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_SWITCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_SWITCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoSwitchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepinto_test.h b/tooling/test/testcases/js_stepinto_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepinto_test.h rename to tooling/test/testcases/js_stepinto_test.h index a7955562..a0f1caf4 100755 --- a/tooling/dynamic/test/testcases/js_stepinto_test.h +++ b/tooling/test/testcases/js_stepinto_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPINTO_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepintoTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_arrow_test.h b/tooling/test/testcases/js_stepout_arrow_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_arrow_test.h rename to tooling/test/testcases/js_stepout_arrow_test.h index db36cdeb..f487f896 100755 --- a/tooling/dynamic/test/testcases/js_stepout_arrow_test.h +++ b/tooling/test/testcases/js_stepout_arrow_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_ARROW_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_ARROW_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutArrowTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_async_test.h b/tooling/test/testcases/js_stepout_async_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_async_test.h rename to tooling/test/testcases/js_stepout_async_test.h index 0a8d0787..665435cb 100755 --- a/tooling/dynamic/test/testcases/js_stepout_async_test.h +++ b/tooling/test/testcases/js_stepout_async_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_ASYNC_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_ASYNC_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutAsyncTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_before_function_test.h b/tooling/test/testcases/js_stepout_before_function_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_before_function_test.h rename to tooling/test/testcases/js_stepout_before_function_test.h index c11f48f1..6056cde3 100755 --- a/tooling/dynamic/test/testcases/js_stepout_before_function_test.h +++ b/tooling/test/testcases/js_stepout_before_function_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_BEFORE_FUNCTION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_BEFORE_FUNCTION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutBeforeFunctionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_loop_test.h b/tooling/test/testcases/js_stepout_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_loop_test.h rename to tooling/test/testcases/js_stepout_loop_test.h index 945ee5b6..9953a9cd 100644 --- a/tooling/dynamic/test/testcases/js_stepout_loop_test.h +++ b/tooling/test/testcases/js_stepout_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_recursion_test.h b/tooling/test/testcases/js_stepout_recursion_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_recursion_test.h rename to tooling/test/testcases/js_stepout_recursion_test.h index 47401010..49b77151 100644 --- a/tooling/dynamic/test/testcases/js_stepout_recursion_test.h +++ b/tooling/test/testcases/js_stepout_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_switch_test.h b/tooling/test/testcases/js_stepout_switch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_switch_test.h rename to tooling/test/testcases/js_stepout_switch_test.h index 3f983d8b..98c73583 100644 --- a/tooling/dynamic/test/testcases/js_stepout_switch_test.h +++ b/tooling/test/testcases/js_stepout_switch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_SWITCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_SWITCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutSwitchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepout_test.h b/tooling/test/testcases/js_stepout_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepout_test.h rename to tooling/test/testcases/js_stepout_test.h index f99cbf08..c21d7e2f 100755 --- a/tooling/dynamic/test/testcases/js_stepout_test.h +++ b/tooling/test/testcases/js_stepout_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOUT_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoutTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepover_loop_test.h b/tooling/test/testcases/js_stepover_loop_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepover_loop_test.h rename to tooling/test/testcases/js_stepover_loop_test.h index 36cce6ae..f5bf6006 100644 --- a/tooling/dynamic/test/testcases/js_stepover_loop_test.h +++ b/tooling/test/testcases/js_stepover_loop_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_LOOP_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_LOOP_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoverLoopTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepover_recursion_test.h b/tooling/test/testcases/js_stepover_recursion_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepover_recursion_test.h rename to tooling/test/testcases/js_stepover_recursion_test.h index dfb30211..ace2cd33 100644 --- a/tooling/dynamic/test/testcases/js_stepover_recursion_test.h +++ b/tooling/test/testcases/js_stepover_recursion_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_RECURSION_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_RECURSION_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoverRecursionTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepover_switch_test.h b/tooling/test/testcases/js_stepover_switch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepover_switch_test.h rename to tooling/test/testcases/js_stepover_switch_test.h index 2b77b003..78731100 100644 --- a/tooling/dynamic/test/testcases/js_stepover_switch_test.h +++ b/tooling/test/testcases/js_stepover_switch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_SWITCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_SWITCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoverSwitchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_stepover_test.h b/tooling/test/testcases/js_stepover_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_stepover_test.h rename to tooling/test/testcases/js_stepover_test.h index 95f04b90..a5eaf15e 100755 --- a/tooling/dynamic/test/testcases/js_stepover_test.h +++ b/tooling/test/testcases/js_stepover_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_STEPOVER_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsStepoverTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_syntax_exception_test.h b/tooling/test/testcases/js_syntax_exception_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_syntax_exception_test.h rename to tooling/test/testcases/js_syntax_exception_test.h diff --git a/tooling/dynamic/test/testcases/js_throw_exception_test.h b/tooling/test/testcases/js_throw_exception_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_throw_exception_test.h rename to tooling/test/testcases/js_throw_exception_test.h diff --git a/tooling/dynamic/test/testcases/js_tracing_test.h b/tooling/test/testcases/js_tracing_test.h similarity index 98% rename from tooling/dynamic/test/testcases/js_tracing_test.h rename to tooling/test/testcases/js_tracing_test.h index c2a0ba77..2b21a273 100644 --- a/tooling/dynamic/test/testcases/js_tracing_test.h +++ b/tooling/test/testcases/js_tracing_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_TRACING_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_TRACING_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsTracingTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_variable_first_test.h b/tooling/test/testcases/js_variable_first_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_variable_first_test.h rename to tooling/test/testcases/js_variable_first_test.h diff --git a/tooling/dynamic/test/testcases/js_variable_second_test.h b/tooling/test/testcases/js_variable_second_test.h similarity index 100% rename from tooling/dynamic/test/testcases/js_variable_second_test.h rename to tooling/test/testcases/js_variable_second_test.h diff --git a/tooling/dynamic/test/testcases/js_watch_basic_type_test.h b/tooling/test/testcases/js_watch_basic_type_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_basic_type_test.h rename to tooling/test/testcases/js_watch_basic_type_test.h index ea3a2919..ff453b6c 100644 --- a/tooling/dynamic/test/testcases/js_watch_basic_type_test.h +++ b/tooling/test/testcases/js_watch_basic_type_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_BASIC_TYPE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_BASIC_TYPE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchBasicTypeTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_watch_closure_variable_test.h b/tooling/test/testcases/js_watch_closure_variable_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_closure_variable_test.h rename to tooling/test/testcases/js_watch_closure_variable_test.h index 1d6b7716..56d7e0dc 100644 --- a/tooling/dynamic/test/testcases/js_watch_closure_variable_test.h +++ b/tooling/test/testcases/js_watch_closure_variable_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_CLOSURE_VARIABLE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_CLOSURE_VARIABLE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchClosureVariableTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_watch_other_type_test.h b/tooling/test/testcases/js_watch_other_type_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_other_type_test.h rename to tooling/test/testcases/js_watch_other_type_test.h index dce705c8..0fd734e9 100644 --- a/tooling/dynamic/test/testcases/js_watch_other_type_test.h +++ b/tooling/test/testcases/js_watch_other_type_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_OTHER_TYPE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_OTHER_TYPE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchOtherTypeTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_watch_set_type_test.h b/tooling/test/testcases/js_watch_set_type_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_set_type_test.h rename to tooling/test/testcases/js_watch_set_type_test.h index 01548409..0ca66a21 100644 --- a/tooling/dynamic/test/testcases/js_watch_set_type_test.h +++ b/tooling/test/testcases/js_watch_set_type_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_SET_TYPE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_SET_TYPE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchSetTypeTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_watch_test.h b/tooling/test/testcases/js_watch_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_test.h rename to tooling/test/testcases/js_watch_test.h index d48da689..a5fa7d15 100644 --- a/tooling/dynamic/test/testcases/js_watch_test.h +++ b/tooling/test/testcases/js_watch_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchTest : public TestActions { diff --git a/tooling/dynamic/test/testcases/js_watch_variable_test.h b/tooling/test/testcases/js_watch_variable_test.h similarity index 99% rename from tooling/dynamic/test/testcases/js_watch_variable_test.h rename to tooling/test/testcases/js_watch_variable_test.h index c8a62bdf..61013e4c 100755 --- a/tooling/dynamic/test/testcases/js_watch_variable_test.h +++ b/tooling/test/testcases/js_watch_variable_test.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_VARIABLE_TEST_H #define ECMASCRIPT_TOOLING_TEST_TESTCASES_JS_WATCH_VARIABLE_TEST_H -#include "tooling/dynamic/test/client_utils/test_util.h" +#include "tooling/test/client_utils/test_util.h" namespace panda::ecmascript::tooling::test { class JsWatchVariableTest : public TestActions { diff --git a/tooling/dynamic/test/tracing_impl_test.cpp b/tooling/test/tracing_impl_test.cpp similarity index 100% rename from tooling/dynamic/test/tracing_impl_test.cpp rename to tooling/test/tracing_impl_test.cpp diff --git a/tooling/dynamic/test/utils/test_channel.h b/tooling/test/utils/test_channel.h similarity index 97% rename from tooling/dynamic/test/utils/test_channel.h rename to tooling/test/utils/test_channel.h index 655c4105..e92a1b95 100644 --- a/tooling/dynamic/test/utils/test_channel.h +++ b/tooling/test/utils/test_channel.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_TOOLING_TEST_UTILS_TEST_CHANNEL_H #define ECMASCRIPT_TOOLING_TEST_UTILS_TEST_CHANNEL_H -#include "tooling/dynamic/protocol_channel.h" +#include "tooling/protocol_channel.h" namespace panda::ecmascript::tooling { class TestChannel : public ProtocolChannel { diff --git a/tooling/dynamic/test/utils/test_entry.cpp b/tooling/test/utils/test_entry.cpp similarity index 100% rename from tooling/dynamic/test/utils/test_entry.cpp rename to tooling/test/utils/test_entry.cpp diff --git a/tooling/dynamic/test/utils/test_entry.h b/tooling/test/utils/test_entry.h similarity index 100% rename from tooling/dynamic/test/utils/test_entry.h rename to tooling/test/utils/test_entry.h diff --git a/tooling/dynamic/test/utils/test_events.h b/tooling/test/utils/test_events.h similarity index 100% rename from tooling/dynamic/test/utils/test_events.h rename to tooling/test/utils/test_events.h diff --git a/tooling/dynamic/test/utils/test_extractor.cpp b/tooling/test/utils/test_extractor.cpp similarity index 100% rename from tooling/dynamic/test/utils/test_extractor.cpp rename to tooling/test/utils/test_extractor.cpp diff --git a/tooling/dynamic/test/utils/test_extractor.h b/tooling/test/utils/test_extractor.h similarity index 100% rename from tooling/dynamic/test/utils/test_extractor.h rename to tooling/test/utils/test_extractor.h diff --git a/tooling/dynamic/test/utils/test_hooks.h b/tooling/test/utils/test_hooks.h similarity index 100% rename from tooling/dynamic/test/utils/test_hooks.h rename to tooling/test/utils/test_hooks.h diff --git a/tooling/dynamic/test/utils/test_list.cpp b/tooling/test/utils/test_list.cpp similarity index 100% rename from tooling/dynamic/test/utils/test_list.cpp rename to tooling/test/utils/test_list.cpp diff --git a/tooling/dynamic/test/utils/test_list.h b/tooling/test/utils/test_list.h similarity index 100% rename from tooling/dynamic/test/utils/test_list.h rename to tooling/test/utils/test_list.h diff --git a/tooling/dynamic/test/utils/test_util.cpp b/tooling/test/utils/test_util.cpp similarity index 100% rename from tooling/dynamic/test/utils/test_util.cpp rename to tooling/test/utils/test_util.cpp diff --git a/tooling/dynamic/test/utils/test_util.h b/tooling/test/utils/test_util.h similarity index 100% rename from tooling/dynamic/test/utils/test_util.h rename to tooling/test/utils/test_util.h diff --git a/tooling/dynamic/utils/utils.cpp b/tooling/utils/utils.cpp similarity index 99% rename from tooling/dynamic/utils/utils.cpp rename to tooling/utils/utils.cpp index 88802c42..c49c5117 100644 --- a/tooling/dynamic/utils/utils.cpp +++ b/tooling/utils/utils.cpp @@ -15,7 +15,7 @@ #include #include "common/log_wrapper.h" -#include "tooling/dynamic/utils/utils.h" +#include "tooling/utils/utils.h" namespace OHOS::ArkCompiler::Toolchain { bool Utils::GetCurrentTime(char *date, char *tim, size_t size) diff --git a/tooling/dynamic/utils/utils.h b/tooling/utils/utils.h similarity index 100% rename from tooling/dynamic/utils/utils.h rename to tooling/utils/utils.h diff --git a/websocket/client/websocket_client.h b/websocket/client/websocket_client.h index 8075aa64..ded6a969 100644 --- a/websocket/client/websocket_client.h +++ b/websocket/client/websocket_client.h @@ -16,6 +16,7 @@ #ifndef ARKCOMPILER_TOOLCHAIN_WEBSOCKET_CLIENT_WEBSOCKET_CLIENT_H #define ARKCOMPILER_TOOLCHAIN_WEBSOCKET_CLIENT_WEBSOCKET_CLIENT_H +#include "http.h" #include "websocket_base.h" #include diff --git a/websocket/test/BUILD.gn b/websocket/test/BUILD.gn index 6b58f9b8..a62657d1 100644 --- a/websocket/test/BUILD.gn +++ b/websocket/test/BUILD.gn @@ -14,7 +14,7 @@ import("//arkcompiler/toolchain/test/test_helper.gni") import("//arkcompiler/toolchain/toolchain.gni") -module_output_path = "toolchain/toolchain" +module_output_path = "toolchain" host_unittest_action("WebSocketTest") { module_out_path = module_output_path -- Gitee