projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manpage: Mention -s | --log-to-stdout option.
[pulseview.git]
/
pv
/
application.cpp
diff --git
a/pv/application.cpp
b/pv/application.cpp
index 66991dd985b3b5cd3d0765926784e5ec7e34847f..c16c9c4b7c757e3a4312316bb69edb668ef2615e 100644
(file)
--- a/
pv/application.cpp
+++ b/
pv/application.cpp
@@
-14,14
+14,21
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#include "application.h"
+#include "application.h
pp
"
#include "config.h"
#include "config.h"
-#include <iostream>
+#include <typeinfo>
+
+#include <QDebug>
+
+#ifdef ENABLE_STACKTRACE
+#include <boost/stacktrace.hpp>
+#endif
+
+using std::exception;
Application::Application(int &argc, char* argv[]) :
QApplication(argc, argv)
Application::Application(int &argc, char* argv[]) :
QApplication(argc, argv)
@@
-36,9
+43,14
@@
bool Application::notify(QObject *receiver, QEvent *event)
{
try {
return QApplication::notify(receiver, event);
{
try {
return QApplication::notify(receiver, event);
- } catch (std::exception& e) {
- std::cerr << "Caught exception: " << e.what() << std::endl;
+ } catch (exception& e) {
+ qDebug().nospace() << "Caught exception of type " << \
+ typeid(e).name() << " (" << e.what() << ")";
+#ifdef ENABLE_STACKTRACE
+ throw e;
+#else
exit(1);
exit(1);
+#endif
return false;
}
}
return false;
}
}