MCPcopy Create free account
hub / github.com/google/gapid / BeginCommand

Method BeginCommand

gapis/replay/builder/builder.go:234–256  ·  view source on GitHub ↗

BeginCommand should be called before building any replay instructions.

(cmdID, threadID uint64)

Source from the content-addressed store, hash-verified

232
233// BeginCommand should be called before building any replay instructions.
234func (b *Builder) BeginCommand(cmdID, threadID uint64) {
235 if b.inCmd {
236 panic("BeginCommand called while already building a command")
237 }
238 b.inCmd = true
239 b.cmdStart = len(b.instructions)
240
241 cmdID &= 0x3ffffff // Labels have 26 bit values.
242 if b.lastLabel != cmdID {
243 b.instructions = append(b.instructions, asm.Label{Value: uint32(cmdID)})
244 b.pendingLabel = cmdID
245 }
246
247 if b.currentThreadID != threadID {
248 b.pendingThreadID = threadID
249 index, ok := b.threadIDToIdx[threadID]
250 if !ok {
251 index = uint32(len(b.threadIDToIdx)) + 1
252 b.threadIDToIdx[threadID] = index
253 }
254 b.instructions = append(b.instructions, asm.SwitchThread{Index: index})
255 }
256}
257
258// CommitCommand should be called after emitting the commands to replay a single
259// command.

Callers 6

MutateAndWriteMethod · 0.80
TestCommitCommandFunction · 0.80
TestRevertCommandFunction · 0.80
TestMapMemoryFunction · 0.80
checkMethod · 0.80

Calls

no outgoing calls

Tested by 5

TestCommitCommandFunction · 0.64
TestRevertCommandFunction · 0.64
TestMapMemoryFunction · 0.64
checkMethod · 0.64