mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: fix for broken attach logic (from 3142)
This commit is contained in:
@@ -1595,8 +1595,10 @@ public class DbgManagerImpl implements DbgManager {
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> setActiveThread(DbgThread thread) {
|
||||
if (thread == null || thread.getTid().equals(currentThread.getTid())) {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
if (currentThread != null) {
|
||||
if (thread == null || thread.getTid().equals(currentThread.getTid())) {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
}
|
||||
currentThread = thread;
|
||||
currentProcess = thread.getProcess();
|
||||
@@ -1604,8 +1606,10 @@ public class DbgManagerImpl implements DbgManager {
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> setActiveProcess(DbgProcess process) {
|
||||
if (process == null || process.getPid().equals(currentProcess.getPid())) {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
if (currentProcess != null) {
|
||||
if (process == null || process.getPid().equals(currentProcess.getPid())) {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
}
|
||||
currentProcess = process;
|
||||
return execute(new DbgSetActiveProcessCommand(this, process));
|
||||
|
||||
@@ -262,6 +262,7 @@ public class DbgProcessImpl implements DbgProcess {
|
||||
return sequence(TypeSpec.cls(DbgThread.class).set()).then((seq) -> {
|
||||
setActive().handle(seq::next);
|
||||
}).then((seq) -> {
|
||||
id = new DebugProcessRecord(toPid);
|
||||
pid = toPid; // TODO: Wait for successful completion?
|
||||
manager.execute(
|
||||
new DbgAttachCommand(manager, this, BitmaskSet.of(DebugAttachFlags.DEFAULT)))
|
||||
|
||||
Reference in New Issue
Block a user