dwarf,proc: fix typos in comments and error messages (#3379)

This commit is contained in:
Oleksandr Redko
2023-05-23 19:22:20 +03:00
committed by GitHub
parent e33806a3f7
commit 3b251c9dd3
6 changed files with 8 additions and 8 deletions

View File

@ -50,7 +50,7 @@ func TestRangeContains(t *testing.T) {
for _, tc := range tcs { for _, tc := range tcs {
if rangeContains(tc.a, tc.b) != tc.tgt { if rangeContains(tc.a, tc.b) != tc.tgt {
if tc.tgt { if tc.tgt {
t.Errorf("range %v does not contan %v (but should)", tc.a, tc.b) t.Errorf("range %v does not contain %v (but should)", tc.a, tc.b)
} else { } else {
t.Errorf("range %v does contain %v (but shouldn't)", tc.a, tc.b) t.Errorf("range %v does contain %v (but shouldn't)", tc.a, tc.b)
} }
@ -81,7 +81,7 @@ func TestRangesContains(t *testing.T) {
for _, tc := range tcs { for _, tc := range tcs {
if rangesContains(tc.rngs1, tc.rngs2) != tc.tgt { if rangesContains(tc.rngs1, tc.rngs2) != tc.tgt {
if tc.tgt { if tc.tgt {
t.Errorf("ranges %v does not contan %v (but should)", tc.rngs1, tc.rngs2) t.Errorf("ranges %v does not contain %v (but should)", tc.rngs1, tc.rngs2)
} else { } else {
t.Errorf("ranges %v does contain %v (but shouldn't)", tc.rngs1, tc.rngs2) t.Errorf("ranges %v does contain %v (but shouldn't)", tc.rngs1, tc.rngs2)
} }

View File

@ -42,7 +42,7 @@ const (
encImaginaryFloat = 0x09 encImaginaryFloat = 0x09
) )
const cyclicalTypeStop = "<cyclical>" // guard value printed for types with a cyclical definition, to avoid inifinite recursion in Type.String const cyclicalTypeStop = "<cyclical>" // guard value printed for types with a cyclical definition, to avoid infinite recursion in Type.String
type recCheck map[dwarf.Offset]struct{} type recCheck map[dwarf.Offset]struct{}

View File

@ -228,7 +228,7 @@ func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error) {
} }
// NextPackageVariable moves the reader to the next debug entry that describes a package variable. // NextPackageVariable moves the reader to the next debug entry that describes a package variable.
// Any TagVariable entry that is not inside a sub prgram entry and is marked external is considered a package variable. // Any TagVariable entry that is not inside a sub program entry and is marked external is considered a package variable.
func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error) { func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error) {
for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() {
if err != nil { if err != nil {

View File

@ -17,7 +17,7 @@ func i386AsmDecode(asmInst *AsmInstruction, mem []byte, regs *op.DwarfRegisters,
// Possible stacksplit prologues are inserted by stacksplit in // Possible stacksplit prologues are inserted by stacksplit in
// $GOROOT/src/cmd/internal/obj/x86/obj6.go. // $GOROOT/src/cmd/internal/obj/x86/obj6.go.
// If 386 on linux when pie, the stacksplit prologue beigin with `call __x86.get_pc_thunk.` sometime. // If 386 on linux when pie, the stacksplit prologue begin with `call __x86.get_pc_thunk.` sometime.
var prologuesI386 []opcodeSeq var prologuesI386 []opcodeSeq
func init() { func init() {

View File

@ -38,7 +38,7 @@ func readUintRaw(reader io.Reader, order binary.ByteOrder, ptrSize int) (uint64,
} }
return n, nil return n, nil
} }
return 0, fmt.Errorf("not supprted ptr size %d", ptrSize) return 0, fmt.Errorf("not supported ptr size %d", ptrSize)
} }
// dynamicSearchDebug searches for the DT_DEBUG entry in the .dynamic section // dynamicSearchDebug searches for the DT_DEBUG entry in the .dynamic section

View File

@ -2840,7 +2840,7 @@ func TestNextInDeferReturn(t *testing.T) {
// runtime.deferreturn updates the G struct in a way that for one // runtime.deferreturn updates the G struct in a way that for one
// instruction leaves the curg._defer field non-nil but with curg._defer.fn // instruction leaves the curg._defer field non-nil but with curg._defer.fn
// field being nil. // field being nil.
// We need to deal with this without panicing. // We need to deal with this without panicking.
protest.AllowRecording(t) protest.AllowRecording(t)
withTestProcess("defercall", t, func(p *proc.Target, grp *proc.TargetGroup, fixture protest.Fixture) { withTestProcess("defercall", t, func(p *proc.Target, grp *proc.TargetGroup, fixture protest.Fixture) {
setFunctionBreakpoint(p, t, "runtime.deferreturn") setFunctionBreakpoint(p, t, "runtime.deferreturn")
@ -3735,7 +3735,7 @@ func TestHaltKeepsSteppingBreakpoints(t *testing.T) {
func TestDisassembleGlobalVars(t *testing.T) { func TestDisassembleGlobalVars(t *testing.T) {
skipOn(t, "broken - global variable symbolication", "arm64") // On ARM64 symLookup can't look up variables due to how they are loaded, see issue #1778 skipOn(t, "broken - global variable symbolication", "arm64") // On ARM64 symLookup can't look up variables due to how they are loaded, see issue #1778
// On 386 linux when pie, the genered code use __x86.get_pc_thunk to ensure position-independent. // On 386 linux when pie, the generated code use __x86.get_pc_thunk to ensure position-independent.
// Locate global variable by // Locate global variable by
// `CALL __x86.get_pc_thunk.ax(SB) 0xb0f7f // `CALL __x86.get_pc_thunk.ax(SB) 0xb0f7f
// LEAL 0xc0a19(AX), AX` // LEAL 0xc0a19(AX), AX`