mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-0: (lldb) Remove duplicative refresh_breakpoints and its test.
This commit is contained in:
parent
f5354381cf
commit
15c0ff7099
2 changed files with 5 additions and 53 deletions
|
@ -15,9 +15,10 @@
|
|||
*/
|
||||
package agent.lldb.rmi;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assume.*;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -92,45 +93,6 @@ public class LldbMethodsTest extends AbstractLldbTraceRmiTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRefreshBreakpoints() throws Exception {
|
||||
try (LldbAndConnection conn = startAndConnectLldb()) {
|
||||
start(conn, getSpecimenPrint());
|
||||
txPut(conn, "processes");
|
||||
|
||||
RemoteMethod refreshBreakpoints = conn.getMethod("refresh_breakpoints");
|
||||
try (ManagedDomainObject mdo = openDomainObject("/New Traces/lldb/expPrint")) {
|
||||
tb = new ToyDBTraceBuilder((Trace) mdo.get());
|
||||
//waitStopped(conn);
|
||||
|
||||
conn.execute("breakpoint set --name main");
|
||||
conn.execute("breakpoint set -H --name main");
|
||||
txPut(conn, "breakpoints");
|
||||
TraceObject breakpoints = Objects.requireNonNull(tb.objAny0("Breakpoints"));
|
||||
refreshBreakpoints.invoke(Map.of("node", breakpoints));
|
||||
|
||||
List<TraceObjectValue> procBreakLocVals = tb.trace.getObjectManager()
|
||||
.getValuePaths(Lifespan.at(0),
|
||||
PathFilter.parse("Processes[].Breakpoints[]"))
|
||||
.map(p -> p.getLastEntry())
|
||||
.sorted(Comparator.comparing(TraceObjectValue::getEntryKey))
|
||||
.toList();
|
||||
assertEquals(2, procBreakLocVals.size());
|
||||
AddressRange rangeMain =
|
||||
procBreakLocVals.get(0).getChild().getValue(0, "_range").castValue();
|
||||
Address main = rangeMain.getMinAddress();
|
||||
|
||||
// The temporary breakpoint uses up number 1
|
||||
assertBreakLoc(procBreakLocVals.get(0), "[1.1]", main, 1,
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE),
|
||||
"main");
|
||||
assertBreakLoc(procBreakLocVals.get(1), "[2.1]", main, 1,
|
||||
Set.of(TraceBreakpointKind.HW_EXECUTE),
|
||||
"main");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRefreshProcBreakpoints() throws Exception {
|
||||
try (LldbAndConnection conn = startAndConnectLldb()) {
|
||||
|
@ -151,9 +113,9 @@ public class LldbMethodsTest extends AbstractLldbTraceRmiTest {
|
|||
|
||||
List<TraceObjectValue> procBreakLocVals = tb.trace.getObjectManager()
|
||||
.getValuePaths(Lifespan.at(0),
|
||||
PathFilter.parse("Processes[].Breakpoints[][1]"))
|
||||
PathFilter.parse("Processes[].Breakpoints[][]"))
|
||||
.map(p -> p.getLastEntry())
|
||||
.sorted(Comparator.comparing(TraceObjectValue::getEntryKey))
|
||||
.sorted(Comparator.comparing(TraceObjectValue::getCanonicalPath))
|
||||
.toList();
|
||||
assertEquals(2, procBreakLocVals.size());
|
||||
AddressRange rangeMain =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue