changeset 115:5a716f08e4be

Debug
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 27 Oct 2016 10:28:10 +0100
parents 95c94a86c902
children d15cb1151d76
files Makefile vamp-client/ProcessQtTransport.h
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Oct 25 21:06:38 2016 +0100
+++ b/Makefile	Thu Oct 27 10:28:10 2016 +0100
@@ -3,9 +3,9 @@
 PIPER_DIR	:= ../piper
 
 CXXFLAGS	:= -Wall -Wextra -Werror -g3 -std=c++11
-INCFLAGS	:= -I$(VAMPSDK_DIR) -I. -I/usr/local/include
-
-LDFLAGS		:= $(VAMPSDK_DIR)/libvamp-hostsdk.a -L/usr/local/lib -lcapnp -lkj -ldl
+INCFLAGS	:= -I$(VAMPSDK_DIR) -I. -I/usr/local/include -I../sv-dependency-builds/win32-mingw/include
+ 
+LDFLAGS		:= -L../sv-dependency-builds/win32-mingw/lib -L../../vamp-plugin-sdk -L/usr/local/lib -lvamp-hostsdk -lcapnp -lkj 
 
 all:	o bin bin/piper-convert bin/piper-vamp-server
 
@@ -21,8 +21,8 @@
 bin/piper-vamp-server: o/server.o o/piper.capnp.o
 	c++ $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
 
-vamp-capnp/piper.capnp.h:	$(PIPER_DIR)/capnp/piper.capnp
-	capnp compile -oc++:vamp-capnp --src-prefix=$(PIPER_DIR)/capnp $<
+#vamp-capnp/piper.capnp.h:	$(PIPER_DIR)/capnp/piper.capnp
+#	capnp compile -oc++:vamp-capnp --src-prefix=$(PIPER_DIR)/capnp $<
 
 o/piper.capnp.o:	vamp-capnp/piper.capnp.c++ vamp-capnp/piper.capnp.h
 	c++ $(CXXFLAGS) $(INCFLAGS) -c $< -o $@
--- a/vamp-client/ProcessQtTransport.h	Tue Oct 25 21:06:38 2016 +0100
+++ b/vamp-client/ProcessQtTransport.h	Thu Oct 27 10:28:10 2016 +0100
@@ -94,6 +94,7 @@
             throw std::logic_error("No completeness checker set on transport");
         }
         
+        std::cerr << "writing " << size << " bytes to server" << std::endl;
         m_process->write(ptr, size);
         
         std::vector<char> buffer;
@@ -107,7 +108,14 @@
 		std::cerr << "waiting for data from server..." << std::endl;
 		m_process->waitForReadyRead(1000);
                 if (m_process->state() == QProcess::NotRunning) {
-                    std::cerr << "ERROR: Subprocess exited: Load failed" << std::endl;
+                    QProcess::ProcessError err = m_process->error();
+                    if (err == QProcess::Crashed) {
+                        std::cerr << "Server crashed during request" << std::endl;
+                    } else {
+                        std::cerr << "Server failed during request with error code "
+                                  << err << std::endl;
+                    }
+                    //!!! + catch
                     throw std::runtime_error("Piper server exited unexpectedly");
                 }
             } else {