GP-994: Improve error reporting when GADP-based models fail to start

This commit is contained in:
Dan 2022-11-08 16:37:40 -05:00
parent 7a92882ba3
commit b4d2cb75ba
14 changed files with 80 additions and 16 deletions

View file

@ -25,6 +25,7 @@ import java.util.concurrent.ExecutionException;
import org.apache.commons.lang3.exception.ExceptionUtils;
import agent.gdb.gadp.impl.GdbGadpServerImpl;
import ghidra.async.AsyncUtils;
import ghidra.dbg.agent.AgentWindow;
import ghidra.util.Msg;
@ -54,7 +55,8 @@ public interface GdbGadpServer extends AutoCloseable {
try (GdbGadpServer server = newInstance(bindTo)) {
server.startGDB(gdbCmd, gdbArgs.toArray(new String[] {})).exceptionally(e -> {
Msg.error(this, "Error starting GDB/GADP", e);
e = AsyncUtils.unwrapThrowable(e);
Msg.error(this, "Error starting GDB/GADP: " + e);
System.exit(-1);
return null;
});

View file

@ -68,8 +68,6 @@ public class LinuxPtySessionLeader {
LIB_POSIX.execv(subArgs.get(0), subArgs.toArray(new String[0]));
}
catch (Throwable t) {
System.err.println("Error with ptyPath = '" + ptyPath + "', and subArgs = " + subArgs);
t.printStackTrace();
if (bk != -1) {
try {
int bkt = bk;
@ -80,7 +78,8 @@ public class LinuxPtySessionLeader {
System.exit(-1);
}
}
throw t;
System.err.println("Could not execute " + subArgs.get(0) + ": " + t.getMessage());
System.exit(-1);
}
}
}