return false
}
f := findfunc(uintptr(ctxt.rip()))
- if !(hasprefix(funcname(f), "runtime.debugCall") || hasprefix(funcname(f), "debugCall")) {
+ if !(hasPrefix(funcname(f), "runtime.debugCall") || hasPrefix(funcname(f), "debugCall")) {
println("trap in unknown function", funcname(f))
return false
}
// level by the program but will otherwise be ignored.
flags = _SigNotify
for sig, t = range sigtable {
- if hasprefix(notestr, t.name) {
+ if hasPrefix(notestr, t.name) {
flags = t.flags
break
}
}
func atolwhex(p string) int64 {
- for hasprefix(p, " ") || hasprefix(p, "\t") {
+ for hasPrefix(p, " ") || hasPrefix(p, "\t") {
p = p[1:]
}
neg := false
- if hasprefix(p, "-") || hasprefix(p, "+") {
+ if hasPrefix(p, "-") || hasPrefix(p, "+") {
neg = p[0] == '-'
p = p[1:]
- for hasprefix(p, " ") || hasprefix(p, "\t") {
+ for hasPrefix(p, " ") || hasPrefix(p, "\t") {
p = p[1:]
}
}
var n int64
switch {
- case hasprefix(p, "0x"), hasprefix(p, "0X"):
+ case hasPrefix(p, "0x"), hasPrefix(p, "0X"):
p = p[2:]
for ; len(p) > 0; p = p[1:] {
if '0' <= p[0] && p[0] <= '9' {
break
}
}
- case hasprefix(p, "0"):
+ case hasPrefix(p, "0"):
for ; len(p) > 0 && '0' <= p[0] && p[0] <= '7'; p = p[1:] {
n = n*8 + int64(p[0]-'0')
}
p := argv_index(argv, argc+1+i)
s := *(*string)(unsafe.Pointer(&stringStruct{unsafe.Pointer(p), findnull(p)}))
- if hasprefix(s, prefix) {
+ if hasPrefix(s, prefix) {
env = gostring(p)[len(prefix):]
break
}
// received from somewhere else (with _LostSIGPROFDuringAtomic64 as pc).
if GOARCH == "mips" || GOARCH == "mipsle" || GOARCH == "arm" {
if f := findfunc(pc); f.valid() {
- if hasprefix(funcname(f), "runtime/internal/atomic") {
+ if hasPrefix(funcname(f), "runtime/internal/atomic") {
lostAtomic64Count++
return
}
return 0
}
for i := 0; i < len(s); i++ {
- if s[i] == t[0] && hasprefix(s[i:], t) {
+ if s[i] == t[0] && hasPrefix(s[i:], t) {
return i
}
}
return index(s, t) >= 0
}
-func hasprefix(s, t string) bool {
- return len(s) >= len(t) && s[:len(t)] == t
+func hasPrefix(s, prefix string) bool {
+ return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
const (
return true
}
- return contains(name, ".") && (!hasprefix(name, "runtime.") || isExportedRuntime(name))
+ return contains(name, ".") && (!hasPrefix(name, "runtime.") || isExportedRuntime(name))
}
// isExportedRuntime reports whether name is an exported runtime function.
// back into user code.
return !fingRunning
}
- return hasprefix(funcname(f), "runtime.")
+ return hasPrefix(funcname(f), "runtime.")
}
// SetCgoTraceback records three C functions to use to gather
}
}
-func hasPrefix(s, prefix string) bool {
- return len(s) >= len(prefix) && s[:len(prefix)] == prefix
-}
-
func (t *_type) name() string {
if t.tflag&tflagNamed == 0 {
return ""