Skip to content

Commit

Permalink
GP-0: Fix tests
Browse files Browse the repository at this point in the history
Fix GdbCommandsTest.testLcsp
Don't take user's transaction in ghidralldb.commands.put_state
  • Loading branch information
nsadeveloper789 committed Mar 26, 2024
1 parent b070f86 commit 2e27ca3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1416,15 +1416,13 @@ def put_processes():


def put_state(event_process):
STATE.require_no_tx()
STATE.tx = STATE.require_trace().start_tx("state", undoable=False)
ipath = PROCESS_PATTERN.format(procnum=event_process.GetProcessID())
procobj = STATE.trace.create_object(ipath)
state = "STOPPED" if event_process.is_stopped else "RUNNING"
procobj.set_value('_state', state)
procobj.insert()
STATE.require_tx().commit()
STATE.reset_tx()
with STATE.client.batch():
with STATE.require_trace().open_tx('State'):
procobj = STATE.trace.create_object(ipath)
state = "STOPPED" if event_process.is_stopped else "RUNNING"
procobj.set_value('_state', state)
procobj.insert()


@convert_errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void testLcsp() throws Exception {
quit
""".formatted(PREAMBLE));
assertEquals("""
Selected Ghidra language: DATA:LE:64:default
Selected Ghidra language: x86:LE:32:default
Selected Ghidra compiler: pointer64""",
extractOutSection(out, "---Import---"));
assertEquals("""
Expand Down

0 comments on commit 2e27ca3

Please sign in to comment.