50 Commits

Author SHA1 Message Date
Rafal Crypto Tigusoft
dd552a10c8
fix off-by-one when resolve goes up to ip==0 frame 2017-06-29 10:57:04 +00:00
François-Xavier Bourlet
f9f732ddeb Merge pull request #63 from rfree-d/fix_warning_ip_minus1
To pass sanitization, do not rely on underflow 0-1
2017-06-28 11:40:58 -07:00
Govind Sahai
9ecb5c6bf3 Added _ to remove warning 2017-06-25 00:21:05 +05:30
Rafal Crypto Tigusoft
7430bea233
Fixed problem with decltype (on older compiler/travis) 2017-06-22 17:08:30 +00:00
Rafal Crypto Tigusoft
4fc30f7ce6
To pass sanitization, do not rely on underflow 0-1
for ip==0, we sometimes calculate ip-=1.
ip is unsigned, so this is an underflow.

This is not strictly an UB, but more pedantic sanitizers
do catch this and report as possible error.

So why not instead just explicitly set value 0xffff...
(result of 0-1) and avoid this warnings.
2017-06-22 16:35:40 +00:00
François-Xavier Bourlet
8eb8fad38f Add color mode.
This is a breaking change.

The printer now offers a color_mode setting: automatic, always, never.

When given a FILE* stream on linux, the automatic mode will retrieve
file descriptor behind it and call isatty().
2017-05-28 17:03:29 -07:00
François-Xavier Bourlet
c432e7ef8d Merge branch 'print-to-streams' of https://github.com/ogdf/backward-cpp into ogdf-print-to-streams 2017-05-28 15:16:29 -07:00
François-Xavier Bourlet
71dafcb203 Merge pull request #60 from ogdf/g++7-warnings
Fix g++ 7.0.1 warnings
2017-03-29 14:36:47 -07:00
François-Xavier Bourlet
6ae8564fbd enable tests that somebody thought it was a good idea to permanently disable. 2017-03-15 17:32:15 -07:00
François-Xavier Bourlet
5557e53f23 Only catch signals with a default action of "Core"
Close #59
2017-03-15 17:01:35 -07:00
Stephan Beyer
f147949e65 Fix -Wshadow warnings from g++ 7.0.1 2017-03-05 19:14:41 +01:00
Stephan Beyer
df124abe08 Fix -Wimplicit-fallthrough warning from g++ 7.0.1
The fallthrough (missing break after a case in a switch) is
not necessary. We can just move the whole default code move
down after the switch.
2017-03-05 19:13:50 +01:00
Kevin Funk
f76d7299be Fix -Wmissing-noreturn warning from Clang 2017-02-21 16:08:25 +01:00
Anton Kreuzkamp
a1ab90920b Use && instead of and.
Operator names are not supported by MSVC out of the box. Using them
breaks code that needs to build with MSVC and/or (thus) uses
"-fno-operator-names". As a header-only library should pursue maximal
portability, this commit replaces the single usage of operator names
with the more portable operator syntax.
2017-02-21 10:15:45 +01:00
Rui Pires
82de54d6e4 adds support for ppc architecture 2016-12-12 21:38:27 +00:00
François-Xavier Bourlet
e371aa91e3 Merge pull request #44 from ogdf/make-skip-public
Make StackTraceImpl*::skip_n_firsts() setter public
2016-11-17 11:39:35 -08:00
Stephan Beyer
f046d0d5dd Make StackTraceImpl*::skip_n_firsts() setter public
When the stack trace is used directly (and not by a signal),
one may want to hide some of the first stack items because
they will always be the same calls.
2016-10-28 18:59:51 +02:00
Stephan Beyer
3e7d61f670 Printer: Make context sizes configurable 2016-10-27 17:35:45 +02:00
Stephan Beyer
e8ec7beb1e Let Colorizer reset on initialization 2016-10-25 21:50:21 +02:00
Stephan Beyer
bda53f29f9 Make Printer::print methods available for streams 2016-10-25 21:50:21 +02:00
Milian Wolff
ad84214192 Define PACKAGE and PACKAGE_VERSION before including bfd.h
On ArchLinux at least the bfd.h header errors out early if
PACKAGE or PACKAGE_VERSION have not been set. This patch
makes backward.hpp compile on this platform for me.
2016-06-01 10:33:52 +02:00
Manu343726
74cd785e61 Add ARM support 2016-05-04 10:50:22 +02:00
Anton Kreuzkamp
f1b70b1ef7 Rename variable "signals" to "unix_signals".
This change is needed for compatibility to Qt applications.

Qt defines a macro "signals" that expands to nothing and is used by
Qt's meta object compiler (which is kind of a C++ pre-processor) to
add signal-slot feature (http://doc.qt.io/qt-5/signalsandslots.html).
This will cause compilation of backward.hpp to fail, when used from a
Qt application, because the variable "signals" will be expanded to ""
by the cpp pre processor.
2016-04-07 18:26:20 +02:00
Edison Gustavo Muenz
c3ed021828 Replace usages of alternative usages of boolean operators with more more standard ones since they don't compile in Visual Studio 2010.
Replacements are:
- 'and' => '&&'
- 'or'  => '||'
- 'not' => '!'

Also added some missing includes since MSVC was complaining of missing
symbols.
2015-09-10 12:12:55 -03:00
Edison Gustavo Muenz
7b3e9511ef Compilers with GLIBC < 2.10 don't have the psiginfo() function 2015-08-28 18:01:53 -03:00
hesiod
7a56ae336a Fix compilation warning under clang
Clang complains about adding const to a reference type having no effect.
Fix this by adding and using a const_ref_t.
2014-10-18 18:35:13 +02:00
Fabrício Ceolin
9aaac31354 Fixing buffer overflow on signals array 2014-04-02 16:27:35 -03:00
François-Xavier Bourlet
e8b6cb2475 Tests are all passing now. 2013-11-17 22:16:13 -08:00
François-Xavier Bourlet
6bb925fd70 Better test checking
- fork every test
 - capture signals
 - more assertion tools
 - test can be expected to fail
2013-11-17 21:07:04 -08:00
François-Xavier Bourlet
d9777cf5c1 Adding BACKWARD_HAS_* config in cmake for tests 2013-11-06 01:46:36 -08:00
François-Xavier Bourlet
9ba9df4db8 A more flexible and factorized stack Printer. 2013-11-06 00:22:35 -08:00
François-Xavier Bourlet
3791f32b4b Add defines for "ATLEAST_CXX11" 2013-11-06 00:22:35 -08:00
François-Xavier Bourlet
60a07e3282 A system specializable demangler implementation. 2013-11-06 00:22:34 -08:00
François-Xavier Bourlet
c53c91fcdc Remove unused local var support (for now) 2013-11-06 00:22:32 -08:00
François-Xavier Bourlet
e19f2577f7 Remove noisy comments. 2013-11-06 00:21:35 -08:00
François-Xavier Bourlet
83709f4448 Little typo fix 2013-11-06 00:18:35 -08:00
Andrey Sibiryov
9cd89623af Proper way to mark a variable unused.
Instead of explicitly void-ing a variable, just make it anonymous.
2013-06-26 21:39:28 +04:00
Andrey Sibiryov
18a7121fb4 Fix unused parameter warnings.
In SignalHandling constructor, the empty signal vector is never used,
which triggers unused parameter warnings at least on Clang 3.2.
2013-06-26 13:09:19 +04:00
Andrey Sibiryov
4605817160 Resolve issue #6: unsigned line counters.
Change all the line counter variable types from size_t to unsigned, so
that we can printf() them as '%u' in a portable way, effectively fixing
build errors on ancient i386 machines.
2013-06-26 00:19:47 +04:00
bastih
05a15f253a Remove debug printf from SignalHandling() 2013-06-06 16:06:31 +02:00
bastih
e830de82a2 Add default parameter to BACKWARD_SYSTEN_UNKNOWN signal handler 2013-05-29 09:10:49 +00:00
bastih
5a638eafd8 Improve as per bombela's suggestions, add test 2013-05-26 16:31:58 +00:00
bastih
78fd27faec Make signals configurable
This allows for selecting the appropriate signals
and avoids conflicts with other tools that specific
signals i.e. profilers
2013-04-10 11:41:38 +02:00
Andrey Sibiryov
4d9ba6f9e5 fixed a typo in the stacktrace_tag, which is fortunately unused as of now 2013-03-29 03:16:19 +04:00
Andrey Sibiryov
c406061820 added an empty body to Colorize::init() method on non-Linux systems 2013-03-29 03:10:25 +04:00
François-Xavier Bourlet
7742dacc36 Use a dedicated stack for signals handler 2013-03-23 22:05:58 -07:00
François-Xavier Bourlet
2bb696b8e2 few modification for pedantic compliance with C++98 and C++11 2013-03-17 15:59:51 -07:00
François-Xavier Bourlet
f46591a1cd A little hack to declare _Unwind_GetIPInfo with clang.
fixes #2
2013-03-15 20:18:13 -07:00
François-Xavier Bourlet
fc7b6bca8d Attribute Copyright to Google Inc. 2013-03-15 13:25:14 -07:00
François-Xavier Bourlet
1ae978ab77 Initial import. 2013-03-14 23:10:06 -07:00