4
0
mirror of https://github.com/QuasarApp/backward-cpp.git synced 2025-05-02 12:59:34 +00:00

229 Commits

Author SHA1 Message Date
Zsolt Parragi
7cbf4c25e9 Windows (Clang9, MSVC2017) implementation
Remaining issues:
* some warinings
2019-11-29 12:33:22 +01:00
Zsolt Parragi
ec14c48e3e Making tests less platform dependent.
Tests executables made several assumptions that are only valid on
some system/compiler:

* That the main function is found even in a shared library (not true
  on windows). To fix this, test_main is now an ojbect library
* That the extern test_registry in test.cpp will be initialized
  before any actual test uses it. This was either a lucky coincidence
  on linux, or being related to the variable being initialized in a
  shared library. The variable is now initialized by a function,
  guarantaaing initialization order.
* That test.hpp is only inluded once per binary, which was only true
  because it was once part of a DLL, once the executable, hiding ODR
  violations. As now it's linked twice within the same binary, some
  functions had to be made inline.
* not is not a valid C++ operator, replaced all occurences with !
2019-11-29 12:16:13 +01:00
Zsolt Parragi
4dfd5e6e24 Use a macro instead of direct noinline attributes.
This is a prerequisite of MSVC support, as it uses a different syntax.
2019-11-29 12:15:54 +01:00
Zsolt Parragi
7cf5ece17d Build tests by default when backward is a top level project 2019-11-29 12:15:50 +01:00
François-Xavier Bourlet
377cd4b66c
Merge pull request from FlyGoat/master
Add mips support
2019-11-23 08:15:34 -08:00
Jiaxun Yang
3cec08149d Add mips support
MIPS didn't export regs at mcontext_t so we need to cast it as sigcontext.
All test passed on my mips64el machine.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
2019-11-23 21:34:56 +08:00
François-Xavier Bourlet
aa3f253efc
Merge pull request from forrestv/issue146
Fix for issue 
2019-09-25 11:20:36 -07:00
Forrest Voight
1ecbdc6491 Handle executable being deleted or replaced by directly opening
`/proc/self/exe` rather than file it links to. Fixes issue .
2019-09-25 12:52:52 -05:00
Forrest Voight
79e7738e1f Extracted duplicated code for get_argv0 and read_symlink 2019-09-23 14:17:45 -05:00
François-Xavier Bourlet
2831aaaf61
Merge pull request from bombela/clang-format
clang-format
2019-09-05 16:12:11 -07:00
François-Xavier Bourlet
9fb93a08aa clang-format 2019-09-05 13:41:10 -07:00
François-Xavier Bourlet
db6adef8ab
Merge pull request from johnsalmon/master
Improve portability to non-glibc Linux systems
2019-08-29 11:33:53 -07:00
François-Xavier Bourlet
e50dff5a38
Merge pull request from BotellaA/patch-1
Update BackwardConfig.cmake
2019-08-29 10:37:52 -07:00
John Salmon
af2debf91e StackTraceImpl::operator[] is const
This is only matters when compiling with -DBACWARD_SYSTEM_UNKNOWN.
2019-08-25 20:56:27 -04:00
John Salmon
80af93580f Improve portability to non-glibc Linux systems
Linux is not synonymous with glibc.  Alpine linux (among others) uses
libmusl as the standard C library.  Alpine/libmusl doesn't have
backtrace, dladdr1, execinfo.h or error.h.  It does have libunwind
and program_invocation_name and libdwarf and libelf are available as
packages.

This patch makes backward-cpp work on Alpine linux (and hopefully
others that rely on libmusl).

This patch makes dladdr1 dependent on the __GLIBC__ pp-symbol
(rather than __ANDROID__).

It uses __has_include (protected by a defined()) rather than __APPLE__
to decide whether to include <error.h> in _test_main.cpp.
2019-08-25 20:34:28 -04:00
François-Xavier Bourlet
27349d0a75
Merge pull request from marcomagdy/missing-ref-qualifier
Add missing ref qualifier
2019-06-06 12:32:28 -07:00
Marco Magdy
9c4c163583 squash! Add missing ref qualifier to the other overload 2019-06-03 15:29:56 +00:00
Marco Magdy
fb4a00d1f8
Add missing ref qualifier
returning a `const T` as opposed to `const T&` serves little purpose and is most likely not what the writer intended.
This change was called out by clang-tidy.
2019-06-01 10:26:18 -07:00
François-Xavier Bourlet
98747968ad
cmake_minimum_required 2.8.12 -> 3.0
Closes 
2019-05-07 06:37:45 -07:00
François-Xavier Bourlet
b353585d4b
Merge pull request from skalkoto/fix-gcc-unknown-pragma-warning
Fix unknown pragma warning in gcc
2018-11-26 11:43:33 -08:00
Nikos Skalkotos
b7ffd640ec Fix unknown pragma warning in gcc
Check if the compiler is clang before using clang only pragma statements.
2018-11-06 14:05:47 +02:00
François-Xavier Bourlet
936c1c0f28
Merge pull request from mrostecki/gnuinstalldirs
cmake: Use GNUInstallDirs for libdir and includedir
2018-10-23 07:08:35 -07:00
Michal Rostecki
d4f6779afb cmake: Use GNUInstallDirs for libdir and includedir
The comon practice in cmake to allow to specify the libdir or
includedir using GNUInstallDirs which introduces the following
options:

* CMAKE_INSTALL_INCLUDEDIR
* CMAKE_INSTALL_LIBDIR

