// targetpc and off together are the key of this cache entry.
targetpc uintptr
off uint32
- // val is the value of this cached pcvalue entry.
- val int32
+
+ val int32 // The value of this entry.
+ valPC uintptr // The PC at which val starts
}
// pcvalueCacheKey returns the outermost index in a pcvalueCache to use for targetpc.
}
// Returns the PCData value, and the PC where this value starts.
-// TODO: the start PC is returned only when cache is nil.
func pcvalue(f funcInfo, off uint32, targetpc uintptr, cache *pcvalueCache, strict bool) (int32, uintptr) {
if off == 0 {
return -1, 0
// fail in the first clause.
ent := &cache.entries[x][i]
if ent.off == off && ent.targetpc == targetpc {
- return ent.val, 0
+ return ent.val, ent.valPC
}
}
}
targetpc: targetpc,
off: off,
val: val,
+ valPC: prevpc,
}
}