From 9481d3c3ff40685bf8ef840abbc888cee675ce2e Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Sat, 23 Jan 2016 12:30:33 +0100 Subject: SRDOP: Debugging. --- dw/oofawarewidget.cc | 3 ++- lout/misc.hh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index 891d51cf..6912108a 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -493,7 +493,8 @@ Widget *OOFAwareWidget::getWidgetAtPointLevel (int x, int y, int level, case SL_IN_FLOW: // Should be implemented in the sub class. - assertNotReached (); + assertNotReached ("getWidgetAtPoint (SL_IN_FLOW) for %s", + getClassName ()); break; case SL_OOF_REF: diff --git a/lout/misc.hh b/lout/misc.hh index 24578f02..80f227f8 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -38,6 +38,20 @@ inline void assertNotReached () abort (); } +inline void assertNotReached (const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + + fprintf (stderr, "*** [%s] This should not happen: ", prgName); + vfprintf(stderr, fmt, argp); + fprintf (stderr, "! ***\n"); + + va_end(argp); + + abort (); +} + inline void notImplemented (const char *name) { fprintf (stderr, "*** [%s] Not implemented: %s ***\n", prgName, name); -- cgit v1.2.3