mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-1976_Dan_gadpSingleClient--SQUASHED'
This commit is contained in:
@@ -89,7 +89,7 @@ public class GdbGadpDebuggerModelFactory extends AbstractGadpLocalDebuggerModelF
|
|||||||
if (!existing && gdbCmdLine.size() >= 2) {
|
if (!existing && gdbCmdLine.size() >= 2) {
|
||||||
cmd.addAll(gdbCmdLine.subList(1, gdbCmdLine.size()));
|
cmd.addAll(gdbCmdLine.subList(1, gdbCmdLine.size()));
|
||||||
}
|
}
|
||||||
cmd.add("--gadp-args");
|
cmd.add("--agent-args");
|
||||||
cmd.addAll(List.of("-H", host));
|
cmd.addAll(List.of("-H", host));
|
||||||
cmd.addAll(List.of("-p", Integer.toString(port))); // Available ephemeral port
|
cmd.addAll(List.of("-p", Integer.toString(port))); // Available ephemeral port
|
||||||
if (!existing && gdbCmdLine.size() >= 1) {
|
if (!existing && gdbCmdLine.size() >= 1) {
|
||||||
|
|||||||
@@ -61,9 +61,27 @@ public abstract class AbstractGadpServer
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GadpClientHandler newHandler(AsynchronousSocketChannel sock) {
|
protected GadpClientHandler newHandler(AsynchronousSocketChannel sock) {
|
||||||
|
try {
|
||||||
|
// Accept only the first connection
|
||||||
|
closeServerSocket();
|
||||||
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
Msg.error(this, "Could not close server socket", e);
|
||||||
|
}
|
||||||
return new GadpClientHandler(this, sock);
|
return new GadpClientHandler(this, sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void removeHandler(GadpClientHandler handler) {
|
||||||
|
super.removeHandler(handler);
|
||||||
|
try {
|
||||||
|
terminate();
|
||||||
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
Msg.error(this, "Could not terminate upon disconnect");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected AddressRange getAddressRange(Gadp.AddressRange range) {
|
protected AddressRange getAddressRange(Gadp.AddressRange range) {
|
||||||
AddressSpace space = model.getAddressSpace(range.getSpace());
|
AddressSpace space = model.getAddressSpace(range.getSpace());
|
||||||
if (space == null) {
|
if (space == null) {
|
||||||
|
|||||||
@@ -129,6 +129,15 @@ public abstract class AbstractAsyncServer<S extends AbstractAsyncServer<S, H>, H
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accept no more connections, but continue servicing existing connections
|
||||||
|
*
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
|
*/
|
||||||
|
protected void closeServerSocket() throws IOException {
|
||||||
|
ssock.close();
|
||||||
|
}
|
||||||
|
|
||||||
protected CompletableFuture<Void> allHandlers(Function<H, CompletableFuture<?>> action) {
|
protected CompletableFuture<Void> allHandlers(Function<H, CompletableFuture<?>> action) {
|
||||||
AsyncFence fence = new AsyncFence();
|
AsyncFence fence = new AsyncFence();
|
||||||
for (H h : handlers) {
|
for (H h : handlers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user