GP-2023: post-review modifications

This commit is contained in:
d-millar 2022-06-10 22:02:10 +00:00
parent 5f1367d2a8
commit 097421553c
7 changed files with 15 additions and 19 deletions

View file

@ -371,4 +371,6 @@ public interface DbgManager extends AutoCloseable, DbgBreakpointInsertions {
DebugEventInformation getLastEventInformation(); DebugEventInformation getLastEventInformation();
DbgSession getSessionComputeIfAbsent(DebugSessionId debugSessionId, boolean b);
} }

View file

@ -25,8 +25,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import agent.dbgeng.dbgeng.DebugSessionId; import agent.dbgeng.dbgeng.DebugSessionId;
import agent.dbgeng.manager.DbgManager; import agent.dbgeng.manager.DbgManager;
import agent.dbgeng.manager.impl.DbgManagerImpl; import agent.dbgeng.manager.DbgSession;
import agent.dbgeng.manager.impl.DbgSessionImpl;
import agent.dbgeng.model.AbstractDbgModel; import agent.dbgeng.model.AbstractDbgModel;
import agent.dbgeng.model.iface2.*; import agent.dbgeng.model.iface2.*;
import ghidra.async.AsyncUtils; import ghidra.async.AsyncUtils;
@ -54,7 +53,7 @@ public class DbgModelImpl extends AbstractDbgModel implements DebuggerObjectMode
protected final AddressFactory addressFactory = protected final AddressFactory addressFactory =
new DefaultAddressFactory(new AddressSpace[] { space }); new DefaultAddressFactory(new AddressSpace[] { space });
protected final DbgManagerImpl dbg; protected final DbgManager dbg;
protected final DbgModelTargetRootImpl root; protected final DbgModelTargetRootImpl root;
protected final DbgModelTargetSessionImpl session; protected final DbgModelTargetSessionImpl session;
@ -64,11 +63,11 @@ public class DbgModelImpl extends AbstractDbgModel implements DebuggerObjectMode
private boolean suppressDescent = false; private boolean suppressDescent = false;
public DbgModelImpl() { public DbgModelImpl() {
this.dbg = (DbgManagerImpl) DbgManager.newInstance(); this.dbg = DbgManager.newInstance();
//System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX)); //System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX));
this.root = new DbgModelTargetRootImpl(this, ROOT_SCHEMA); this.root = new DbgModelTargetRootImpl(this, ROOT_SCHEMA);
this.completedRoot = CompletableFuture.completedFuture(root); this.completedRoot = CompletableFuture.completedFuture(root);
DbgSessionImpl s = dbg.getSessionComputeIfAbsent(new DebugSessionId(0), true); DbgSession s = dbg.getSessionComputeIfAbsent(new DebugSessionId(0), true);
DbgModelTargetSessionContainer sessions = root.sessions; DbgModelTargetSessionContainer sessions = root.sessions;
this.session = (DbgModelTargetSessionImpl) sessions.getTargetSession(s); this.session = (DbgModelTargetSessionImpl) sessions.getTargetSession(s);
addModelRoot(root); addModelRoot(root);
@ -121,8 +120,8 @@ public class DbgModelImpl extends AbstractDbgModel implements DebuggerObjectMode
} }
@Override @Override
public DbgManagerImpl getManager() { public DbgManager getManager() {
return (DbgManagerImpl) dbg; return dbg;
} }
@Override @Override
@ -181,6 +180,7 @@ public class DbgModelImpl extends AbstractDbgModel implements DebuggerObjectMode
}); });
} }
@Override
public boolean isSuppressDescent() { public boolean isSuppressDescent() {
return suppressDescent; return suppressDescent;
} }

View file

@ -67,12 +67,8 @@ public class DbgModelTargetTraceOrDumpConnectorImpl extends DbgModelTargetObject
true, ".opendump", "Cmd", "native loader command"); true, ".opendump", "Cmd", "native loader command");
ParameterDescription<String> p2 = ParameterDescription.create(String.class, "TraceOrDump", ParameterDescription<String> p2 = ParameterDescription.create(String.class, "TraceOrDump",
true, "", "File", "trace or dump to be loaded"); true, "", "File", "trace or dump to be loaded");
ParameterDescription<Boolean> p3 = ParameterDescription.create(Boolean.class,
"UseQueryVirtual", false, true, "QueryVirtual", "use QueryVirtual (vs. !address)");
map.put("CommandLine", p1); map.put("CommandLine", p1);
map.put("TraceOrDump", p2); map.put("TraceOrDump", p2);
// For the moment, we'll leave this out (deadlocks the GUI)
//map.put("UseQueryVirtual", p3);
return map; return map;
} }

View file

@ -65,7 +65,7 @@ public class KeyEnumeratorImpl implements KeyEnumeratorInternal {
} }
COMUtils.checkRC(hr); COMUtils.checkRC(hr);
} }
catch (RuntimeException e) { catch (Error e) {
Msg.error(this, e.getMessage()); Msg.error(this, e.getMessage());
} }

View file

@ -200,6 +200,7 @@ public class DbgModel2Impl extends AbstractDbgModel
}); });
} }
@Override
public boolean isSuppressDescent() { public boolean isSuppressDescent() {
return suppressDescent; return suppressDescent;
} }

View file

@ -1007,6 +1007,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
groupTargetIndex++; groupTargetIndex++;
/*
actionSuppressDescent = new ToggleActionBuilder("Automatically populate containers", plugin.getName()) actionSuppressDescent = new ToggleActionBuilder("Automatically populate containers", plugin.getName())
.menuPath("Maintenance","&Auto-populate") .menuPath("Maintenance","&Auto-populate")
.menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex)
@ -1015,6 +1016,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
.selected(isUpdateWhileRunning()) .selected(isUpdateWhileRunning())
.enabled(true) .enabled(true)
.buildAndInstallLocal(this); .buildAndInstallLocal(this);
*/
groupTargetIndex = 0; groupTargetIndex = 0;
@ -1448,6 +1450,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
refresh(""); refresh("");
} }
/*
public void performToggleAutoPopulateContainers(ActionContext context) { public void performToggleAutoPopulateContainers(ActionContext context) {
suppressDescent = !actionSuppressDescent.isSelected(); suppressDescent = !actionSuppressDescent.isSelected();
if (currentModel != null) { if (currentModel != null) {
@ -1455,6 +1458,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
} }
refresh(""); refresh("");
} }
*/
protected <T extends TargetObject> void performAction(ActionContext context, protected <T extends TargetObject> void performAction(ActionContext context,
boolean fallbackRoot, Class<T> cls, boolean fallbackRoot, Class<T> cls,

View file

@ -581,11 +581,4 @@ public interface DebuggerObjectModel {
*/ */
CompletableFuture<Void> flushEvents(); CompletableFuture<Void> flushEvents();
/**
* If the model permits, suppress automatic descent into containers
*/
default void setSuppressDescent(boolean suppressDescent) {
// Do nothing by default
}
} }