summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-04-07 11:37:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-04-07 11:37:56 +0100
commitb9bc97d45520440244fc06db73a4ef00868e34b2 (patch)
tree810f3b319ccf922fdd4c95fcdbcf7e0cd10193d3
parent2f9a3260430f7e6c6472e8d09aa5b3910aaceac4 (diff)
allow setting DEBUGCPPUNIT=TRUE to dump a gdb try/catch trace
-rw-r--r--solenv/bin/gdbtrycatchtrace-stdout14
-rw-r--r--solenv/gbuild/CppunitTest.mk6
2 files changed, 19 insertions, 1 deletions
diff --git a/solenv/bin/gdbtrycatchtrace-stdout b/solenv/bin/gdbtrycatchtrace-stdout
new file mode 100644
index 000000000000..e606a4f12f86
--- /dev/null
+++ b/solenv/bin/gdbtrycatchtrace-stdout
@@ -0,0 +1,14 @@
+set pagination off
+catch throw
+commands
+ bt
+ cont
+end
+catch catch
+commands
+ bt
+ cont
+end
+run
+bt
+quit
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index e0d61433cdc8..690d3bafeb02 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -32,11 +32,15 @@
DBGSV_ERROR_OUT := shell
export DBGSV_ERROR_OUT
+ifeq ($(strip $(DEBUGCPPUNIT)),TRUE)
+gb_CppunitTest_GDBTRACE := gdb -nx --command=$(SOLARENV)/bin/gdbtrycatchtrace-stdout -return-child-result --args
+endif
+
# defined by platform
# gb_CppunitTest_TARGETTYPE
# gb_CppunitTest_get_filename
gb_CppunitTest_CPPTESTTARGET := $(call gb_Executable_get_target,cppunit/cppunittester)
-gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) $(gb_CppunitTest_CPPTESTTARGET)
+gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_CPPTESTTARGET)
gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1))
.PHONY : $(call gb_CppunitTest_get_clean_target,%)