Skip to content

Commit 5356b5a

Browse files
committed
Clear Error message when backtrace_plugin load fails
* Added backtrace in test.yml * Doc fix in metacall_runtime.sh
1 parent c5d4f3c commit 5356b5a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
LTTNG_UST_REGISTER_TIMEOUT: 0
4444
NUGET_XMLDOC_MODE: skip
4545
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
46-
METACALL_INSTALL_OPTIONS: root base python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust rapidjson funchook swig pack
46+
METACALL_INSTALL_OPTIONS: root base python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust rapidjson funchook swig pack backtrace
4747

4848
- name: Configure
4949
run: |

source/plugins/backtrace_plugin/source/backtrace_plugin.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <backward.hpp>
2424

25+
#include <log/log.h>
26+
2527
static backward::SignalHandling signal_handling;
2628

2729
int backtrace_plugin(void *loader, void *handle, void *context)
@@ -30,5 +32,10 @@ int backtrace_plugin(void *loader, void *handle, void *context)
3032
(void)handle;
3133
(void)context;
3234

33-
return signal_handling.loaded() == true ? 0 : 1;
35+
if (signal_handling.loaded() == false)
36+
{
37+
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");
38+
return 1;
39+
}
40+
return 0;
3441
}

tools/metacall-runtime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ sub_cobol(){
239239

240240
# Backtrace (this only improves stack traces verbosity but backtracing is enabled by default)
241241
sub_backtrace(){
242-
echo "configure cobol"
242+
echo "configure backtrace"
243243

244244
sub_apt_install_hold libdw1
245245
}

0 commit comments

Comments
 (0)