From 97855d171e0e613fed567c23039bbccae3e84f29 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Fri, 10 May 2024 01:26:06 +0800 Subject: [PATCH] debug/gosym: update field count to 1.20+ The _func structure in src/runtime/runtime2.go includes a startLine field in versions after 1.20, which extends the total number of fields to 10 --- src/debug/gosym/pclntab.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/gosym/pclntab.go b/src/debug/gosym/pclntab.go index 1d5498e0376..afa3a2ec1fc 100644 --- a/src/debug/gosym/pclntab.go +++ b/src/debug/gosym/pclntab.go @@ -467,10 +467,10 @@ func (f funcData) pcln() uint32 { return f.field(6) } func (f funcData) cuOffset() uint32 { return f.field(8) } // field returns the nth field of the _func struct. -// It panics if n == 0 or n > 9; for n == 0, call f.entryPC. +// It panics if n == 0 or n > 10; for n == 0, call f.entryPC. // Most callers should use a named field accessor (just above). func (f funcData) field(n uint32) uint32 { - if n == 0 || n > 9 { + if n == 0 || n > 10 { panic("bad funcdata field") } // In Go 1.18, the first field of _func changed