Skip to content

Commit 4473fc2

Browse files
committed
Tracing mode support
1 parent 45bcdfe commit 4473fc2

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
@@ -470,6 +470,14 @@ open class Debugger(private val connection: Connection, start: Boolean = true, p
470470
return super.serialize() + HexaEncoder.serializeUInt32BE(interval)
471471
}
472472
}
473+
data class Tracing(val states: List<ExecutionState>, val minimumArgCount: Int = 1) : SnapshotPolicy(3) {
474+
override fun serialize(): String {
475+
return super.serialize() +
476+
HexaEncoder.convertToLEB128(minimumArgCount) +
477+
HexaEncoder.convertToLEB128(states.size) +
478+
states.joinToString("") { HexaEncoder.convertToLEB128(it.ordinal + 1) }
479+
}
480+
}
473481
}
474482

475483
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
@@ -157,7 +157,8 @@ data class Checkpoint(
157157
val instructions_executed: Int,
158158
val fidx_called: Int?,
159159
val args: List<Int>?,
160-
val snapshot: WOODDumpResponse
160+
val snapshot: WOODDumpResponse,
161+
val returns: List<Int>?
161162
)
162163

163164
class WOODState(woodResponse: WOODDumpResponse) {

0 commit comments

Comments
 (0)