Skip to content

Commit 318cfe8

Browse files
committed
Tracing mode support
1 parent 7c67eb6 commit 318cfe8

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/kotlin/be/ugent/topl/mio/debugger/Debugger.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ open class Debugger(private val connection: Connection, start: Boolean = true, p
458458
return super.serialize() + HexaEncoder.serializeUInt32BE(interval)
459459
}
460460
}
461+
data class Tracing(val states: List<ExecutionState>, val minimumArgCount: Int = 1) : SnapshotPolicy(3) {
462+
override fun serialize(): String {
463+
return super.serialize() +
464+
HexaEncoder.convertToLEB128(minimumArgCount) +
465+
HexaEncoder.convertToLEB128(states.size) +
466+
states.joinToString("") { HexaEncoder.convertToLEB128(it.ordinal + 1) }
467+
}
468+
}
461469
}
462470

463471
fun setSnapshotPolicy(policy: SnapshotPolicy) {

src/main/kotlin/be/ugent/topl/mio/woodstate/WOODState.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ data class Checkpoint(
156156
val instructions_executed: Int,
157157
val fidx_called: Int?,
158158
val args: List<Int>?,
159-
val snapshot: WOODDumpResponse
159+
val snapshot: WOODDumpResponse,
160+
val returns: List<Int>?
160161
)
161162

162163
class WOODState(woodResponse: WOODDumpResponse) {

0 commit comments

Comments
 (0)