mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 19:45:37 +08:00
GP-0: Fix tests
This commit is contained in:
@@ -61,6 +61,7 @@ public class GdbModelImpl extends AbstractDebuggerObjectModel {
|
||||
|
||||
protected final GdbManager gdb;
|
||||
protected final GdbModelTargetSession session;
|
||||
private volatile boolean closed;
|
||||
|
||||
protected final CompletableFuture<GdbModelTargetSession> completedSession;
|
||||
protected final GdbStateListener gdbExitListener = this::checkExited;
|
||||
@@ -141,13 +142,22 @@ public class GdbModelImpl extends AbstractDebuggerObjectModel {
|
||||
public CompletableFuture<Void> startGDB(String gdbCmd, String[] args) {
|
||||
return CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
if (closed) {
|
||||
return;
|
||||
}
|
||||
gdb.start(gdbCmd, args);
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (closed) {
|
||||
return;
|
||||
}
|
||||
throw new DebuggerModelTerminatingException(
|
||||
"Error while starting GDB: " + e.getMessage(), e);
|
||||
}
|
||||
}).thenCompose(__ -> {
|
||||
if (closed) {
|
||||
return AsyncUtils.NIL;
|
||||
}
|
||||
return gdb.runRC();
|
||||
});
|
||||
}
|
||||
@@ -174,6 +184,7 @@ public class GdbModelImpl extends AbstractDebuggerObjectModel {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> close() {
|
||||
closed = true;
|
||||
try {
|
||||
terminate();
|
||||
return super.close();
|
||||
|
||||
+3
@@ -133,6 +133,9 @@ public class GdbModelTargetSession extends DefaultTargetModelRoot
|
||||
|
||||
@Override
|
||||
public void output(GdbManager.Channel gdbChannel, String out) {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
TargetConsole.Channel dbgChannel;
|
||||
switch (gdbChannel) {
|
||||
case STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user