mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-930: Tests, diagnostics, attempted MWE, OTE fixes
This commit is contained in:
parent
10674175bb
commit
73ba6b28d0
17 changed files with 755 additions and 262 deletions
|
@ -80,15 +80,17 @@ public abstract class AbstractTargetObject<P extends TargetObject> implements Sp
|
|||
this.path = PathUtils.extend(parent.getPath(), key);
|
||||
}
|
||||
|
||||
model.removeExisting(path);
|
||||
synchronized (model.lock) {
|
||||
model.removeExisting(path);
|
||||
|
||||
this.hash = computeHashCode();
|
||||
this.typeHint = typeHint;
|
||||
this.hash = computeHashCode();
|
||||
this.typeHint = typeHint;
|
||||
|
||||
this.schema = schema;
|
||||
this.proxy = proxyFactory.createProxy(this, proxyInfo);
|
||||
this.schema = schema;
|
||||
this.proxy = proxyFactory.createProxy(this, proxyInfo);
|
||||
|
||||
fireCreated();
|
||||
fireCreated();
|
||||
}
|
||||
}
|
||||
|
||||
public AbstractTargetObject(AbstractDebuggerObjectModel model, P parent, String key,
|
||||
|
|
|
@ -28,6 +28,20 @@ import ghidra.dbg.util.ConfigurableFactory.Property;
|
|||
import ghidra.dbg.util.PathUtils.PathComparator;
|
||||
|
||||
public abstract class AbstractModelHost implements ModelHost, DebuggerModelTestUtils {
|
||||
|
||||
public class WithoutThreadValidationImpl implements WithoutThreadValidation {
|
||||
public WithoutThreadValidationImpl() {
|
||||
withoutThreadValCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
withoutThreadValCount--;
|
||||
}
|
||||
}
|
||||
|
||||
private int withoutThreadValCount = 0;
|
||||
|
||||
protected DebuggerObjectModel model;
|
||||
public CallbackValidator callbackValidator;
|
||||
public EventValidator eventValidator;
|
||||
|
@ -74,7 +88,7 @@ public abstract class AbstractModelHost implements ModelHost, DebuggerModelTestU
|
|||
|
||||
@Override
|
||||
public void validateCompletionThread() {
|
||||
if (callbackValidator != null) {
|
||||
if (callbackValidator != null && withoutThreadValCount == 0) {
|
||||
callbackValidator.validateCompletionThread();
|
||||
}
|
||||
}
|
||||
|
@ -169,6 +183,11 @@ public abstract class AbstractModelHost implements ModelHost, DebuggerModelTestU
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WithoutThreadValidation withoutThreadValidation() {
|
||||
return new WithoutThreadValidationImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetObjectAddedWaiter getAddedWaiter() {
|
||||
return waiter;
|
||||
|
|
|
@ -276,7 +276,7 @@ public class CallbackValidator implements DebuggerModelListener, AutoCloseable {
|
|||
fail("created twice (same object): " + object.getJoinedPath("."));
|
||||
}
|
||||
else {
|
||||
fail("replaced before invalidation. old= " + exists + ", new=" + object);
|
||||
fail("replaced before invalidation. old=" + exists.object + ", new=" + object);
|
||||
}
|
||||
}
|
||||
validateCallbackThread("created");
|
||||
|
|
|
@ -23,6 +23,9 @@ import ghidra.dbg.target.TargetObject;
|
|||
|
||||
public interface TestDebuggerModelProvider {
|
||||
interface ModelHost extends AutoCloseable {
|
||||
interface WithoutThreadValidation extends AutoCloseable {
|
||||
}
|
||||
|
||||
Map<String, Object> getFactoryOptions();
|
||||
|
||||
ModelHost build() throws Throwable;
|
||||
|
@ -57,6 +60,8 @@ public interface TestDebuggerModelProvider {
|
|||
|
||||
boolean hasProcessContainer();
|
||||
|
||||
WithoutThreadValidation withoutThreadValidation();
|
||||
|
||||
<T extends TargetObject> T find(Class<T> cls, List<String> seedPath) throws Throwable;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue