From d1fe14760562899b44990ae3bab99f1c5b2975a0 Mon Sep 17 00:00:00 2001 From: jiachong Date: Tue, 17 Jun 2025 19:32:48 +0800 Subject: [PATCH] Debugger normalization Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IC8P9M Signed-off-by: jiachong Change-Id: I1e4d1ed0e1f8f8c70ba032f08ccb74533ebf63aa --- bundle.json | 7 +++++++ tooling/BUILD.gn | 36 ++++++++++++++++++++++++++++++++++++ tooling/base/pt_json.cpp | 5 +++++ tooling/base/pt_json.h | 1 + 4 files changed, 49 insertions(+) diff --git a/bundle.json b/bundle.json index 19e3ee61..c9aaf8f7 100644 --- a/bundle.json +++ b/bundle.json @@ -55,6 +55,13 @@ ], "header_base": "//arkcompiler/toolchain/websocket" } + }, + { + "name": "//arkcompiler/toolchain/tooling:libark_common_debugger", + "header": { + "header_files": [], + "header_base": "//arkcompiler/toolchain/tooling" + } } ], "test": [ diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index e345de67..6bc5a681 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -162,3 +162,39 @@ ohos_static_library("libark_ecma_debugger_test") { } subsystem_name = "test" } + +ohos_source_set("common_debugger_set") { + sources = [ + "base/pt_json.cpp", + ] + + public_configs = [ ":ark_ecma_debugger_config" ] + + defines = [] + deps = [] + external_deps = [ "cJSON:cjson" ] + external_deps += [ + "icu:shared_icuuc", + "libuv:uv", + "bounds_checking_function:libsec_shared", + ] + subsystem_name = "arkcompiler" + part_name = "toolchain" +} + +ohos_shared_library("libark_common_debugger") { + stack_protector_ret = true + deps = [ ":common_debugger_set" ] + external_deps = [ "libuv:uv" ] + + public_configs = [ ":ark_ecma_debugger_config" ] + install_enable = true + external_deps += [ + "hilog:libhilog", + "bounds_checking_function:libsec_shared" + ] + output_extension = "so" + relative_install_dir = "ark" + subsystem_name = "arkcompiler" + part_name = "toolchain" +} diff --git a/tooling/base/pt_json.cpp b/tooling/base/pt_json.cpp index 71fee1a1..f48b0caa 100644 --- a/tooling/base/pt_json.cpp +++ b/tooling/base/pt_json.cpp @@ -131,6 +131,11 @@ bool PtJson::Add(const char *key, const char *value) const return true; } +bool PtJson::Add(const char *key, const std::string& value) const +{ + return Add(key, value.c_str()); +} + bool PtJson::Add(const char *key, const std::unique_ptr &value) const { if (key == nullptr || Contains(key)) { diff --git a/tooling/base/pt_json.h b/tooling/base/pt_json.h index dcaa0b8b..2fbec4c5 100644 --- a/tooling/base/pt_json.h +++ b/tooling/base/pt_json.h @@ -56,6 +56,7 @@ public: bool Add(const char *key, uint32_t value) const; bool Add(const char *key, double value) const; bool Add(const char *key, const char *value) const; + bool Add(const char *key, const std::string& value) const; bool Add(const char *key, const std::unique_ptr &value) const; // Push back to array -- Gitee