diff --git a/bundle.json b/bundle.json index 19e3ee612e355ad7c9e79d74afeb8760da76e4b2..c9aaf8f7524aaffdc124886e2dfcad966be929d2 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 e345de6736b0cf02ecf9330c0a0911f60a698337..6bc5a68129fad9904909ea307bfa038f78237704 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 71fee1a1645bb655db33f442f6bf82564b3dc91a..f48b0caa49c9b4014e7eee62d2d4b0d436078bba 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 dcaa0b8bf8d8252049496d32f217251ad7106eaa..2fbec4c57e94ceca987e869e729873e8dace4e7a 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