From 5356b5a1b09a3e5ab76a2e2798fbfc227319a560 Mon Sep 17 00:00:00 2001 From: lucasace Date: Thu, 18 Aug 2022 21:16:56 +0530 Subject: [PATCH] Clear Error message when backtrace_plugin load fails * Added backtrace in test.yml * Doc fix in metacall_runtime.sh --- .github/workflows/test.yml | 2 +- .../plugins/backtrace_plugin/source/backtrace_plugin.cpp | 9 ++++++++- tools/metacall-runtime.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cc881dc9..a3157e109 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: LTTNG_UST_REGISTER_TIMEOUT: 0 NUGET_XMLDOC_MODE: skip DOTNET_CLI_TELEMETRY_OPTOUT: 'true' - METACALL_INSTALL_OPTIONS: root base python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust rapidjson funchook swig pack + METACALL_INSTALL_OPTIONS: root base python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust rapidjson funchook swig pack backtrace - name: Configure run: | diff --git a/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp b/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp index 14f1db7a3..a79983471 100644 --- a/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp +++ b/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp @@ -22,6 +22,8 @@ #include +#include + static backward::SignalHandling signal_handling; int backtrace_plugin(void *loader, void *handle, void *context) @@ -30,5 +32,10 @@ int backtrace_plugin(void *loader, void *handle, void *context) (void)handle; (void)context; - return signal_handling.loaded() == true ? 0 : 1; + if (signal_handling.loaded() == false) + { + log_write("metacall", LOG_LEVEL_ERROR, "Backtrace plugin failed to load, you need unwind/libunwind for stacktracing and libbfd/libdw/libdwarf for the debug information. Install the required libraries and recompile to utilise the backtrace plugin. For more information visit https://github.com/bombela/backward-cpp"); + return 1; + } + return 0; } diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index f2c1bf796..adad1d8c2 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -239,7 +239,7 @@ sub_cobol(){ # Backtrace (this only improves stack traces verbosity but backtracing is enabled by default) sub_backtrace(){ - echo "configure cobol" + echo "configure backtrace" sub_apt_install_hold libdw1 }