processAdded should guarantee the session is now accessible

This commit is contained in:
d-millar 2020-12-31 19:10:13 +00:00
parent f102bf0cc1
commit 37e3b715cd
2 changed files with 4 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import agent.dbgeng.dbgeng.DebugProcessId;
import agent.dbgeng.dbgeng.DebugThreadId;
import agent.dbgeng.manager.*;
import agent.dbgeng.model.iface2.*;
import ghidra.dbg.target.TargetAccessConditioned.TargetAccessibility;
import ghidra.dbg.target.TargetObject;
import ghidra.util.datastruct.WeakValueHashMap;
@ -41,6 +42,8 @@ public class DbgModelTargetProcessContainerImpl extends DbgModelTargetObjectImpl
@Override
public void processAdded(DbgProcess proc, DbgCause cause) {
DbgModelTargetSession session = (DbgModelTargetSession) getImplParent();
session.setAccessibility(TargetAccessibility.ACCESSIBLE);
DbgModelTargetProcess process = getTargetProcess(proc);
changeElements(List.of(), List.of(process), Map.of(), "Added");
process.processStarted(proc.getPid());

View File

@ -326,11 +326,11 @@ public class ObjectTree implements ObjectPane {
public void setFocus(TargetFocusScope<?> object, TargetObjectRef focused) {
Swing.runIfSwingOrRunLater(() -> {
List<String> path = focused.getPath();
tree.setSelectedNodeByNamePath(addRootNameToPath(path));
ObjectContainer container = getProvider().getContainerByPath(path);
if (container != null) {
container.subscribe();
}
tree.setSelectedNodeByNamePath(addRootNameToPath(path));
});
}