summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-08-19 16:06:41 +0200
committerDavid Sterba <dsterba@suse.com>2016-08-22 16:44:22 +0200
commit4241e27ee1c6739b5442f157bf167f050d546582 (patch)
tree79aaaf121662ff26ffb520655bea70d915890fda /Makefile.in
parent49184a737b39239c2fc36857075d470a8d4e8d1e (diff)
btrfs-progs: build: add more debugging features
Add options to show file and line or stack trace for error/warning messages that use the common helpers. Possible to let any error stop execution for ease of analysis and debugging. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in
index ac6b353b..9e0cb4c4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -12,6 +12,11 @@
# V=1 verbose, print command lines (default: quiet)
# C=1 run checker before compilation (default checker: sparse)
# D=1 debugging build, turn off optimizations
+# D=dflags dtto, turn on additional debugging features:
+# verbose - print file:line along with error/warning messages
+# trace - print trace before the error/warning messages
+# abort - call abort() on first error (dumps core)
+# all - shortcut for all of the above
# W=123 build with warnings (default: off)
# DEBUG_CFLAGS additional compiler flags for debugging build
# EXTRA_CFLAGS additional compiler flags
@@ -121,6 +126,24 @@ ifeq ("$(origin D)", "command line")
DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS)
endif
+ifneq (,$(findstring verbose,$(D)))
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
+endif
+
+ifneq (,$(findstring trace,$(D)))
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
+endif
+
+ifneq (,$(findstring abort,$(D)))
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
+endif
+
+ifneq (,$(findstring all,$(D)))
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
+ DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
+endif
+
MAKEOPTS = --no-print-directory Q=$(Q)
# build all by default