diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java index 45bad556f4..5e22cac140 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java +++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java @@ -15,6 +15,7 @@ */ package agent.gdb; +import java.util.List; import java.util.concurrent.CompletableFuture; import agent.gdb.manager.GdbManager; @@ -23,6 +24,7 @@ import agent.gdb.pty.linux.LinuxPtyFactory; import ghidra.dbg.DebuggerModelFactory; import ghidra.dbg.DebuggerObjectModel; import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; +import ghidra.dbg.util.ShellUtils; /** * Note this is in the testing source because it's not meant to be shipped in the release.... That @@ -49,8 +51,12 @@ public class GdbInJvmDebuggerModelFactory implements DebuggerModelFactory { @Override public CompletableFuture build() { // TODO: Choose Linux or Windows pty based on host OS + List gdbCmdLine = ShellUtils.parseArgs(gdbCmd); GdbModelImpl model = new GdbModelImpl(new LinuxPtyFactory()); - return model.startGDB(existing ? null : gdbCmd, new String[] {}).thenApply(__ -> model); + return model + .startGDB(existing ? null : gdbCmdLine.get(0), + gdbCmdLine.subList(1, gdbCmdLine.size()).toArray(String[]::new)) + .thenApply(__ -> model); } @Override diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java index a2c1a31d0b..ac5c73e666 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java +++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java @@ -15,12 +15,14 @@ */ package agent.gdb; +import java.util.List; import java.util.concurrent.CompletableFuture; import agent.gdb.model.impl.GdbModelImpl; import agent.gdb.pty.ssh.GhidraSshPtyFactory; import ghidra.dbg.DebuggerModelFactory; import ghidra.dbg.DebuggerObjectModel; +import ghidra.dbg.util.ShellUtils; import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; @FactoryDescription( @@ -66,6 +68,7 @@ public class GdbOverSshDebuggerModelFactory implements DebuggerModelFactory { @Override public CompletableFuture build() { + List gdbCmdLine = ShellUtils.parseArgs(gdbCmd); return CompletableFuture.supplyAsync(() -> { GhidraSshPtyFactory factory = new GhidraSshPtyFactory(); factory.setHostname(hostname); @@ -80,7 +83,10 @@ public class GdbOverSshDebuggerModelFactory implements DebuggerModelFactory { else { model.setUnixNewLine(); } - return model.startGDB(existing ? null : gdbCmd, new String[] {}).thenApply(__ -> model); + return model + .startGDB(existing ? null : gdbCmdLine.get(0), + gdbCmdLine.subList(1, gdbCmdLine.size()).toArray(String[]::new)) + .thenApply(__ -> model); }); } diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java index 51dc8299e4..f0a18b0a08 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java +++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java @@ -714,7 +714,12 @@ public class GdbManagerImpl implements GdbManager { * @return a future which completes when the rc commands are complete */ protected CompletableFuture rc() { - return AsyncUtils.NIL; + if (cliThread != null) { + return AsyncUtils.NIL; + } + else { + return console("set confirm off", CompletesWithRunning.CANNOT); + } } protected void resync() { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc index 7f8bb2b1e4..6f680996f7 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc @@ -2400,7 +2400,8 @@ void Heritage::heritage(void) } disjoint.add((*liter).first,(*liter).second.size,pass,prev); } - else { + else { // Partially contained in old range, but may contain new stuff + disjoint.add((*liter).first,(*liter).second.size,pass,prev); if ((!needwarning)&&(info->deadremoved>0)) { // TODO: We should check if this varnode is tiled by previously heritaged ranges if (vn->isHeritageKnown()) continue; // Assume that it is tiled and produced by merging @@ -2409,7 +2410,6 @@ void Heritage::heritage(void) bumpDeadcodeDelay(vn); warnvn = vn; } - disjoint.add((*liter).first,(*liter).second.size,pass,prev); } }