The main motivation behind this change is ability to use /usr/lib64
instead of /usr/lib as a libdir.
2018-10-22 16:20:08 +02:00
François-Xavier Bourlet
a5adc5a866
Merge pull request from pkestene/nvcc_wrapper
Make backward-cpp compatible with nvcc_wrapper
2018-09-22 23:20:48 -07:00
François-Xavier Bourlet
06cfe31a34
Merge pull request from okeuday/master
Fix compilation for GCC (tested with 5.4.0)
2018-09-22 23:20:17 -07:00
Michael Truog
7539d53b54
Fix compilation for GCC (tested with 5.4.0) 2018-09-22 19:10:56 -07:00
François-Xavier Bourlet
84ae4f5e80
Merge pull request from pedronavf/optimizations
Code optimizations
v1.4
2018-06-28 11:41:29 -07:00
François-Xavier Bourlet
73442396e4
Merge pull request from ArekPiekarz/master
Fix or silence warnings on GCC 7 and Clang 5
2018-06-28 11:32:53 -07:00
François-Xavier Bourlet
218e43e6c2
Merge branch 'master' into master 2018-06-28 11:29:07 -07:00
François-Xavier Bourlet
638dd90ad1
Merge pull request from AlexeiDrake/master
Fix -Wold-style-cast compilation warnings
2018-06-28 11:22:13 -07:00
Alexei Drake
e304e655f6 Fix -Wold-style-cast compilation warnings by using static_cast and reinterpret_cast 2018-06-28 12:41:53 +02:00
Pierre Kestener
4038736eaf make sure to detect nvcc compiler even if used embedded in mpi compiler wrapper 2018-06-02 22:45:55 +02:00
Pierre Kestener
1b1beb221d Merge branch 'master' of https://github.com/bombela/backward-cpp into nvcc_wrapper 2018-06-02 22:39:49 +02:00
Pedro Navarro
9524b15ea7 DIE iteration optimizations
When iterating through all the CU DIEs, only inspect those that have the
DW_TAG_compile_unit tag. When finishing the iteration, only keep going
to reset libdwarf's internal CU iterator if we found a DIE.
2018-05-25 17:33:58 -07:00
Pedro Navarro
d6bd44914c Fix some source code formatting issues 2018-05-25 17:33:38 -07:00
Pedro Navarro
06f4e1adb7 Do not process a .debug_range entry if its start address is 0 2018-05-25 17:33:18 -07:00
Pedro Navarro
ae396dae74 Pass the filename string as a reference 2018-05-25 17:33:05 -07:00
François-Xavier Bourlet
e1fc2c415f
Merge pull request from pkestene/fix_add_backward_macro
try to fix add_backward macro
2018-05-10 10:57:19 -07:00
Pierre Kestener
812e64f6bb try to fix add_backward macro 2018-05-09 10:51:36 +02:00
Arnaud Botella
27874fd060
Update BackwardConfig.cmake 2018-05-09 05:52:23 +02:00
François-Xavier Bourlet
54451bea98
Merge pull request from jbakosi/cmake_append_dwarf
Make cmake append libs dwarf and elf
2018-05-07 11:02:58 -07:00
François-Xavier Bourlet
8c266823ca
Merge pull request from jbakosi/export_definitions
Export each definition individually
2018-05-07 11:02:38 -07:00
François-Xavier Bourlet
d8bcd2fd79
Merge pull request from jbakosi/dwarf_debian
Find libdwarf.h on debian
2018-05-07 11:02:18 -07:00
François-Xavier Bourlet
40bddf6d2a
Merge pull request from pedronavf/patch-5
Updated README.md with libelf/libdwarf info
2018-05-07 11:01:48 -07:00
Pedro Navarro
0b6b222bb6
Updated README.md with libelf/libdwarf info
Added information about libdwarf/libelf and additional API compatible implementations that could potentially be used.
2018-05-07 10:02:51 -07:00
Jozsef Bakosi
157253254c
Export each definition individually
This allows using each definition (resulting from BackwardConfig.cmake)
separately, e.g., in conjunction with cmake's configure_file() command
and thus can be defined in a cmake-generated source file before a build.

Example:

Config.h.in
===========
 #cmakedefine01 BACKWARD_HAS_UNWIND
 #cmakedefine01 BACKWARD_HAS_BACKTRACE
 #cmakedefine01 BACKWARD_HAS_BACKTRACE_SYMBOL
 #cmakedefine01 BACKWARD_HAS_DW
 #cmakedefine01 BACKWARD_HAS_BFD
 #cmakedefine01 BACKWARD_HAS_DWARF

CMakeLists.txt:
===============
 include(BackwardConfig)
 configure_file( "${PROJECT_SOURCE_DIR}/Config.h.in"
                 "${PROJECT_BINARY_DIR}/Config.h" )

SomeProjectFile.C:
==================
 #include "Config.h"      // generated by cmake based on Config.h.in
 #include "backward.hpp"  // backward-cpp now configured based on BackwardConfig.cmake

 using namespace backward;
 StackTrace st; st.load_here(32);
 Printer p; p.print(st);
2018-05-06 10:18:48 -06:00
Jozsef Bakosi
dd57d9ed6d
Find libdwarf.h on debian
Debian installs libdwarf.h at /usr/include/libdwarf/. This change
enables cmake finding this header on debian.
2018-05-06 10:04:21 -06:00
Jozsef Bakosi
6717b69917
Make cmake append libs dwarf and elf
Without this they are not correctly included in BACKWARD_LIBRARIES even
when they are found.
2018-05-06 09:59:23 -06:00
Arkadiusz Piekarz
260c82ad08 Silence -Wdisabled-macro-expansion on Clang 2018-05-06 00:15:07 +02:00
Arkadiusz Piekarz
30fc52e002 Silence -Wzero-as-null-pointer-constant with libbfd on Clang 2018-05-06 00:11:08 +02:00