Commit Graph

90 Commits

Author SHA1 Message Date
Etan Kissling b6e26f03c0
bump whereami to `dcb52a058dc14530ba9ae05e4339bd3ddfae0e0e` (#46)
- updated documentation to mention that dirname_length is only available
  when capacity is large enough, resolves #43
2024-08-28 13:06:47 +00:00
Etan Kissling 6a5a44b16f
bump libbacktrace to `86885d14049fab06ef8a33aac51664230ca09200` (#45)
- libbacktrace: add notes about dl_iterate_phdr to README
- libbacktrace: better backtrace_print when no debug info
- libbacktrace: add cast to avoid warning
- libbacktrace: use __has_attribute for fallthrough
- libbacktrace: fix syntax of Windows registration functions
- libbacktrace: avoid -Wpointer-arith errors
- libbacktrace: update xcoff.c for base_address changes
2024-08-06 13:52:06 +00:00
Etan Kissling 5578031344
Pass length explicitly instead of relying on NULL terminators (#44)
The `getDebuggingInfo` function relies on `programCounters` being a
NULL terminated list. However, none of the usage actually adds NULL...

- In the path that passes `getProgramCounters` result into
  `getDebuggingInfo`, no explicit 0 value is added to `result`.
  In practice, there happens to be a 0 there very frequently,
  but it is not guaranteed (`env MallocScribble=1`), and even
  if it is not there the implementation often continues to work
  when processing the extra garbage data, silencing the problem.

- In the path from Nim `addDebuggingInfo` (`system/stacktraces.nim`),
  the `programCounters` list is constructed by Nim logic and also
  does not add a 0 value to the list. This means that even if we fix
  `getProgramCounters` to produce NULL terminated list, other usage
  is still broken, and outside the control of this library.

Therefore, remove the NULL terminator logic and pass length explicitly
while retaining any early loop exits when encountering 0 for compat.

Also fix some memory leaks in error conditions.
2024-07-18 17:55:27 +02:00
Etan Kissling da32d6efe6
bump libbacktrace to `1dd5c408fe6f5d9bccf870ec4e0e4bcabeb0664e` (#43)
- libbacktrace: it's OK if zstd decompressor sees no backward bits
- libbacktrace: remove trailing whitespace
- libbacktrace: suggest how to fix missing debug info
- libbacktrace: fix testsuite for clang
- libbacktrace: correctly gather Mach-O symbol table
- libbacktrace: don't fail if symbol size is unknown
- libbacktrace: update copyright years
- Handle jobserver file descriptors in btest
- libbacktrace: update libtool.m4 to current GCC HEAD
- libbacktrace: correct duplicate configury
- Config,Darwin: Allow for configuring Darwin to use embedded runpath
- libbacktrace: fix UBSAN issues
- libbacktrace: fix b2test_buildid test on non-english locales
- Libbacktrace: Fix the use of newline in sed replacement
- libbacktrace: improve XCOFF support
- libbacktrace: avoid infinite recursion
- libbacktrace: support FDPIC
2024-07-17 17:18:08 +00:00
Etan Kissling 4db9cae5ac
bump whereami to `f5e3eac441acbb4ec1fe3e2c32646248ae463398` (#42)
- Include <stdbool.h> only if _MSC_VER >= 1900
2024-06-14 10:55:54 +00:00
Etan Kissling aab85b6d24
bump `whereami` to `a08044b0f9d7a18b9ddd15bfcb490e422fa1f6c4` (#41)
- fixed /proc/self/maps parsing failing when the path to the current
  module contains spaces
- fixed -Wbad-function-cast in getModulePath()
2024-05-24 18:08:47 +00:00
Etan Kissling b8b79311d8
bump `libbacktrace` to `11427f31a64b11583fec94b4c2a265c7dafb1ab3` (#40)
- libbacktrace: load Windows modules
- libbacktrace: add DLLS as they are loaded
2024-05-24 18:03:58 +00:00
Etan Kissling cefd3eec9c
bump `libbacktrace` to `ae1e707dbacd4a5cc82fcf2d3816f410e9c5fec4` (#38)
- libbacktrace: test --compress-debug-sections=ARG for each ARG
2024-04-26 04:39:02 +00:00
tersec 66864ed4ae
use strutils.escape to handle more special chars (#37) 2024-03-26 19:09:04 +00:00
tersec 9f4fd37153
quote and library paths for use in passc/passl to allow embedded spaces (#36) 2024-03-26 18:00:23 +00:00
Etan Kissling 027570111c
bump `libbacktrace` to `7ead8c1ea2f4aeafe9c5b9ef8a9461a9ba781aa8` (#35)
- libbacktrace: don't assume compressed section is aligned
2024-03-12 02:01:53 +00:00
Etan Kissling a6746c4df8
bump `libbacktrace` to `f41cf1fecbc01966e0a3c32a1a54ff9cb0a19bb9` (#34)
- libbacktrace: read symbol table of debuginfo file
- libbacktrace: use real .opd for debuginfo on ppc64 v1 ABI
- libbacktrace: skip all LZMA block header padding bytes
- libbacktrace: pass -no-install when linking test programs
2024-03-03 00:07:32 +00:00
tersec 008de2cd42
require minimum of Nim 1.6 (#33) 2024-02-13 19:05:07 +00:00
Etan Kissling cb1f78d3d5
bump `whereami` to `c5f6b015c36964790493841b9b4623184c0f7c3f` (#32)
- fixed -Wstrict-prototypes
2024-01-24 12:12:40 +00:00
Etan Kissling 7f532d4cae
bump `whereami` to `ba364cd54fd431c76c045393b6522b4bff547f50` (#31)
- fixed getModulePath() when library is mapped from within Android APK
- updated Makefile for Android
- updated sponsor information
- do not redefine WIN32_LEAN_AND_MEAN if already defined
- fixed getModulePath() when library is mapped from within Android APK (2)
- fixed getModulePath() when library is mapped from within Android APK (3)
- do not use the u_int type which is sometimes not defined on FreeBSD
- added support for OpenBSD
- made peace with Coverity
- defined _DEFAULT_SOURCE and _DARWIN_C_SOURCE from within whereami.c
2024-01-18 11:03:08 +00:00
Etan Kissling f250fccee4
bump `libbacktrace-upstream` to `14818b7783eeb9a56c3f0fca78cefd3143f8c5f6` (#30)
- config/override.m4: don't require exactly autoconf 2.69
- configury: update to recent versions
- configury: support --disable-werror
- libbacktrace: initialize DWARF 5 fields of unit
- libbacktrace: gather address ranges from skeleton units
- libbacktrace: don't skip initial aligned byte in uncompressed block
- libbacktrace: replace fgrep with grep in configure script
- libbacktrace: don't let "make clean" remove allocfail.sh
- libbacktrace: don't exit Mach-O dyld library loop on one failure
- libbacktrace: check for sys/link.h
- libbacktrace: support zstd decompression
- libbacktrace: rewrite and simplify main zstd loop
- libbacktrace: unpack literals into output buffer
- libbacktrace: don't run --build-id tests if it is not supported
- libbacktrace: change PC variables from uint64_t to uintptr_t
- libbacktrace: minor fixes for zstd decompression
- libbacktrace: look for _pgmptr on Windows
- [libbacktrace] fix up broken test
- libbacktrace: call GetModuleFileNameA on Windows
- libbacktrace: support ASLR on Windows
2024-01-18 10:48:19 +00:00
andri lim aad5aa227c
Move CI to Github Actions (#29)
* Move CI to Github Actions

* enable ci submodules

* Update CI badge
2023-09-08 17:06:03 +07:00
Zahary Karadjov 06380d57ff
Remove potential for ambiguos compilation 2023-04-05 19:14:23 +03:00
Ivan Yonchovski b29c22ba0e
Added config.nims and nimble.lock (#26) 2022-06-23 14:05:05 +03:00
Ivan Yonchovski 7de5d50520
Proper paths for importing headers (#27) 2022-06-23 14:04:19 +03:00
Ivan Yonchovski d4a9115a43
Restructure the project to allow nimble check to pass (#25) 2022-06-20 14:32:17 +03:00
Ștefan Talpalaru 2ea147a71c
docs: link to perf example (#24) 2022-03-24 11:39:55 +01:00
Ștefan Talpalaru b457f9fd6e
make clean: delete libunwind CMake output (#23) 2022-03-23 02:14:28 +01:00
Ștefan Talpalaru 656881b721
cross-compile with latest MXE (#22) 2022-03-22 16:04:03 +01:00
Etan Kissling 284b3aac05
fix build output color on macOS (#20)
On macOS, `echo` does not support the `\e` extension from GNU coreutils.
Replacing with the portable `\x1B` to fix Terminal build output colors.
2021-09-09 14:12:58 +02:00
Etan Kissling 6dc18d51b6
provide hint on installing CMake using brew (#19)
This extends the build error message when CMake is not installed with a
macOS specific hint to install it using Homebrew, in line with how other
Status components report missing system dependencies.
2021-09-01 16:45:13 +02:00
Ștefan Talpalaru b70db54e07
document Clang option 2021-05-25 23:09:27 +02:00
Ștefan Talpalaru 169e605495
document and test using -g1 instead of -g3 (#18) 2021-05-25 22:37:36 +02:00
Ștefan Talpalaru 63196b0628
allow overriding "cmake"
useful for OSXCross' CMake wrapper
2021-05-13 00:21:59 +02:00
Ștefan Talpalaru ce966b1c46
bump version 2021-04-29 02:20:35 +02:00
Ștefan Talpalaru 1c7df006d3
update upstream libraries (#17)
libbacktrace bumped to the latest comit in the "master" branch of https://github.com/ianlancetaylor/libbacktrace

libunwind manually copied from https://github.com/llvm/llvm-project -
commit f749550cfe9f0bf2364abb2139835348587062ed - on top of which I
disabled a dependency on "../libcxx" that only makes sense in the LLVM
monorepo.
2021-04-29 02:18:27 +02:00
Ștefan Talpalaru bc30152b98
Merge pull request #16 from status-im/internalfunc
skip internal functions like "raiseExceptionEx.constprop.0"
2021-04-26 21:20:42 +02:00
Ștefan Talpalaru 71af218992
skip internal functions like "raiseExceptionEx.constprop.0" 2021-04-26 19:59:32 +02:00
Ștefan Talpalaru b3f289caad
version 0.0.6 2021-04-26 19:21:41 +02:00
Ștefan Talpalaru e59f9f1fbf
better detection for missing debugging symbols (#15) 2021-04-26 19:19:47 +02:00
Timothee Cour 829a65ca3d
fix readme (#13) 2021-03-14 20:37:41 +01:00
Ștefan Talpalaru f0bbe7eb6b
version 0.0.5 2021-03-14 18:53:33 +01:00
Ștefan Talpalaru a8ff8d28f1
CI: use the "version-1-4" Nim branch 2021-03-14 18:32:13 +01:00
Ștefan Talpalaru d6d449446b
deal with functions inlined into "main()"
and limit the number of "no debugging symbols available" error messages
per stack trace
2021-03-14 18:24:59 +01:00
Timothee Cour cfe5032ddb yuk, using tab to match source 2021-03-13 23:44:40 -08:00
Timothee Cour 74bc7a4c71 fix #9 stacktrace works if triggered by a signal, eg SIGSEGV 2021-03-13 23:37:41 -08:00
Ștefan Talpalaru 40be35148e
Nim-1.2.10 compatibility 2021-03-14 03:28:13 +01:00
Ștefan Talpalaru ffdad2530f
enable cross-compilation 2021-03-14 03:02:11 +01:00
Ștefan Talpalaru 8121c08e0e
replace forked libbacktrace submodule (#8)
with upstream libbacktrace submodule, which works with LTO
2020-09-28 17:49:48 +02:00
Ștefan Talpalaru 107878ad53
support Nim devel 2020-09-23 12:21:48 +02:00
Ștefan Talpalaru c21107e34c
extra test case 2020-09-07 21:01:58 +02:00
Ștefan Talpalaru 3ff163ca58
two-step backtraces
Allow separating stack unwinding and program counter collection from the
more expensive step of getting the associated debugging info for each
program counter.

This is useful for implementing efficient backtraces for exceptions - a
scenario in which you add a new backtrace each time an exception is
re-raised, but you rarely need to print them (usually when that
exception is uncaught).

libunwind snapshot - 673484b34189b1bccf73a2ec96968092bc8a26a7
2020-09-07 01:40:57 +02:00
Ștefan Talpalaru dc2c199d41
Merge pull request #7 from status-im/js-fix
Make the library more friendly to JavaScript and NimScript
2020-06-16 21:58:59 +02:00
Zahary Karadjov 35eeb035b2
Make the library more friendly to JavaScript and NimScript 2020-06-16 22:09:07 +03:00
Ștefan Talpalaru 2ddb255b14
Merge pull request #6 from status-im/libunwind
libunwind snapshot - b31cb3aa5ee7ea92d830b06a0a7e42c7f2791dd4
2020-05-20 02:47:07 +02:00