From 6f79a6f1db56f79daa9f1a0b08252fbf9a6d13d0 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:42:00 -0500 Subject: [PATCH] GP-0: Fix DummyProc (DebuggerTests) --- .../java/ghidra/pty/testutil/DummyProc.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Ghidra/Framework/Pty/src/test/java/ghidra/pty/testutil/DummyProc.java b/Ghidra/Framework/Pty/src/test/java/ghidra/pty/testutil/DummyProc.java index 8db0ec9f54..0152751bda 100644 --- a/Ghidra/Framework/Pty/src/test/java/ghidra/pty/testutil/DummyProc.java +++ b/Ghidra/Framework/Pty/src/test/java/ghidra/pty/testutil/DummyProc.java @@ -19,6 +19,7 @@ import java.io.*; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.stream.Stream; import generic.jar.ResourceFile; import ghidra.framework.Application; @@ -39,9 +40,20 @@ public class DummyProc implements AutoCloseable { // just try next strategy } + List mods = Stream.concat(Application.getApplicationRootDirectories() + .stream() + .map(ar -> new ResourceFile(ar, "Test/DebuggerIntegrationTest")), + Application.getModuleRootDirectories().stream()) + .toList(); + // Try the build/exe// and build/exe/// directory try { - for (ResourceFile modRoot : Application.getModuleRootDirectories()) { + for (ResourceFile modRoot : mods) { + ResourceFile osExe = new ResourceFile(modRoot, + "build/os/" + Platform.CURRENT_PLATFORM.getDirectoryName() + "/" + cmd); + if (osExe.exists() && osExe.getFile(false).canExecute()) { + return osExe.getAbsolutePath(); + } ResourceFile exe = new ResourceFile(modRoot, "build/exe/" + cmd + "/" + cmd); if (exe.exists() && exe.getFile(false).canExecute()) { return exe.getAbsolutePath(); @@ -53,8 +65,8 @@ public class DummyProc implements AutoCloseable { return platformExe.getAbsolutePath(); } platformExe = new ResourceFile(modRoot, - "build/exe/" + cmd + "/" + Platform.CURRENT_PLATFORM.getDirectoryName() + "/" + - cmd + ".exe"); + "build/exe/" + cmd + "/" + Platform.CURRENT_PLATFORM.getDirectoryName() + "/" + + cmd + ".exe"); if (platformExe.exists() && platformExe.getFile(false).canExecute()) { return platformExe.getAbsolutePath(); }