*: fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
This commit is contained in:
cui fliter
2022-03-23 23:10:00 +08:00
committed by GitHub
parent cdf73b5365
commit 9a9c1a9f33
13 changed files with 19 additions and 19 deletions

View File

@ -810,7 +810,7 @@ func TestRemoteDAPClientMulti(t *testing.T) {
dapclient2.ExpectTerminatedEvent(t) dapclient2.ExpectTerminatedEvent(t)
closeDAPRemoteMultiClient(t, dapclient2, "exited") closeDAPRemoteMultiClient(t, dapclient2, "exited")
// Attach to exited processs is an error // Attach to exited processes is an error
dapclient3 := daptest.NewClient(listenAddr) dapclient3 := daptest.NewClient(listenAddr)
dapclient3.AttachRequest(map[string]interface{}{"mode": "remote", "stopOnEntry": true}) dapclient3.AttachRequest(map[string]interface{}{"mode": "remote", "stopOnEntry": true})
dapclient3.ExpectErrorResponseWith(t, dap.FailedToAttach, `Process \d+ has exited with status 0`, true) dapclient3.ExpectErrorResponseWith(t, dap.FailedToAttach, `Process \d+ has exited with status 0`, true)

View File

@ -194,7 +194,7 @@ func max(a, b uint64) uint64 {
// fuseRanges fuses rngs2 into rngs1, it's the equivalent of // fuseRanges fuses rngs2 into rngs1, it's the equivalent of
// normalizeRanges(append(rngs1, rngs2)) // normalizeRanges(append(rngs1, rngs2))
// but more efficent. // but more efficient.
func fuseRanges(rngs1, rngs2 [][2]uint64) [][2]uint64 { func fuseRanges(rngs1, rngs2 [][2]uint64) [][2]uint64 {
if rangesContains(rngs1, rngs2) { if rangesContains(rngs1, rngs2) {
return rngs1 return rngs1

View File

@ -191,7 +191,7 @@ func FindFileLocation(p Process, filename string, lineno int) ([]uint64, error)
return nil, &ErrCouldNotFindLine{fileFound, filename, lineno} return nil, &ErrCouldNotFindLine{fileFound, filename, lineno}
} }
// 2. assign all occurences of filename:lineno to their containing function // 2. assign all occurrences of filename:lineno to their containing function
pcByFunc := map[*Function][]line.PCStmt{} pcByFunc := map[*Function][]line.PCStmt{}
sort.Slice(pcs, func(i, j int) bool { return pcs[i].PC < pcs[j].PC }) sort.Slice(pcs, func(i, j int) bool { return pcs[i].PC < pcs[j].PC })

View File

@ -36,7 +36,7 @@ type DumpState struct {
type DumpFlags uint16 type DumpFlags uint16
const ( const (
DumpPlatformIndependent DumpFlags = 1 << iota // always use platfrom-independent notes format DumpPlatformIndependent DumpFlags = 1 << iota // always use platform-independent notes format
) )
// MemoryMapEntry represent a memory mapping in the target process. // MemoryMapEntry represent a memory mapping in the target process.

View File

@ -270,7 +270,7 @@ func evalFunctionCall(scope *EvalScope, node *ast.CallExpr) (*Variable, error) {
if thread == nil { if thread == nil {
// We are doing a nested function call and using Go 1.15, the original // We are doing a nested function call and using Go 1.15, the original
// injection goroutine was suspended and now we are using a different // injection goroutine was suspended and now we are using a different
// goroutine, evaluation still happend on the original goroutine but we // goroutine, evaluation still happened on the original goroutine but we
// need to use a different thread to do the nested call injection. // need to use a different thread to do the nested call injection.
thread = scope.callCtx.injectionThread thread = scope.callCtx.injectionThread
g2, err := GetG(thread) g2, err := GetG(thread)

View File

@ -14,7 +14,7 @@ write_memory(task_t task, mach_vm_address_t addr, void *d, mach_msg_type_number_
kret = mach_vm_region((vm_map_t)task, &(mach_vm_address_t){addr}, (mach_vm_size_t*)&l, VM_REGION_BASIC_INFO_64, (vm_region_info_t)&info, &count, &objname); kret = mach_vm_region((vm_map_t)task, &(mach_vm_address_t){addr}, (mach_vm_size_t*)&l, VM_REGION_BASIC_INFO_64, (vm_region_info_t)&info, &count, &objname);
if (kret != KERN_SUCCESS) return -1; if (kret != KERN_SUCCESS) return -1;
// Set permissions to enable writting to this memory location // Set permissions to enable writing to this memory location
kret = mach_vm_protect(task, addr, len, FALSE, VM_PROT_WRITE|VM_PROT_COPY|VM_PROT_READ); kret = mach_vm_protect(task, addr, len, FALSE, VM_PROT_WRITE|VM_PROT_COPY|VM_PROT_READ);
if (kret != KERN_SUCCESS) return -1; if (kret != KERN_SUCCESS) return -1;

View File

@ -352,7 +352,7 @@ func TestBreakpointWithNonExistantFunction(t *testing.T) {
withTestProcess("testprog", t, func(p *proc.Target, fixture protest.Fixture) { withTestProcess("testprog", t, func(p *proc.Target, fixture protest.Fixture) {
_, err := p.SetBreakpoint(0, 0, proc.UserBreakpoint, nil) _, err := p.SetBreakpoint(0, 0, proc.UserBreakpoint, nil)
if err == nil { if err == nil {
t.Fatal("Should not be able to break at non existant function") t.Fatal("Should not be able to break at non existent function")
} }
}) })
} }
@ -4289,7 +4289,7 @@ func TestReadDeferArgs(t *testing.T) {
// the autogenerated code used to unpack the argument frame stored in // the autogenerated code used to unpack the argument frame stored in
// runtime._defer into registers. // runtime._defer into registers.
// We either need to know how to do the translation, implementing the ABI1 // We either need to know how to do the translation, implementing the ABI1
// rules in Delve, or have some assistence from the compiler (for example // rules in Delve, or have some assistance from the compiler (for example
// have the dwrap function contain entries for each of the captured // have the dwrap function contain entries for each of the captured
// variables with a location describing their offset from DX). // variables with a location describing their offset from DX).
// Ultimately this feature is unimportant enough that we can leave it // Ultimately this feature is unimportant enough that we can leave it

View File

@ -483,7 +483,7 @@ func (t *Target) RequestManualStop() error {
const ( const (
FakeAddressBase = 0xbeef000000000000 FakeAddressBase = 0xbeef000000000000
fakeAddressUnresolv = 0xbeed000000000000 // this address never resloves to memory fakeAddressUnresolv = 0xbeed000000000000 // this address never resolves to memory
) )
// newCompositeMemory creates a new compositeMemory object and registers it. // newCompositeMemory creates a new compositeMemory object and registers it.

View File

@ -76,7 +76,7 @@ const (
VariableReturnArgument VariableReturnArgument
// VariableFakeAddress means the address of this variable is either fake // VariableFakeAddress means the address of this variable is either fake
// (i.e. the variable is partially or completely stored in a CPU register // (i.e. the variable is partially or completely stored in a CPU register
// and doesn't have a real address) or possibly no longer availabe (because // and doesn't have a real address) or possibly no longer available (because
// the variable is the return value of a function call and allocated on a // the variable is the return value of a function call and allocated on a
// frame that no longer exists) // frame that no longer exists)
VariableFakeAddress VariableFakeAddress

View File

@ -155,7 +155,7 @@ func withTestTerminalBuildFlags(name string, t testing.TB, buildFlags test.Build
func TestCommandDefault(t *testing.T) { func TestCommandDefault(t *testing.T) {
var ( var (
cmds = Commands{} cmds = Commands{}
cmd = cmds.Find("non-existant-command", noPrefix).cmdFn cmd = cmds.Find("non-existent-command", noPrefix).cmdFn
) )
err := cmd(nil, callContext{}, "") err := cmd(nil, callContext{}, "")

View File

@ -429,7 +429,7 @@ func PrettyExamineMemory(address uintptr, memArea []byte, isLittleEndian bool, f
addrFmt string addrFmt string
) )
// Diffrent versions of golang output differently about '#'. // Different versions of golang output differently about '#'.
// See https://ci.appveyor.com/project/derekparker/delve-facy3/builds/30179356. // See https://ci.appveyor.com/project/derekparker/delve-facy3/builds/30179356.
switch format { switch format {
case 'b': case 'b':

View File

@ -277,7 +277,7 @@ const (
// VariableFakeAddress means the address of this variable is either fake // VariableFakeAddress means the address of this variable is either fake
// (i.e. the variable is partially or completely stored in a CPU register // (i.e. the variable is partially or completely stored in a CPU register
// and doesn't have a real address) or possibly no longer availabe (because // and doesn't have a real address) or possibly no longer available (because
// the variable is the return value of a function call and allocated on a // the variable is the return value of a function call and allocated on a
// frame that no longer exists) // frame that no longer exists)
VariableFakeAddress VariableFakeAddress

View File

@ -145,7 +145,7 @@ type Session struct {
// to ensure that messages do not get interleaved // to ensure that messages do not get interleaved
sendingMu sync.Mutex sendingMu sync.Mutex
// runningCmd tracks whether the server is running an asyncronous // runningCmd tracks whether the server is running an asynchronous
// command that resumes execution, which may not correspond to the actual // command that resumes execution, which may not correspond to the actual
// running state of the process (e.g. if a command is temporarily interrupted). // running state of the process (e.g. if a command is temporarily interrupted).
runningCmd bool runningCmd bool
@ -251,9 +251,9 @@ type dapClientCapabilites struct {
} }
// DefaultLoadConfig controls how variables are loaded from the target's memory. // DefaultLoadConfig controls how variables are loaded from the target's memory.
// These limits are conservative to minimize performace overhead for bulk loading. // These limits are conservative to minimize performance overhead for bulk loading.
// With dlv-dap, users do not have a way to adjust these. // With dlv-dap, users do not have a way to adjust these.
// Instead we are focusing in interacive loading with nested reloads, array/map // Instead we are focusing in interactive loading with nested reloads, array/map
// paging and context-specific string limits. // paging and context-specific string limits.
var DefaultLoadConfig = proc.LoadConfig{ var DefaultLoadConfig = proc.LoadConfig{
FollowPointers: true, FollowPointers: true,
@ -1547,7 +1547,7 @@ func closeIfOpen(ch chan struct{}) {
// onConfigurationDoneRequest handles 'configurationDone' request. // onConfigurationDoneRequest handles 'configurationDone' request.
// This is an optional request enabled by capability supportsConfigurationDoneRequest. // This is an optional request enabled by capability supportsConfigurationDoneRequest.
// It gets triggered after all the debug requests that follow initalized event, // It gets triggered after all the debug requests that follow initialized event,
// so the s.debugger is guaranteed to be set. Expects the target to be halted. // so the s.debugger is guaranteed to be set. Expects the target to be halted.
func (s *Session) onConfigurationDoneRequest(request *dap.ConfigurationDoneRequest, allowNextStateChange chan struct{}) { func (s *Session) onConfigurationDoneRequest(request *dap.ConfigurationDoneRequest, allowNextStateChange chan struct{}) {
defer closeIfOpen(allowNextStateChange) defer closeIfOpen(allowNextStateChange)
@ -2203,7 +2203,7 @@ func (s *Session) childrenToDAPVariables(v *fullyQualifiedVariable) ([]dap.Varia
keyType := s.getTypeIfSupported(keyv) keyType := s.getTypeIfSupported(keyv)
valType := s.getTypeIfSupported(valv) valType := s.getTypeIfSupported(valv)
// If key or value or both are scalars, we can use // If key or value or both are scalars, we can use
// a single variable to represet key:value format. // a single variable to represent key:value format.
// Otherwise, we must return separate variables for both. // Otherwise, we must return separate variables for both.
if keyref > 0 && valref > 0 { // Both are not scalars if keyref > 0 && valref > 0 { // Both are not scalars
keyvar := dap.Variable{ keyvar := dap.Variable{
@ -2585,7 +2585,7 @@ func (s *Session) convertVariableWithOpts(v *proc.Variable, qualifiedNameOrExpr
// Support the following expressions: // Support the following expressions:
// -- {expression} - evaluates the expression and returns the result as a variable // -- {expression} - evaluates the expression and returns the result as a variable
// -- call {function} - injects a function call and returns the result as a variable // -- call {function} - injects a function call and returns the result as a variable
// -- config {expression} - updates configuration paramaters // -- config {expression} - updates configuration parameters
// TODO(polina): users have complained about having to click to expand multi-level // TODO(polina): users have complained about having to click to expand multi-level
// variables, so consider also adding the following: // variables, so consider also adding the following:
// -- print {expression} - return the result as a string like from dlv cli // -- print {expression} - return the result as a string like from dlv cli