diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a088eb..89a15d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ All changes mention the author, unless contributed by me (@derekparker). - Store the correct concrete value for interface variables (previously we would always have a pointer type, even when the concrete value was not a pointer) (@aarzilli) - Fix interface and slice equality with nil (@aarzilli) - Fix file:line location specs when relative paths are in .debug_line (@hyangah) -- Fix behavior of next/step/stepout in several edge-cases (invalid return addresses, no courrent goroutine, after process exists, inside unknown code, inside assembly files) (@aarzilli) +- Fix behavior of next/step/stepout in several edge-cases (invalid return addresses, no current goroutine, after process exists, inside unknown code, inside assembly files) (@aarzilli) - Make sure the debugged executable we generated is deleted after exit (@alexbrainman) - Make sure rr trace directories are deleted when we delete the executable and after tests (@aarzilli) - Return errors for commands sent after the target process exited instead of panicing (@derekparker) @@ -135,7 +135,7 @@ All changes mention the author, unless contributed by me (@derekparker). ### Changed - Optimized 'trace' functionality (@aarzilli) -- Internal refactoring to support mutliple backends, core dumps, and more (@aarzilli) [Still ongoing] +- Internal refactoring to support multiple backends, core dumps, and more (@aarzilli) [Still ongoing] - Improve stacktraces (@aarzilli) - Improved documentation for passing flags to debugged process (@njason) @@ -167,7 +167,7 @@ All changes mention the author, unless contributed by me (@derekparker). - Pretty printing: type of elements of interface slices are printed. - Improvements in internal operation of "step" command. -- Allow quouting in build flags argument. +- Allow quoting in build flags argument. - "h" as alias for "help" command. (@stmuk) ### Fixed @@ -292,7 +292,7 @@ All changes mention the author, unless contributed by me (@derekparker). - Deprecate 'run' subcommand in favor of 'debug'. The 'run' subcommand now simply prints a warning, instructing the user to use the 'debug' command instead. - All 'info' subcommands have been promoted to the top level. You can now simply run 'funcs', or 'sources' instead of 'info funcs', etc... -- Any command taking a location expression (i.e. break/trace/list) now support an updated linespec implementation. This allows you to describe the location you would like a breakpoint (etc..) set at in a more convienant way (@aarzilli). +- Any command taking a location expression (i.e. break/trace/list) now support an updated linespec implementation. This allows you to describe the location you would like a breakpoint (etc..) set at in a more convenient way (@aarzilli). ### Fixed diff --git a/Documentation/cli/README.md b/Documentation/cli/README.md index 1c6f3276..bd5d294b 100644 --- a/Documentation/cli/README.md +++ b/Documentation/cli/README.md @@ -122,10 +122,10 @@ Saves the configuration file to disk, overwriting the current configuration file Changes the value of a configuration parameter. - config subistitute-path - config subistitute-path + config substitute-path + config substitute-path -Adds or removes a path subistitution rule. +Adds or removes a path substitution rule. config alias config alias diff --git a/Makefile b/Makefile index 891a4e67..ea7a9072 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ check-cert: ifneq "$(TRAVIS)" "true" ifdef DARWIN ifeq "$(CERT)" "" - scripts/gencert.sh || (echo "An error occurred when generating and installing a new certicate"; exit 1) + scripts/gencert.sh || (echo "An error occurred when generating and installing a new certificate"; exit 1) CERT = dlv-cert endif endif diff --git a/_fixtures/fputest/fputest.go b/_fixtures/fputest/fputest.go index dbf20f2a..9c809276 100644 --- a/_fixtures/fputest/fputest.go +++ b/_fixtures/fputest/fputest.go @@ -21,6 +21,6 @@ func main() { if len(os.Args) < 2 || os.Args[1] != "panic" { runtime.Breakpoint() } else { - panic("booom!") + panic("boom!") } } diff --git a/_fixtures/issue406.go b/_fixtures/issue406.go index d665b9c7..e747dd63 100644 --- a/_fixtures/issue406.go +++ b/_fixtures/issue406.go @@ -55,7 +55,7 @@ func (b Blacklist) String() (result string) { return result } -// ToBool converts a string ("true" or "false") to it's boolean equivalent +// ToBool converts a string ("true" or "false") to its boolean equivalent func ToBool(s string) (b bool) { if len(s) == 0 { log.Fatal("ERROR: variable empty, cannot convert to boolean") diff --git a/pkg/dwarf/frame/table.go b/pkg/dwarf/frame/table.go index 5ac5fa38..c0699c9b 100644 --- a/pkg/dwarf/frame/table.go +++ b/pkg/dwarf/frame/table.go @@ -154,7 +154,7 @@ func (frame *FrameContext) ExecuteUntilPC(instructions []byte) { frame.buf.Write(instructions) // We only need to execute the instructions until - // ctx.loc > ctx.addess (which is the address we + // ctx.loc > ctx.address (which is the address we // are currently at in the traced process). for frame.address >= frame.loc && frame.buf.Len() > 0 { executeDwarfInstruction(frame) diff --git a/pkg/dwarf/line/line_parser_test.go b/pkg/dwarf/line/line_parser_test.go index a5ffdcc1..f4405241 100644 --- a/pkg/dwarf/line/line_parser_test.go +++ b/pkg/dwarf/line/line_parser_test.go @@ -75,7 +75,7 @@ func testDebugLinePrologueParser(p string, t *testing.T) { } if prologue.MinInstrLength != uint8(1) { - t.Fatal("Minimun Instruction Length not parsed correctly", prologue.MinInstrLength) + t.Fatal("Minimum Instruction Length not parsed correctly", prologue.MinInstrLength) } if prologue.InitialIsStmt != uint8(1) { diff --git a/pkg/dwarf/op/op.go b/pkg/dwarf/op/op.go index 3d53be6d..a1499135 100644 --- a/pkg/dwarf/op/op.go +++ b/pkg/dwarf/op/op.go @@ -25,7 +25,7 @@ type context struct { DwarfRegisters } -// Piece is a piece of memory stored either at an addres or in a register. +// Piece is a piece of memory stored either at an address or in a register. type Piece struct { Size int Addr int64 diff --git a/pkg/dwarf/reader/reader.go b/pkg/dwarf/reader/reader.go index 39bff123..e3c49dfd 100755 --- a/pkg/dwarf/reader/reader.go +++ b/pkg/dwarf/reader/reader.go @@ -257,7 +257,7 @@ func (reader *Reader) InstructionsForEntry(entry *dwarf.Entry) ([]byte, error) { return append([]byte{}, instructions...), nil } -// NextMememberVariable moves the reader to the next debug entry that describes a member variable and returns the entry. +// NextMemberVariable moves the reader to the next debug entry that describes a member variable and returns the entry. func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error) { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { diff --git a/pkg/goversion/go_version.go b/pkg/goversion/go_version.go index 05fc238d..2aef86ac 100644 --- a/pkg/goversion/go_version.go +++ b/pkg/goversion/go_version.go @@ -22,7 +22,7 @@ var ( GoVer18Beta = GoVersion{1, 8, -1, 0, 0, ""} ) -// Parse parses a go verison string +// Parse parses a go version string func Parse(ver string) (GoVersion, bool) { var r GoVersion var err1, err2, err3 error @@ -135,7 +135,7 @@ func (v *GoVersion) IsDevel() bool { const goVersionPrefix = "go version " -// Installed runs "go verison" and parses the output +// Installed runs "go version" and parses the output func Installed() (GoVersion, bool) { out, err := exec.Command("go", "version").CombinedOutput() if err != nil { diff --git a/pkg/proc/dwarf_expr_test.go b/pkg/proc/dwarf_expr_test.go index 8342d8c6..7205376e 100644 --- a/pkg/proc/dwarf_expr_test.go +++ b/pkg/proc/dwarf_expr_test.go @@ -23,7 +23,7 @@ const defaultCFA = 0xc420051d00 func fakeBinaryInfo(t *testing.T, dwb *dwarfbuilder.Builder) *proc.BinaryInfo { abbrev, aranges, frame, info, line, pubnames, ranges, str, loc, err := dwb.Build() - assertNoError(err, t, "dwarbuilder.Build") + assertNoError(err, t, "dwarfbuilder.Build") dwdata, err := dwarf.New(abbrev, aranges, frame, info, line, pubnames, ranges, str) assertNoError(err, t, "creating dwarf") diff --git a/pkg/proc/eval.go b/pkg/proc/eval.go index 7e08e659..c4f15665 100644 --- a/pkg/proc/eval.go +++ b/pkg/proc/eval.go @@ -1003,7 +1003,7 @@ func (scope *EvalScope) evalBinary(node *ast.BinaryExpr) (*Variable, error) { } } -// Comapres xv to yv using operator op +// Compares xv to yv using operator op // Both xv and yv must be loaded and have a compatible type (as determined by negotiateType) func compareOp(op token.Token, xv *Variable, yv *Variable) (bool, error) { switch xv.Kind { @@ -1060,7 +1060,7 @@ func compareOp(op token.Token, xv *Variable, yv *Variable) (bool, error) { return false, nil } if int64(len(xv.Children)) != xv.Len || int64(len(yv.Children)) != yv.Len { - return false, fmt.Errorf("sturcture too deep for comparison") + return false, fmt.Errorf("structure too deep for comparison") } eql, err = equalChildren(xv, yv, false) case reflect.Slice, reflect.Map, reflect.Func, reflect.Chan: diff --git a/pkg/proc/gdbserial/gdbserver.go b/pkg/proc/gdbserial/gdbserver.go index 9932d564..a201e573 100644 --- a/pkg/proc/gdbserial/gdbserver.go +++ b/pkg/proc/gdbserial/gdbserver.go @@ -54,7 +54,7 @@ // event is reported, if any other event happens "simultaneously" they are // suppressed by the stub and the debugger can query for them using // qThreadStopInfo. This is much easier for us to implement and the -// implementation gracefully degrates to the case where qThreadStopInfo is +// implementation gracefully degrades to the case where qThreadStopInfo is // unavailable but the inferior is run in single threaded mode. // // Therefore the following code will assume lldb-server-like behavior. diff --git a/pkg/proc/gdbserial/gdbserver_conn.go b/pkg/proc/gdbserial/gdbserver_conn.go index c88573d6..bcf68651 100644 --- a/pkg/proc/gdbserial/gdbserver_conn.go +++ b/pkg/proc/gdbserial/gdbserver_conn.go @@ -1148,7 +1148,7 @@ func wiredecode(in, buf []byte) (newbuf, msg []byte) { } case '#': // end of packet return buf, buf[start:] - case '*': // runlenght encoding marker + case '*': // runlength encoding marker if i+1 >= len(in) || i == 0 { buf = append(buf, ch) } else { diff --git a/pkg/proc/native/proc.go b/pkg/proc/native/proc.go index d6c2d7bd..6cbda0ad 100644 --- a/pkg/proc/native/proc.go +++ b/pkg/proc/native/proc.go @@ -252,7 +252,7 @@ func (dbp *Process) ContinueOnce() (proc.Thread, error) { // StepInstruction will continue the current thread for exactly // one instruction. This method affects only the thread -// asssociated with the selected goroutine. All other +// associated with the selected goroutine. All other // threads will remain stopped. func (dbp *Process) StepInstruction() (err error) { thread := dbp.currentThread diff --git a/pkg/proc/proc.go b/pkg/proc/proc.go index 9fa084eb..c121c477 100644 --- a/pkg/proc/proc.go +++ b/pkg/proc/proc.go @@ -27,7 +27,7 @@ func (pe ProcessExitedError) Error() string { } // FindFileLocation returns the PC for a given file:line. -// Assumes that `file` is normailzed to lower case and '/' on Windows. +// Assumes that `file` is normalized to lower case and '/' on Windows. func FindFileLocation(p Process, fileName string, lineno int) (uint64, error) { pc, fn, err := p.BinInfo().LineToPC(fileName, lineno) if err != nil { diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go index 319fc299..9d041d5c 100644 --- a/pkg/proc/proc_test.go +++ b/pkg/proc/proc_test.go @@ -279,7 +279,7 @@ func TestBreakpoint(t *testing.T) { }) } -func TestBreakpointInSeperateGoRoutine(t *testing.T) { +func TestBreakpointInSeparateGoRoutine(t *testing.T) { protest.AllowRecording(t) withTestProcess("testthreads", t, func(p proc.Process, fixture protest.Fixture) { fnentry, err := proc.FindFunctionLocation(p, "main.anotherthread", false, 0) diff --git a/pkg/proc/scope_test.go b/pkg/proc/scope_test.go index 33033e73..c1f55d44 100644 --- a/pkg/proc/scope_test.go +++ b/pkg/proc/scope_test.go @@ -36,7 +36,7 @@ func TestScopeWithEscapedVariable(t *testing.T) { } if avar.Flags&proc.VariableEscaped == 0 { - t.Errorf("variale a isn't escaped to the heap") + t.Errorf("variable a isn't escaped to the heap") } }) } diff --git a/pkg/proc/stack.go b/pkg/proc/stack.go index eb27bdd4..4d9e181f 100644 --- a/pkg/proc/stack.go +++ b/pkg/proc/stack.go @@ -10,7 +10,7 @@ import ( "github.com/derekparker/delve/pkg/dwarf/op" ) -// This code is partly adaped from runtime.gentraceback in +// This code is partly adapted from runtime.gentraceback in // $GOROOT/src/runtime/traceback.go // Stackframe represents a frame in a system stack. @@ -27,7 +27,7 @@ type Stackframe struct { Ret uint64 // Address to the memory location containing the return address addrret uint64 - // Err is set if an error occoured during stacktrace + // Err is set if an error occurred during stacktrace Err error // SystemStack is true if this frame belongs to a system stack. SystemStack bool diff --git a/pkg/proc/threads.go b/pkg/proc/threads.go index 0f37f89e..32bb60eb 100644 --- a/pkg/proc/threads.go +++ b/pkg/proc/threads.go @@ -425,7 +425,7 @@ func onRuntimeBreakpoint(thread Thread) bool { return loc.Fn != nil && loc.Fn.Name == "runtime.breakpoint" } -// onNextGorutine returns true if this thread is on the goroutine requested by the current 'next' command +// onNextGoroutine returns true if this thread is on the goroutine requested by the current 'next' command func onNextGoroutine(thread Thread, breakpoints *BreakpointMap) (bool, error) { var bp *Breakpoint for i := range breakpoints.M { diff --git a/pkg/proc/types.go b/pkg/proc/types.go index 868f10fa..8071215b 100644 --- a/pkg/proc/types.go +++ b/pkg/proc/types.go @@ -694,7 +694,7 @@ func nameOfStructRuntimeType(_type *Variable, kind, tflag int64) (string, error) case "offsetAnon": // The offsetAnon field of runtime.structfield combines the offset of // the struct field from the base address of the struct with a flag - // determining whether the field is anonimous (i.e. an embedded struct). + // determining whether the field is anonymous (i.e. an embedded struct). // // offsetAnon = (offset<<1) | (anonFlag) // @@ -789,7 +789,7 @@ func typeForKind(kind int64, bi *BinaryInfo) (*godwarf.StructType, error) { return constructTypeForKind(kind, bi) } -// constructTypeForKind synthesizes a *dwarf.StrucType for the specified kind. +// constructTypeForKind synthesizes a *dwarf.StructType for the specified kind. // This is necessary because on go1.8 and previous the specialized types of // runtime._type were not exported. func constructTypeForKind(kind int64, bi *BinaryInfo) (*godwarf.StructType, error) { diff --git a/pkg/terminal/command.go b/pkg/terminal/command.go index 128988c4..8515f5a5 100644 --- a/pkg/terminal/command.go +++ b/pkg/terminal/command.go @@ -250,10 +250,10 @@ Saves the configuration file to disk, overwriting the current configuration file Changes the value of a configuration parameter. - config subistitute-path - config subistitute-path + config substitute-path + config substitute-path -Adds or removes a path subistitution rule. +Adds or removes a path substitution rule. config alias config alias diff --git a/pkg/terminal/command_test.go b/pkg/terminal/command_test.go index 17c885ff..d6bb1717 100644 --- a/pkg/terminal/command_test.go +++ b/pkg/terminal/command_test.go @@ -454,7 +454,7 @@ func TestOnPrefixLocals(t *testing.T) { }) } -func countOccourences(s string, needle string) int { +func countOccurrences(s string, needle string) int { count := 0 for { idx := strings.Index(s, needle) @@ -475,7 +475,7 @@ func TestIssue387(t *testing.T) { term.MustExec("break dostuff") for { outstr, err := term.Exec("continue") - breakpointHitCount += countOccourences(outstr, "issue387.go:8") + breakpointHitCount += countOccurrences(outstr, "issue387.go:8") t.Log(outstr) if err != nil { if !strings.Contains(err.Error(), "exited") { @@ -488,9 +488,9 @@ func TestIssue387(t *testing.T) { for { outstr = term.MustExec("next") - breakpointHitCount += countOccourences(outstr, "issue387.go:8") + breakpointHitCount += countOccurrences(outstr, "issue387.go:8") t.Log(outstr) - if countOccourences(outstr, fmt.Sprintf("issue387.go:%d", pos)) == 0 { + if countOccurrences(outstr, fmt.Sprintf("issue387.go:%d", pos)) == 0 { t.Fatalf("did not continue to expected position %d", pos) } pos++ diff --git a/pkg/terminal/config.go b/pkg/terminal/config.go index dbf05d2f..ee0ed936 100644 --- a/pkg/terminal/config.go +++ b/pkg/terminal/config.go @@ -105,7 +105,7 @@ func configureSet(t *Term, args string) error { } if field.Kind() == reflect.Slice && field.Type().Elem().Name() == "SubstitutePathRule" { - return configureSetSubstituePath(t, rest) + return configureSetSubstitutePath(t, rest) } simpleArg := func(typ reflect.Type) (reflect.Value, error) { @@ -140,7 +140,7 @@ func configureSet(t *Term, args string) error { return nil } -func configureSetSubstituePath(t *Term, rest string) error { +func configureSetSubstitutePath(t *Term, rest string) error { argv := config.SplitQuotedFields(rest, '"') switch len(argv) { case 1: // delete substitute-path rule diff --git a/pkg/terminal/terminal.go b/pkg/terminal/terminal.go index 9aec8460..07b4dfb7 100644 --- a/pkg/terminal/terminal.go +++ b/pkg/terminal/terminal.go @@ -153,9 +153,9 @@ func (t *Term) Println(prefix, str string) { fmt.Fprintf(t.stdout, "%s%s\n", prefix, str) } -// Substitues directory to source file. +// Substitutes directory to source file. // -// Ensures that only directory is substitued, for example: +// Ensures that only directory is substituted, for example: // substitute from `/dir/subdir`, substitute to `/new` // for file path `/dir/subdir/file` will return file path `/new/file`. // for file path `/dir/subdir-2/file` substitution will not be applied. diff --git a/service/api/conversions.go b/service/api/conversions.go index 9be97e68..49472f67 100644 --- a/service/api/conversions.go +++ b/service/api/conversions.go @@ -210,7 +210,7 @@ func ConvertFunction(fn *proc.Function) *Function { } // fn here used to be a *gosym.Func, the fields Type and GoType below - // corresponded to the omonymous field of gosym.Func. Since the contents of + // corresponded to the homonymous field of gosym.Func. Since the contents of // those fields is not documented their value was replaced with 0 when // gosym.Func was replaced by debug_info entries. return &Function{ diff --git a/service/api/types.go b/service/api/types.go index 643d8366..d4691972 100644 --- a/service/api/types.go +++ b/service/api/types.go @@ -106,7 +106,7 @@ type Thread struct { // Breakpoint this thread is stopped at Breakpoint *Breakpoint `json:"breakPoint,omitempty"` // Informations requested by the current breakpoint - BreakpointInfo *BreakpointInfo `json:"breakPointInfo,omitrempty"` + BreakpointInfo *BreakpointInfo `json:"breakPointInfo,omitempty"` } type Location struct { @@ -201,7 +201,7 @@ type Variable struct { // Array and slice elements, member fields of structs, key/value pairs of maps, value of complex numbers // The Name field in this slice will always be the empty string except for structs (when it will be the field name) and for complex numbers (when it will be "real" and "imaginary") // For maps each map entry will have to items in this slice, even numbered items will represent map keys and odd numbered items will represent their values - // This field's length is capped at proc.maxArrayValues for slices and arrays and 2*proc.maxArrayValues for maps, in the circumnstances where the cap takes effect len(Children) != Len + // This field's length is capped at proc.maxArrayValues for slices and arrays and 2*proc.maxArrayValues for maps, in the circumstances where the cap takes effect len(Children) != Len // The other length cap applied to this field is related to maximum recursion depth, when the maximum recursion depth is reached this field is left empty, contrary to the previous one this cap also applies to structs (otherwise structs will always have all their member fields returned) Children []Variable `json:"children"` diff --git a/service/rpc2/client.go b/service/rpc2/client.go index 45e59984..9e41560b 100644 --- a/service/rpc2/client.go +++ b/service/rpc2/client.go @@ -86,7 +86,7 @@ func (c *RPCClient) continueDir(cmd string) <-chan *api.DebuggerState { state.Err = err } if state.Exited { - // Error types apparantly cannot be marshalled by Go correctly. Must reset error here. + // Error types apparently cannot be marshalled by Go correctly. Must reset error here. state.Err = fmt.Errorf("Process %d has exited with status %d", c.ProcessPid(), state.ExitStatus) } ch <- &state diff --git a/service/rpc2/server.go b/service/rpc2/server.go index c177cfab..ab41487e 100644 --- a/service/rpc2/server.go +++ b/service/rpc2/server.go @@ -573,7 +573,7 @@ type DisassembleOut struct { // // If both StartPC and EndPC are non-zero the specified range will be disassembled, otherwise the function containing StartPC will be disassembled. // -// Scope is used to mark the instruction the specified gorutine is stopped at. +// Scope is used to mark the instruction the specified goroutine is stopped at. // // Disassemble will also try to calculate the destination address of an absolute indirect CALL if it happens to be the instruction the selected goroutine is stopped at. func (c *RPCServer) Disassemble(arg DisassembleIn, out *DisassembleOut) error { diff --git a/service/test/common_test.go b/service/test/common_test.go index 1700e402..53ca36a6 100644 --- a/service/test/common_test.go +++ b/service/test/common_test.go @@ -94,7 +94,7 @@ func findLocationHelper(t *testing.T, c LocationFinder, loc string, shouldErr bo } if checkAddr != 0 && checkAddr != locs[0].PC { - t.Fatalf("Wrong address returned for location <%s> (got %#x, epected %#x)", loc, locs[0].PC, checkAddr) + t.Fatalf("Wrong address returned for location <%s> (got %#x, expected %#x)", loc, locs[0].PC, checkAddr) } addrs := make([]uint64, len(locs)) diff --git a/service/test/integration2_test.go b/service/test/integration2_test.go index 4af99ed5..e125f22f 100644 --- a/service/test/integration2_test.go +++ b/service/test/integration2_test.go @@ -1392,7 +1392,7 @@ func TestClientServerConsistentExit(t *testing.T) { // This test is useful because it ensures that Next and Continue operations both // exit with the same exit status and details when the target application terminates. // Other program execution API calls should also behave in the same way. - // An error should be pressent in state.Err. + // An error should be present in state.Err. withTestClient2("pr1055", t, func(c service.Client) { fp := testProgPath(t, "pr1055") _, err := c.CreateBreakpoint(&api.Breakpoint{File: fp, Line: 12})