]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: rename _func.nameoff and friends to nameOff
authorMichael Pratt <mpratt@google.com>
Tue, 6 Sep 2022 21:57:07 +0000 (17:57 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 7 Sep 2022 15:11:05 +0000 (15:11 +0000)
Switch to the more Go-style name to match inlinedCall.nameOff.

Change-Id: I2115b27af8309e1ead7d61ecc65fe4fc966030f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/428657
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/preempt.go
src/runtime/race.go
src/runtime/runtime2.go
src/runtime/symtab.go
src/runtime/traceback.go

index 815df86269d9198a9419702395095f5fa5455b8c..4f62fc628b6608a19a76e2a27d4ff3e22de1513c 100644 (file)
@@ -418,7 +418,7 @@ func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) (bool, uintptr) {
                inltree := (*[1 << 20]inlinedCall)(inldata)
                ix := pcdatavalue(f, _PCDATA_InlTreeIndex, pc, nil)
                if ix >= 0 {
-                       name = funcnameFromNameoff(f, inltree[ix].nameOff)
+                       name = funcnameFromNameOff(f, inltree[ix].nameOff)
                }
        }
        if hasPrefix(name, "runtime.") ||
index 15048f40218e0e04fa90fbdec4d43dd8ea39c3cd..f68e1aeaaca6a2d8f39c8e9f025ad0b386d1156e 100644 (file)
@@ -187,7 +187,7 @@ func raceSymbolizeCode(ctx *symbolizeCodeContext) {
                                                        continue
                                                }
                                                ctx.pc = f.Entry() + uintptr(inltree[ix].parentPc) // "caller" pc
-                                               ctx.fn = cfuncnameFromNameoff(fi, inltree[ix].nameOff)
+                                               ctx.fn = cfuncnameFromNameOff(fi, inltree[ix].nameOff)
                                                ctx.line = uintptr(line)
                                                ctx.file = &bytes(file)[0] // assume NUL-terminated
                                                ctx.off = pc - f.Entry()
index 40d3805808819785d003c051c75adbf2fb2bf066..7fdf1634404ca6200e6de87c3c59d5dbae11ad15 100644 (file)
@@ -859,7 +859,7 @@ const (
 // and with package debug/gosym and with symtab.go in package runtime.
 type _func struct {
        entryoff uint32 // start pc, as offset from moduledata.text/pcHeader.textStart
-       nameoff  int32  // function name
+       nameOff  int32  // function name, as index into moduledata.funcnametab.
 
        args        int32  // in/out args size
        deferreturn uint32 // offset of start of a deferreturn call instruction from entry, if any.
index 78c49b0dbc451d556aee157704d6203dc4d0bd70..b7bf7d77a965be494bda554298176f71eb848b8d 100644 (file)
@@ -116,7 +116,7 @@ func (ci *Frames) Next() (frame Frame, more bool) {
                        if ix >= 0 {
                                // Note: entry is not modified. It always refers to a real frame, not an inlined one.
                                f = nil
-                               name = funcnameFromNameoff(funcInfo, inltree[ix].nameOff)
+                               name = funcnameFromNameOff(funcInfo, inltree[ix].nameOff)
                                // File/line from funcline1 below are already correct.
                        }
                }
@@ -726,7 +726,7 @@ func FuncForPC(pc uintptr) *Func {
                // The runtime currently doesn't have function end info, alas.
                if ix := pcdatavalue1(f, _PCDATA_InlTreeIndex, pc, nil, false); ix >= 0 {
                        inltree := (*[1 << 20]inlinedCall)(inldata)
-                       name := funcnameFromNameoff(f, inltree[ix].nameOff)
+                       name := funcnameFromNameOff(f, inltree[ix].nameOff)
                        file, line := funcline(f, pc)
                        fi := &funcinl{
                                ones:  ^uint32(0),
@@ -967,10 +967,10 @@ func pcvalue(f funcInfo, off uint32, targetpc uintptr, cache *pcvalueCache, stri
 }
 
 func cfuncname(f funcInfo) *byte {
-       if !f.valid() || f.nameoff == 0 {
+       if !f.valid() || f.nameOff == 0 {
                return nil
        }
-       return &f.datap.funcnametab[f.nameoff]
+       return &f.datap.funcnametab[f.nameOff]
 }
 
 func funcname(f funcInfo) string {
@@ -993,15 +993,15 @@ func funcpkgpath(f funcInfo) string {
        return name[:i]
 }
 
-func cfuncnameFromNameoff(f funcInfo, nameoff int32) *byte {
+func cfuncnameFromNameOff(f funcInfo, nameOff int32) *byte {
        if !f.valid() {
                return nil
        }
-       return &f.datap.funcnametab[nameoff]
+       return &f.datap.funcnametab[nameOff]
 }
 
-func funcnameFromNameoff(f funcInfo, nameoff int32) string {
-       return gostringnocopy(cfuncnameFromNameoff(f, nameoff))
+func funcnameFromNameOff(f funcInfo, nameOff int32) string {
+       return gostringnocopy(cfuncnameFromNameOff(f, nameOff))
 }
 
 func funcfile(f funcInfo, fileno int32) string {
index 96acec0ddd615133079000af6c70f5c69e3549f7..396b3fafbc582d32324ce712cead7260ab96d07e 100644 (file)
@@ -405,7 +405,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
 
                                        // Create a fake _func for the
                                        // inlined function.
-                                       inlFunc.nameoff = inltree[ix].nameOff
+                                       inlFunc.nameOff = inltree[ix].nameOff
                                        inlFunc.funcID = inltree[ix].funcID
 
                                        if (flags&_TraceRuntimeFrames) != 0 || showframe(inlFuncInfo, gp, nprint == 0, inlFuncInfo.funcID, lastFuncID) {
@@ -808,7 +808,7 @@ func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) {
                inltree := (*[1 << 20]inlinedCall)(inldata)
                ix := pcdatavalue(f, _PCDATA_InlTreeIndex, pc, nil)
                if ix >= 0 {
-                       name = funcnameFromNameoff(f, inltree[ix].nameOff)
+                       name = funcnameFromNameOff(f, inltree[ix].nameOff)
                }
        }
        file, line := funcline(f, pc)
@@ -852,7 +852,7 @@ func showframe(f funcInfo, gp *g, firstFrame bool, funcID, childID funcID) bool
 // be printed during a traceback.
 func showfuncinfo(f funcInfo, firstFrame bool, funcID, childID funcID) bool {
        // Note that f may be a synthesized funcInfo for an inlined
-       // function, in which case only nameoff and funcID are set.
+       // function, in which case only nameOff and funcID are set.
 
        level, _, _ := gotraceback()
        if level > 1 {