mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0: fix for broken attach logic (from 3142)
This commit is contained in:
parent
022af8fa09
commit
33958e386d
2 changed files with 9 additions and 4 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue