mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-27 06:30:51 +00:00
GP-0: Fix DBTraceObject.getCanonicalParent(snap)
This commit is contained in:
parent
14f7e1f458
commit
8a3faa73dc
@ -147,6 +147,11 @@ public class DBTraceObjectValue implements TraceObjectValue {
|
||||
this.wrapped = wrapped;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return wrapped.toString();
|
||||
}
|
||||
|
||||
void setWrapped(TraceObjectValueStorage wrapped) {
|
||||
this.wrapped = wrapped;
|
||||
if (wrapped instanceof DBTraceObjectValueData data) {
|
||||
|
@ -43,6 +43,12 @@ public class DBTraceObjectValueBehind implements TraceObjectValueStorage {
|
||||
this.wrapper = new DBTraceObjectValue(manager, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "<%s parent=%s entryKey=%s lifespan=%s value=%s>".formatted(
|
||||
getClass().getSimpleName(), parent, entryKey, lifespan, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntryKey() {
|
||||
return entryKey;
|
||||
|
@ -222,18 +222,17 @@ class DBTraceObjectValueWriteBehindCache {
|
||||
public Stream<DBTraceObjectValueBehind> streamCanonicalParents(DBTraceObject child,
|
||||
Lifespan lifespan) {
|
||||
TraceObjectKeyPath path = child.getCanonicalPath();
|
||||
if (path.isRoot()) {
|
||||
TraceObjectKeyPath parentPath = path.parent();
|
||||
if (parentPath == null) { // child is the root
|
||||
return Stream.of();
|
||||
}
|
||||
DBTraceObject parent = manager.getObjectByCanonicalPath(parentPath);
|
||||
if (parent == null) {
|
||||
// Not inserted yet, or someone deleted the parent object
|
||||
return Stream.of();
|
||||
}
|
||||
String entryKey = path.key();
|
||||
// TODO: Better indexing?
|
||||
return cachedValues.values()
|
||||
.stream()
|
||||
.flatMap(v -> v.entrySet()
|
||||
.stream()
|
||||
.filter(e -> entryKey.equals(e.getKey()))
|
||||
.map(e -> e.getValue()))
|
||||
.flatMap(v -> streamSub(v, lifespan, true));
|
||||
return streamValues(parent, entryKey, lifespan, true);
|
||||
}
|
||||
|
||||
public Stream<DBTraceObjectValueBehind> streamValues(DBTraceObject parent, Lifespan lifespan) {
|
||||
|
@ -108,7 +108,6 @@ public class GdbMethodsTest extends AbstractGdbTraceRmiTest {
|
||||
file bash
|
||||
ghidra trace start
|
||||
%s
|
||||
ghidra trace tx-open "Fake" 'ghidra trace create-obj Breakpoints'
|
||||
starti"""
|
||||
.formatted(INSTRUMENT_STOPPED));
|
||||
RemoteMethod refreshBreakpoints = conn.getMethod("refresh_breakpoints");
|
||||
|
Loading…
Reference in New Issue
Block a user