id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
127,700
go-delve/delve
service/rpc2/server.go
ListBreakpoints
func (s *RPCServer) ListBreakpoints(arg ListBreakpointsIn, out *ListBreakpointsOut) error { out.Breakpoints = s.debugger.Breakpoints() return nil }
go
func (s *RPCServer) ListBreakpoints(arg ListBreakpointsIn, out *ListBreakpointsOut) error { out.Breakpoints = s.debugger.Breakpoints() return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListBreakpoints", "(", "arg", "ListBreakpointsIn", ",", "out", "*", "ListBreakpointsOut", ")", "error", "{", "out", ".", "Breakpoints", "=", "s", ".", "debugger", ".", "Breakpoints", "(", ")", "\n", "return", "nil"...
// ListBreakpoints gets all breakpoints.
[ "ListBreakpoints", "gets", "all", "breakpoints", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L205-L208
127,701
go-delve/delve
service/rpc2/server.go
AmendBreakpoint
func (s *RPCServer) AmendBreakpoint(arg AmendBreakpointIn, out *AmendBreakpointOut) error { return s.debugger.AmendBreakpoint(&arg.Breakpoint) }
go
func (s *RPCServer) AmendBreakpoint(arg AmendBreakpointIn, out *AmendBreakpointOut) error { return s.debugger.AmendBreakpoint(&arg.Breakpoint) }
[ "func", "(", "s", "*", "RPCServer", ")", "AmendBreakpoint", "(", "arg", "AmendBreakpointIn", ",", "out", "*", "AmendBreakpointOut", ")", "error", "{", "return", "s", ".", "debugger", ".", "AmendBreakpoint", "(", "&", "arg", ".", "Breakpoint", ")", "\n", "}...
// AmendBreakpoint allows user to update an existing breakpoint // for example to change the information retrieved when the // breakpoint is hit or to change, add or remove the break condition. // // arg.Breakpoint.ID must be a valid breakpoint ID
[ "AmendBreakpoint", "allows", "user", "to", "update", "an", "existing", "breakpoint", "for", "example", "to", "change", "the", "information", "retrieved", "when", "the", "breakpoint", "is", "hit", "or", "to", "change", "add", "or", "remove", "the", "break", "co...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L283-L285
127,702
go-delve/delve
service/rpc2/server.go
ListThreads
func (s *RPCServer) ListThreads(arg ListThreadsIn, out *ListThreadsOut) (err error) { out.Threads, err = s.debugger.Threads() return err }
go
func (s *RPCServer) ListThreads(arg ListThreadsIn, out *ListThreadsOut) (err error) { out.Threads, err = s.debugger.Threads() return err }
[ "func", "(", "s", "*", "RPCServer", ")", "ListThreads", "(", "arg", "ListThreadsIn", ",", "out", "*", "ListThreadsOut", ")", "(", "err", "error", ")", "{", "out", ".", "Threads", ",", "err", "=", "s", ".", "debugger", ".", "Threads", "(", ")", "\n", ...
// ListThreads lists all threads.
[ "ListThreads", "lists", "all", "threads", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L305-L308
127,703
go-delve/delve
service/rpc2/server.go
GetThread
func (s *RPCServer) GetThread(arg GetThreadIn, out *GetThreadOut) error { t, err := s.debugger.FindThread(arg.Id) if err != nil { return err } if t == nil { return fmt.Errorf("no thread with id %d", arg.Id) } out.Thread = t return nil }
go
func (s *RPCServer) GetThread(arg GetThreadIn, out *GetThreadOut) error { t, err := s.debugger.FindThread(arg.Id) if err != nil { return err } if t == nil { return fmt.Errorf("no thread with id %d", arg.Id) } out.Thread = t return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "GetThread", "(", "arg", "GetThreadIn", ",", "out", "*", "GetThreadOut", ")", "error", "{", "t", ",", "err", ":=", "s", ".", "debugger", ".", "FindThread", "(", "arg", ".", "Id", ")", "\n", "if", "err", "!="...
// GetThread gets a thread by its ID.
[ "GetThread", "gets", "a", "thread", "by", "its", "ID", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L319-L329
127,704
go-delve/delve
service/rpc2/server.go
ListPackageVars
func (s *RPCServer) ListPackageVars(arg ListPackageVarsIn, out *ListPackageVarsOut) error { state, err := s.debugger.State(false) if err != nil { return err } current := state.CurrentThread if current == nil { return fmt.Errorf("no current thread") } vars, err := s.debugger.PackageVariables(current.ID, arg...
go
func (s *RPCServer) ListPackageVars(arg ListPackageVarsIn, out *ListPackageVarsOut) error { state, err := s.debugger.State(false) if err != nil { return err } current := state.CurrentThread if current == nil { return fmt.Errorf("no current thread") } vars, err := s.debugger.PackageVariables(current.ID, arg...
[ "func", "(", "s", "*", "RPCServer", ")", "ListPackageVars", "(", "arg", "ListPackageVarsIn", ",", "out", "*", "ListPackageVarsOut", ")", "error", "{", "state", ",", "err", ":=", "s", ".", "debugger", ".", "State", "(", "false", ")", "\n", "if", "err", ...
// ListPackageVars lists all package variables in the context of the current thread.
[ "ListPackageVars", "lists", "all", "package", "variables", "in", "the", "context", "of", "the", "current", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L341-L358
127,705
go-delve/delve
service/rpc2/server.go
ListRegisters
func (s *RPCServer) ListRegisters(arg ListRegistersIn, out *ListRegistersOut) error { if arg.ThreadID == 0 { state, err := s.debugger.State(false) if err != nil { return err } arg.ThreadID = state.CurrentThread.ID } regs, err := s.debugger.Registers(arg.ThreadID, arg.IncludeFp) if err != nil { return ...
go
func (s *RPCServer) ListRegisters(arg ListRegistersIn, out *ListRegistersOut) error { if arg.ThreadID == 0 { state, err := s.debugger.State(false) if err != nil { return err } arg.ThreadID = state.CurrentThread.ID } regs, err := s.debugger.Registers(arg.ThreadID, arg.IncludeFp) if err != nil { return ...
[ "func", "(", "s", "*", "RPCServer", ")", "ListRegisters", "(", "arg", "ListRegistersIn", ",", "out", "*", "ListRegistersOut", ")", "error", "{", "if", "arg", ".", "ThreadID", "==", "0", "{", "state", ",", "err", ":=", "s", ".", "debugger", ".", "State"...
// ListRegisters lists registers and their values.
[ "ListRegisters", "lists", "registers", "and", "their", "values", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L371-L388
127,706
go-delve/delve
service/rpc2/server.go
ListLocalVars
func (s *RPCServer) ListLocalVars(arg ListLocalVarsIn, out *ListLocalVarsOut) error { vars, err := s.debugger.LocalVariables(arg.Scope, *api.LoadConfigToProc(&arg.Cfg)) if err != nil { return err } out.Variables = vars return nil }
go
func (s *RPCServer) ListLocalVars(arg ListLocalVarsIn, out *ListLocalVarsOut) error { vars, err := s.debugger.LocalVariables(arg.Scope, *api.LoadConfigToProc(&arg.Cfg)) if err != nil { return err } out.Variables = vars return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListLocalVars", "(", "arg", "ListLocalVarsIn", ",", "out", "*", "ListLocalVarsOut", ")", "error", "{", "vars", ",", "err", ":=", "s", ".", "debugger", ".", "LocalVariables", "(", "arg", ".", "Scope", ",", "*", ...
// ListLocalVars lists all local variables in scope.
[ "ListLocalVars", "lists", "all", "local", "variables", "in", "scope", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L400-L407
127,707
go-delve/delve
service/rpc2/server.go
ListFunctionArgs
func (s *RPCServer) ListFunctionArgs(arg ListFunctionArgsIn, out *ListFunctionArgsOut) error { vars, err := s.debugger.FunctionArguments(arg.Scope, *api.LoadConfigToProc(&arg.Cfg)) if err != nil { return err } out.Args = vars return nil }
go
func (s *RPCServer) ListFunctionArgs(arg ListFunctionArgsIn, out *ListFunctionArgsOut) error { vars, err := s.debugger.FunctionArguments(arg.Scope, *api.LoadConfigToProc(&arg.Cfg)) if err != nil { return err } out.Args = vars return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListFunctionArgs", "(", "arg", "ListFunctionArgsIn", ",", "out", "*", "ListFunctionArgsOut", ")", "error", "{", "vars", ",", "err", ":=", "s", ".", "debugger", ".", "FunctionArguments", "(", "arg", ".", "Scope", ",...
// ListFunctionArgs lists all arguments to the current function
[ "ListFunctionArgs", "lists", "all", "arguments", "to", "the", "current", "function" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L419-L426
127,708
go-delve/delve
service/rpc2/server.go
Set
func (s *RPCServer) Set(arg SetIn, out *SetOut) error { return s.debugger.SetVariableInScope(arg.Scope, arg.Symbol, arg.Value) }
go
func (s *RPCServer) Set(arg SetIn, out *SetOut) error { return s.debugger.SetVariableInScope(arg.Scope, arg.Symbol, arg.Value) }
[ "func", "(", "s", "*", "RPCServer", ")", "Set", "(", "arg", "SetIn", ",", "out", "*", "SetOut", ")", "error", "{", "return", "s", ".", "debugger", ".", "SetVariableInScope", "(", "arg", ".", "Scope", ",", "arg", ".", "Symbol", ",", "arg", ".", "Val...
// Set sets the value of a variable. Only numerical types and // pointers are currently supported.
[ "Set", "sets", "the", "value", "of", "a", "variable", ".", "Only", "numerical", "types", "and", "pointers", "are", "currently", "supported", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L466-L468
127,709
go-delve/delve
service/rpc2/server.go
ListSources
func (s *RPCServer) ListSources(arg ListSourcesIn, out *ListSourcesOut) error { ss, err := s.debugger.Sources(arg.Filter) if err != nil { return err } out.Sources = ss return nil }
go
func (s *RPCServer) ListSources(arg ListSourcesIn, out *ListSourcesOut) error { ss, err := s.debugger.Sources(arg.Filter) if err != nil { return err } out.Sources = ss return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListSources", "(", "arg", "ListSourcesIn", ",", "out", "*", "ListSourcesOut", ")", "error", "{", "ss", ",", "err", ":=", "s", ".", "debugger", ".", "Sources", "(", "arg", ".", "Filter", ")", "\n", "if", "err"...
// ListSources lists all source files in the process matching filter.
[ "ListSources", "lists", "all", "source", "files", "in", "the", "process", "matching", "filter", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L479-L486
127,710
go-delve/delve
service/rpc2/server.go
ListFunctions
func (s *RPCServer) ListFunctions(arg ListFunctionsIn, out *ListFunctionsOut) error { fns, err := s.debugger.Functions(arg.Filter) if err != nil { return err } out.Funcs = fns return nil }
go
func (s *RPCServer) ListFunctions(arg ListFunctionsIn, out *ListFunctionsOut) error { fns, err := s.debugger.Functions(arg.Filter) if err != nil { return err } out.Funcs = fns return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListFunctions", "(", "arg", "ListFunctionsIn", ",", "out", "*", "ListFunctionsOut", ")", "error", "{", "fns", ",", "err", ":=", "s", ".", "debugger", ".", "Functions", "(", "arg", ".", "Filter", ")", "\n", "if"...
// ListFunctions lists all functions in the process matching filter.
[ "ListFunctions", "lists", "all", "functions", "in", "the", "process", "matching", "filter", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L497-L504
127,711
go-delve/delve
service/rpc2/server.go
ListTypes
func (s *RPCServer) ListTypes(arg ListTypesIn, out *ListTypesOut) error { tps, err := s.debugger.Types(arg.Filter) if err != nil { return err } out.Types = tps return nil }
go
func (s *RPCServer) ListTypes(arg ListTypesIn, out *ListTypesOut) error { tps, err := s.debugger.Types(arg.Filter) if err != nil { return err } out.Types = tps return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListTypes", "(", "arg", "ListTypesIn", ",", "out", "*", "ListTypesOut", ")", "error", "{", "tps", ",", "err", ":=", "s", ".", "debugger", ".", "Types", "(", "arg", ".", "Filter", ")", "\n", "if", "err", "!=...
// ListTypes lists all types in the process matching filter.
[ "ListTypes", "lists", "all", "types", "in", "the", "process", "matching", "filter", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L515-L522
127,712
go-delve/delve
service/rpc2/server.go
ListGoroutines
func (s *RPCServer) ListGoroutines(arg ListGoroutinesIn, out *ListGoroutinesOut) error { gs, nextg, err := s.debugger.Goroutines(arg.Start, arg.Count) if err != nil { return err } out.Goroutines = gs out.Nextg = nextg return nil }
go
func (s *RPCServer) ListGoroutines(arg ListGoroutinesIn, out *ListGoroutinesOut) error { gs, nextg, err := s.debugger.Goroutines(arg.Start, arg.Count) if err != nil { return err } out.Goroutines = gs out.Nextg = nextg return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "ListGoroutines", "(", "arg", "ListGoroutinesIn", ",", "out", "*", "ListGoroutinesOut", ")", "error", "{", "gs", ",", "nextg", ",", "err", ":=", "s", ".", "debugger", ".", "Goroutines", "(", "arg", ".", "Start", ...
// ListGoroutines lists all goroutines. // If Count is specified ListGoroutines will return at the first Count // goroutines and an index in Nextg, that can be passed as the Start // parameter, to get more goroutines from ListGoroutines. // Passing a value of Start that wasn't returned by ListGoroutines will skip // an...
[ "ListGoroutines", "lists", "all", "goroutines", ".", "If", "Count", "is", "specified", "ListGoroutines", "will", "return", "at", "the", "first", "Count", "goroutines", "and", "an", "index", "in", "Nextg", "that", "can", "be", "passed", "as", "the", "Start", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L540-L548
127,713
go-delve/delve
service/rpc2/server.go
AttachedToExistingProcess
func (c *RPCServer) AttachedToExistingProcess(arg AttachedToExistingProcessIn, out *AttachedToExistingProcessOut) error { if c.config.AttachPid != 0 { out.Answer = true } return nil }
go
func (c *RPCServer) AttachedToExistingProcess(arg AttachedToExistingProcessIn, out *AttachedToExistingProcessOut) error { if c.config.AttachPid != 0 { out.Answer = true } return nil }
[ "func", "(", "c", "*", "RPCServer", ")", "AttachedToExistingProcess", "(", "arg", "AttachedToExistingProcessIn", ",", "out", "*", "AttachedToExistingProcessOut", ")", "error", "{", "if", "c", ".", "config", ".", "AttachPid", "!=", "0", "{", "out", ".", "Answer...
// AttachedToExistingProcess returns whether we attached to a running process or not
[ "AttachedToExistingProcess", "returns", "whether", "we", "attached", "to", "a", "running", "process", "or", "not" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L558-L563
127,714
go-delve/delve
service/rpc2/server.go
Disassemble
func (c *RPCServer) Disassemble(arg DisassembleIn, out *DisassembleOut) error { var err error out.Disassemble, err = c.debugger.Disassemble(arg.Scope, arg.StartPC, arg.EndPC, arg.Flavour) return err }
go
func (c *RPCServer) Disassemble(arg DisassembleIn, out *DisassembleOut) error { var err error out.Disassemble, err = c.debugger.Disassemble(arg.Scope, arg.StartPC, arg.EndPC, arg.Flavour) return err }
[ "func", "(", "c", "*", "RPCServer", ")", "Disassemble", "(", "arg", "DisassembleIn", ",", "out", "*", "DisassembleOut", ")", "error", "{", "var", "err", "error", "\n", "out", ".", "Disassemble", ",", "err", "=", "c", ".", "debugger", ".", "Disassemble", ...
// Disassemble code. // // 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 goroutine is stopped at. // // Disassemble will also try to calculate the destination addr...
[ "Disassemble", "code", ".", "If", "both", "StartPC", "and", "EndPC", "are", "non", "-", "zero", "the", "specified", "range", "will", "be", "disassembled", "otherwise", "the", "function", "containing", "StartPC", "will", "be", "disassembled", ".", "Scope", "is"...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L610-L614
127,715
go-delve/delve
service/rpc2/server.go
FunctionReturnLocations
func (s *RPCServer) FunctionReturnLocations(in FunctionReturnLocationsIn, out *FunctionReturnLocationsOut) error { addrs, err := s.debugger.FunctionReturnLocations(in.FnName) if err != nil { return err } *out = FunctionReturnLocationsOut{ Addrs: addrs, } return nil }
go
func (s *RPCServer) FunctionReturnLocations(in FunctionReturnLocationsIn, out *FunctionReturnLocationsOut) error { addrs, err := s.debugger.FunctionReturnLocations(in.FnName) if err != nil { return err } *out = FunctionReturnLocationsOut{ Addrs: addrs, } return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "FunctionReturnLocations", "(", "in", "FunctionReturnLocationsIn", ",", "out", "*", "FunctionReturnLocationsOut", ")", "error", "{", "addrs", ",", "err", ":=", "s", ".", "debugger", ".", "FunctionReturnLocations", "(", "i...
// FunctionReturnLocations is the implements the client call of the same name. Look at client documentation for more information.
[ "FunctionReturnLocations", "is", "the", "implements", "the", "client", "call", "of", "the", "same", "name", ".", "Look", "at", "client", "documentation", "for", "more", "information", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L701-L710
127,716
go-delve/delve
pkg/dwarf/util/util.go
DecodeULEB128
func DecodeULEB128(buf *bytes.Buffer) (uint64, uint32) { var ( result uint64 shift uint64 length uint32 ) if buf.Len() == 0 { return 0, 0 } for { b, err := buf.ReadByte() if err != nil { panic("Could not parse ULEB128 value") } length++ result |= uint64((uint(b) & 0x7f) << shift) // If ...
go
func DecodeULEB128(buf *bytes.Buffer) (uint64, uint32) { var ( result uint64 shift uint64 length uint32 ) if buf.Len() == 0 { return 0, 0 } for { b, err := buf.ReadByte() if err != nil { panic("Could not parse ULEB128 value") } length++ result |= uint64((uint(b) & 0x7f) << shift) // If ...
[ "func", "DecodeULEB128", "(", "buf", "*", "bytes", ".", "Buffer", ")", "(", "uint64", ",", "uint32", ")", "{", "var", "(", "result", "uint64", "\n", "shift", "uint64", "\n", "length", "uint32", "\n", ")", "\n\n", "if", "buf", ".", "Len", "(", ")", ...
// The Little Endian Base 128 format is defined in the DWARF v4 standard, // section 7.6, page 161 and following. // DecodeULEB128 decodes an unsigned Little Endian Base 128 // represented number.
[ "The", "Little", "Endian", "Base", "128", "format", "is", "defined", "in", "the", "DWARF", "v4", "standard", "section", "7", ".", "6", "page", "161", "and", "following", ".", "DecodeULEB128", "decodes", "an", "unsigned", "Little", "Endian", "Base", "128", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/util.go#L13-L42
127,717
go-delve/delve
pkg/dwarf/util/util.go
DecodeSLEB128
func DecodeSLEB128(buf *bytes.Buffer) (int64, uint32) { var ( b byte err error result int64 shift uint64 length uint32 ) if buf.Len() == 0 { return 0, 0 } for { b, err = buf.ReadByte() if err != nil { panic("Could not parse SLEB128 value") } length++ result |= int64((int64(b) &...
go
func DecodeSLEB128(buf *bytes.Buffer) (int64, uint32) { var ( b byte err error result int64 shift uint64 length uint32 ) if buf.Len() == 0 { return 0, 0 } for { b, err = buf.ReadByte() if err != nil { panic("Could not parse SLEB128 value") } length++ result |= int64((int64(b) &...
[ "func", "DecodeSLEB128", "(", "buf", "*", "bytes", ".", "Buffer", ")", "(", "int64", ",", "uint32", ")", "{", "var", "(", "b", "byte", "\n", "err", "error", "\n", "result", "int64", "\n", "shift", "uint64", "\n", "length", "uint32", "\n", ")", "\n\n"...
// DecodeSLEB128 decodes a signed Little Endian Base 128 // represented number.
[ "DecodeSLEB128", "decodes", "a", "signed", "Little", "Endian", "Base", "128", "represented", "number", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/util.go#L46-L78
127,718
go-delve/delve
pkg/dwarf/util/util.go
EncodeULEB128
func EncodeULEB128(out io.ByteWriter, x uint64) { for { b := byte(x & 0x7f) x = x >> 7 if x != 0 { b = b | 0x80 } out.WriteByte(b) if x == 0 { break } } }
go
func EncodeULEB128(out io.ByteWriter, x uint64) { for { b := byte(x & 0x7f) x = x >> 7 if x != 0 { b = b | 0x80 } out.WriteByte(b) if x == 0 { break } } }
[ "func", "EncodeULEB128", "(", "out", "io", ".", "ByteWriter", ",", "x", "uint64", ")", "{", "for", "{", "b", ":=", "byte", "(", "x", "&", "0x7f", ")", "\n", "x", "=", "x", ">>", "7", "\n", "if", "x", "!=", "0", "{", "b", "=", "b", "|", "0x8...
// EncodeULEB128 encodes x to the unsigned Little Endian Base 128 format // into out.
[ "EncodeULEB128", "encodes", "x", "to", "the", "unsigned", "Little", "Endian", "Base", "128", "format", "into", "out", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/util.go#L82-L94
127,719
go-delve/delve
pkg/dwarf/util/util.go
EncodeSLEB128
func EncodeSLEB128(out io.ByteWriter, x int64) { for { b := byte(x & 0x7f) x >>= 7 signb := b & 0x40 last := false if (x == 0 && signb == 0) || (x == -1 && signb != 0) { last = true } else { b = b | 0x80 } out.WriteByte(b) if last { break } } }
go
func EncodeSLEB128(out io.ByteWriter, x int64) { for { b := byte(x & 0x7f) x >>= 7 signb := b & 0x40 last := false if (x == 0 && signb == 0) || (x == -1 && signb != 0) { last = true } else { b = b | 0x80 } out.WriteByte(b) if last { break } } }
[ "func", "EncodeSLEB128", "(", "out", "io", ".", "ByteWriter", ",", "x", "int64", ")", "{", "for", "{", "b", ":=", "byte", "(", "x", "&", "0x7f", ")", "\n", "x", ">>=", "7", "\n\n", "signb", ":=", "b", "&", "0x40", "\n\n", "last", ":=", "false", ...
// EncodeSLEB128 encodes x to the signed Little Endian Base 128 format // into out.
[ "EncodeSLEB128", "encodes", "x", "to", "the", "signed", "Little", "Endian", "Base", "128", "format", "into", "out", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/util.go#L98-L117
127,720
go-delve/delve
pkg/dwarf/op/op.go
PrettyPrint
func PrettyPrint(out io.Writer, instructions []byte) { in := bytes.NewBuffer(instructions) for { opcode, err := in.ReadByte() if err != nil { break } if name, hasname := opcodeName[Opcode(opcode)]; hasname { io.WriteString(out, name) out.Write([]byte{' '}) } else { fmt.Fprintf(out, "%#x ", opco...
go
func PrettyPrint(out io.Writer, instructions []byte) { in := bytes.NewBuffer(instructions) for { opcode, err := in.ReadByte() if err != nil { break } if name, hasname := opcodeName[Opcode(opcode)]; hasname { io.WriteString(out, name) out.Write([]byte{' '}) } else { fmt.Fprintf(out, "%#x ", opco...
[ "func", "PrettyPrint", "(", "out", "io", ".", "Writer", ",", "instructions", "[", "]", "byte", ")", "{", "in", ":=", "bytes", ".", "NewBuffer", "(", "instructions", ")", "\n\n", "for", "{", "opcode", ",", "err", ":=", "in", ".", "ReadByte", "(", ")",...
// PrettyPrint prints instructions to out.
[ "PrettyPrint", "prints", "instructions", "to", "out", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/op/op.go#L78-L125
127,721
go-delve/delve
pkg/terminal/command.go
match
func (c command) match(cmdstr string) bool { for _, v := range c.aliases { if v == cmdstr { return true } } return false }
go
func (c command) match(cmdstr string) bool { for _, v := range c.aliases { if v == cmdstr { return true } } return false }
[ "func", "(", "c", "command", ")", "match", "(", "cmdstr", "string", ")", "bool", "{", "for", "_", ",", "v", ":=", "range", "c", ".", "aliases", "{", "if", "v", "==", "cmdstr", "{", "return", "true", "\n", "}", "\n", "}", "\n", "return", "false", ...
// Returns true if the command string matches one of the aliases for this command
[ "Returns", "true", "if", "the", "command", "string", "matches", "one", "of", "the", "aliases", "for", "this", "command" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L67-L74
127,722
go-delve/delve
pkg/terminal/command.go
Register
func (c *Commands) Register(cmdstr string, cf cmdfunc, helpMsg string) { for _, v := range c.cmds { if v.match(cmdstr) { v.cmdFn = cf return } } c.cmds = append(c.cmds, command{aliases: []string{cmdstr}, cmdFn: cf, helpMsg: helpMsg}) }
go
func (c *Commands) Register(cmdstr string, cf cmdfunc, helpMsg string) { for _, v := range c.cmds { if v.match(cmdstr) { v.cmdFn = cf return } } c.cmds = append(c.cmds, command{aliases: []string{cmdstr}, cmdFn: cf, helpMsg: helpMsg}) }
[ "func", "(", "c", "*", "Commands", ")", "Register", "(", "cmdstr", "string", ",", "cf", "cmdfunc", ",", "helpMsg", "string", ")", "{", "for", "_", ",", "v", ":=", "range", "c", ".", "cmds", "{", "if", "v", ".", "match", "(", "cmdstr", ")", "{", ...
// Register custom commands. Expects cf to be a func of type cmdfunc, // returning only an error.
[ "Register", "custom", "commands", ".", "Expects", "cf", "to", "be", "a", "func", "of", "type", "cmdfunc", "returning", "only", "an", "error", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L394-L403
127,723
go-delve/delve
pkg/terminal/command.go
CallWithContext
func (c *Commands) CallWithContext(cmdstr string, t *Term, ctx callContext) error { vals := strings.SplitN(strings.TrimSpace(cmdstr), " ", 2) cmdname := vals[0] var args string if len(vals) > 1 { args = strings.TrimSpace(vals[1]) } return c.Find(cmdname, ctx.Prefix)(t, ctx, args) }
go
func (c *Commands) CallWithContext(cmdstr string, t *Term, ctx callContext) error { vals := strings.SplitN(strings.TrimSpace(cmdstr), " ", 2) cmdname := vals[0] var args string if len(vals) > 1 { args = strings.TrimSpace(vals[1]) } return c.Find(cmdname, ctx.Prefix)(t, ctx, args) }
[ "func", "(", "c", "*", "Commands", ")", "CallWithContext", "(", "cmdstr", "string", ",", "t", "*", "Term", ",", "ctx", "callContext", ")", "error", "{", "vals", ":=", "strings", ".", "SplitN", "(", "strings", ".", "TrimSpace", "(", "cmdstr", ")", ",", ...
// CallWithContext takes a command and a context that command should be executed in.
[ "CallWithContext", "takes", "a", "command", "and", "a", "context", "that", "command", "should", "be", "executed", "in", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L431-L439
127,724
go-delve/delve
pkg/terminal/command.go
Call
func (c *Commands) Call(cmdstr string, t *Term) error { ctx := callContext{Prefix: noPrefix, Scope: api.EvalScope{GoroutineID: -1, Frame: c.frame, DeferredCall: 0}} return c.CallWithContext(cmdstr, t, ctx) }
go
func (c *Commands) Call(cmdstr string, t *Term) error { ctx := callContext{Prefix: noPrefix, Scope: api.EvalScope{GoroutineID: -1, Frame: c.frame, DeferredCall: 0}} return c.CallWithContext(cmdstr, t, ctx) }
[ "func", "(", "c", "*", "Commands", ")", "Call", "(", "cmdstr", "string", ",", "t", "*", "Term", ")", "error", "{", "ctx", ":=", "callContext", "{", "Prefix", ":", "noPrefix", ",", "Scope", ":", "api", ".", "EvalScope", "{", "GoroutineID", ":", "-", ...
// Call takes a command to execute.
[ "Call", "takes", "a", "command", "to", "execute", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L442-L445
127,725
go-delve/delve
pkg/terminal/command.go
Merge
func (c *Commands) Merge(allAliases map[string][]string) { for i := range c.cmds { if c.cmds[i].builtinAliases != nil { c.cmds[i].aliases = append(c.cmds[i].aliases[:0], c.cmds[i].builtinAliases...) } } for i := range c.cmds { if aliases, ok := allAliases[c.cmds[i].aliases[0]]; ok { if c.cmds[i].builtinA...
go
func (c *Commands) Merge(allAliases map[string][]string) { for i := range c.cmds { if c.cmds[i].builtinAliases != nil { c.cmds[i].aliases = append(c.cmds[i].aliases[:0], c.cmds[i].builtinAliases...) } } for i := range c.cmds { if aliases, ok := allAliases[c.cmds[i].aliases[0]]; ok { if c.cmds[i].builtinA...
[ "func", "(", "c", "*", "Commands", ")", "Merge", "(", "allAliases", "map", "[", "string", "]", "[", "]", "string", ")", "{", "for", "i", ":=", "range", "c", ".", "cmds", "{", "if", "c", ".", "cmds", "[", "i", "]", ".", "builtinAliases", "!=", "...
// Merge takes aliases defined in the config struct and merges them with the default aliases.
[ "Merge", "takes", "aliases", "defined", "in", "the", "config", "struct", "and", "merges", "them", "with", "the", "default", "aliases", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L448-L463
127,726
go-delve/delve
pkg/terminal/command.go
frameCommand
func (c *Commands) frameCommand(t *Term, ctx callContext, argstr string, direction frameDirection) error { frame := 1 arg := "" if len(argstr) == 0 { if direction == frameSet { return errors.New("not enough arguments") } } else { args := strings.SplitN(argstr, " ", 2) var err error if frame, err = strc...
go
func (c *Commands) frameCommand(t *Term, ctx callContext, argstr string, direction frameDirection) error { frame := 1 arg := "" if len(argstr) == 0 { if direction == frameSet { return errors.New("not enough arguments") } } else { args := strings.SplitN(argstr, " ", 2) var err error if frame, err = strc...
[ "func", "(", "c", "*", "Commands", ")", "frameCommand", "(", "t", "*", "Term", ",", "ctx", "callContext", ",", "argstr", "string", ",", "direction", "frameDirection", ")", "error", "{", "frame", ":=", "1", "\n", "arg", ":=", "\"", "\"", "\n", "if", "...
// Handle "frame", "up", "down" commands.
[ "Handle", "frame", "up", "down", "commands", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L701-L748
127,727
go-delve/delve
pkg/terminal/command.go
getLocation
func getLocation(t *Term, ctx callContext, args string, showContext bool) (file string, lineno int, showarrow bool, err error) { switch { case len(args) == 0 && !ctx.scoped(): state, err := t.client.GetState() if err != nil { return "", 0, false, err } if showContext { printcontext(t, state) } if st...
go
func getLocation(t *Term, ctx callContext, args string, showContext bool) (file string, lineno int, showarrow bool, err error) { switch { case len(args) == 0 && !ctx.scoped(): state, err := t.client.GetState() if err != nil { return "", 0, false, err } if showContext { printcontext(t, state) } if st...
[ "func", "getLocation", "(", "t", "*", "Term", ",", "ctx", "callContext", ",", "args", "string", ",", "showContext", "bool", ")", "(", "file", "string", ",", "lineno", "int", ",", "showarrow", "bool", ",", "err", "error", ")", "{", "switch", "{", "case"...
// getLocation returns the current location or the locations specified by the argument. // getLocation is used to process the argument of list and edit commands.
[ "getLocation", "returns", "the", "current", "location", "or", "the", "locations", "specified", "by", "the", "argument", ".", "getLocation", "is", "used", "to", "process", "the", "argument", "of", "list", "and", "edit", "commands", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/command.go#L1501-L1554
127,728
go-delve/delve
pkg/logflags/logflags.go
WriteAPIListeningMessage
func WriteAPIListeningMessage(addr string) { if logOut != nil { fmt.Fprintf(logOut, "API server listening at: %s\n", addr) } else { fmt.Printf("API server listening at: %s\n", addr) } }
go
func WriteAPIListeningMessage(addr string) { if logOut != nil { fmt.Fprintf(logOut, "API server listening at: %s\n", addr) } else { fmt.Printf("API server listening at: %s\n", addr) } }
[ "func", "WriteAPIListeningMessage", "(", "addr", "string", ")", "{", "if", "logOut", "!=", "nil", "{", "fmt", ".", "Fprintf", "(", "logOut", ",", "\"", "\\n", "\"", ",", "addr", ")", "\n", "}", "else", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "...
// WriteAPIListeningMessage writes the "API server listening" message in headless mode.
[ "WriteAPIListeningMessage", "writes", "the", "API", "server", "listening", "message", "in", "headless", "mode", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/logflags/logflags.go#L104-L110
127,729
go-delve/delve
pkg/logflags/logflags.go
Setup
func Setup(logFlag bool, logstr string, logDest string) error { if logDest != "" { n, err := strconv.Atoi(logDest) if err == nil { logOut = os.NewFile(uintptr(n), "delve-logs") } else { fh, err := os.Create(logDest) if err != nil { return fmt.Errorf("could not create log file: %v", err) } logO...
go
func Setup(logFlag bool, logstr string, logDest string) error { if logDest != "" { n, err := strconv.Atoi(logDest) if err == nil { logOut = os.NewFile(uintptr(n), "delve-logs") } else { fh, err := os.Create(logDest) if err != nil { return fmt.Errorf("could not create log file: %v", err) } logO...
[ "func", "Setup", "(", "logFlag", "bool", ",", "logstr", "string", ",", "logDest", "string", ")", "error", "{", "if", "logDest", "!=", "\"", "\"", "{", "n", ",", "err", ":=", "strconv", ".", "Atoi", "(", "logDest", ")", "\n", "if", "err", "==", "nil...
// Setup sets debugger flags based on the contents of logstr. // If logDest is not empty logs will be redirected to the file descriptor or // file path specified by logDest.
[ "Setup", "sets", "debugger", "flags", "based", "on", "the", "contents", "of", "logstr", ".", "If", "logDest", "is", "not", "empty", "logs", "will", "be", "redirected", "to", "the", "file", "descriptor", "or", "file", "path", "specified", "by", "logDest", "...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/logflags/logflags.go#L117-L161
127,730
go-delve/delve
pkg/proc/variables.go
TypeString
func (v *Variable) TypeString() string { if v == nilVariable { return "nil" } if v.DwarfType != nil { return v.DwarfType.Common().Name } return v.Kind.String() }
go
func (v *Variable) TypeString() string { if v == nilVariable { return "nil" } if v.DwarfType != nil { return v.DwarfType.Common().Name } return v.Kind.String() }
[ "func", "(", "v", "*", "Variable", ")", "TypeString", "(", ")", "string", "{", "if", "v", "==", "nilVariable", "{", "return", "\"", "\"", "\n", "}", "\n", "if", "v", ".", "DwarfType", "!=", "nil", "{", "return", "v", ".", "DwarfType", ".", "Common"...
// TypeString returns the string representation // of the type of this variable.
[ "TypeString", "returns", "the", "string", "representation", "of", "the", "type", "of", "this", "variable", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L407-L415
127,731
go-delve/delve
pkg/proc/variables.go
Defer
func (g *G) Defer() *Defer { if g.variable.Unreadable != nil { return nil } dvar := g.variable.fieldVariable("_defer").maybeDereference() if dvar.Addr == 0 { return nil } d := &Defer{variable: dvar} d.load() return d }
go
func (g *G) Defer() *Defer { if g.variable.Unreadable != nil { return nil } dvar := g.variable.fieldVariable("_defer").maybeDereference() if dvar.Addr == 0 { return nil } d := &Defer{variable: dvar} d.load() return d }
[ "func", "(", "g", "*", "G", ")", "Defer", "(", ")", "*", "Defer", "{", "if", "g", ".", "variable", ".", "Unreadable", "!=", "nil", "{", "return", "nil", "\n", "}", "\n", "dvar", ":=", "g", ".", "variable", ".", "fieldVariable", "(", "\"", "\"", ...
// Defer returns the top-most defer of the goroutine.
[ "Defer", "returns", "the", "top", "-", "most", "defer", "of", "the", "goroutine", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L568-L579
127,732
go-delve/delve
pkg/proc/variables.go
UserCurrent
func (g *G) UserCurrent() Location { it, err := g.stackIterator() if err != nil { return g.CurrentLoc } for it.Next() { frame := it.Frame() if frame.Call.Fn != nil { name := frame.Call.Fn.Name if strings.Contains(name, ".") && (!strings.HasPrefix(name, "runtime.") || isExportedRuntime(name)) { retur...
go
func (g *G) UserCurrent() Location { it, err := g.stackIterator() if err != nil { return g.CurrentLoc } for it.Next() { frame := it.Frame() if frame.Call.Fn != nil { name := frame.Call.Fn.Name if strings.Contains(name, ".") && (!strings.HasPrefix(name, "runtime.") || isExportedRuntime(name)) { retur...
[ "func", "(", "g", "*", "G", ")", "UserCurrent", "(", ")", "Location", "{", "it", ",", "err", ":=", "g", ".", "stackIterator", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "g", ".", "CurrentLoc", "\n", "}", "\n", "for", "it", ".", "N...
// UserCurrent returns the location the users code is at, // or was at before entering a runtime function.
[ "UserCurrent", "returns", "the", "location", "the", "users", "code", "is", "at", "or", "was", "at", "before", "entering", "a", "runtime", "function", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L591-L606
127,733
go-delve/delve
pkg/proc/variables.go
Go
func (g *G) Go() Location { pc := g.GoPC if fn := g.variable.bi.PCToFunc(pc); fn != nil { // Backup to CALL instruction. // Mimics runtime/traceback.go:677. if g.GoPC > fn.Entry { pc-- } } f, l, fn := g.variable.bi.PCToLine(pc) return Location{PC: g.GoPC, File: f, Line: l, Fn: fn} }
go
func (g *G) Go() Location { pc := g.GoPC if fn := g.variable.bi.PCToFunc(pc); fn != nil { // Backup to CALL instruction. // Mimics runtime/traceback.go:677. if g.GoPC > fn.Entry { pc-- } } f, l, fn := g.variable.bi.PCToLine(pc) return Location{PC: g.GoPC, File: f, Line: l, Fn: fn} }
[ "func", "(", "g", "*", "G", ")", "Go", "(", ")", "Location", "{", "pc", ":=", "g", ".", "GoPC", "\n", "if", "fn", ":=", "g", ".", "variable", ".", "bi", ".", "PCToFunc", "(", "pc", ")", ";", "fn", "!=", "nil", "{", "// Backup to CALL instruction....
// Go returns the location of the 'go' statement // that spawned this goroutine.
[ "Go", "returns", "the", "location", "of", "the", "go", "statement", "that", "spawned", "this", "goroutine", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L610-L621
127,734
go-delve/delve
pkg/proc/variables.go
StartLoc
func (g *G) StartLoc() Location { f, l, fn := g.variable.bi.PCToLine(g.StartPC) return Location{PC: g.StartPC, File: f, Line: l, Fn: fn} }
go
func (g *G) StartLoc() Location { f, l, fn := g.variable.bi.PCToLine(g.StartPC) return Location{PC: g.StartPC, File: f, Line: l, Fn: fn} }
[ "func", "(", "g", "*", "G", ")", "StartLoc", "(", ")", "Location", "{", "f", ",", "l", ",", "fn", ":=", "g", ".", "variable", ".", "bi", ".", "PCToLine", "(", "g", ".", "StartPC", ")", "\n", "return", "Location", "{", "PC", ":", "g", ".", "St...
// StartLoc returns the starting location of the goroutine.
[ "StartLoc", "returns", "the", "starting", "location", "of", "the", "goroutine", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L624-L627
127,735
go-delve/delve
pkg/proc/variables.go
Ancestors
func (g *G) Ancestors(n int) ([]Ancestor, error) { scope := globalScope(g.Thread.BinInfo(), g.Thread) tbav, err := scope.EvalExpression("runtime.debug.tracebackancestors", loadSingleValue) if err == nil && tbav.Unreadable == nil && tbav.Kind == reflect.Int { tba, _ := constant.Int64Val(tbav.Value) if tba == 0 { ...
go
func (g *G) Ancestors(n int) ([]Ancestor, error) { scope := globalScope(g.Thread.BinInfo(), g.Thread) tbav, err := scope.EvalExpression("runtime.debug.tracebackancestors", loadSingleValue) if err == nil && tbav.Unreadable == nil && tbav.Kind == reflect.Int { tba, _ := constant.Int64Val(tbav.Value) if tba == 0 { ...
[ "func", "(", "g", "*", "G", ")", "Ancestors", "(", "n", "int", ")", "(", "[", "]", "Ancestor", ",", "error", ")", "{", "scope", ":=", "globalScope", "(", "g", ".", "Thread", ".", "BinInfo", "(", ")", ",", "g", ".", "Thread", ")", "\n", "tbav", ...
// Ancestors returns the list of ancestors for g.
[ "Ancestors", "returns", "the", "list", "of", "ancestors", "for", "g", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L632-L679
127,736
go-delve/delve
pkg/proc/variables.go
Stack
func (a *Ancestor) Stack(n int) ([]Stackframe, error) { if a.Unreadable != nil { return nil, a.Unreadable } pcsVar := a.pcsVar.clone() pcsVar.loadValue(LoadConfig{MaxArrayValues: n}) if pcsVar.Unreadable != nil { return nil, pcsVar.Unreadable } r := make([]Stackframe, len(pcsVar.Children)) for i := range pc...
go
func (a *Ancestor) Stack(n int) ([]Stackframe, error) { if a.Unreadable != nil { return nil, a.Unreadable } pcsVar := a.pcsVar.clone() pcsVar.loadValue(LoadConfig{MaxArrayValues: n}) if pcsVar.Unreadable != nil { return nil, pcsVar.Unreadable } r := make([]Stackframe, len(pcsVar.Children)) for i := range pc...
[ "func", "(", "a", "*", "Ancestor", ")", "Stack", "(", "n", "int", ")", "(", "[", "]", "Stackframe", ",", "error", ")", "{", "if", "a", ".", "Unreadable", "!=", "nil", "{", "return", "nil", ",", "a", ".", "Unreadable", "\n", "}", "\n", "pcsVar", ...
// Stack returns the stack trace of ancestor 'a' as saved by the runtime.
[ "Stack", "returns", "the", "stack", "trace", "of", "ancestor", "a", "as", "saved", "by", "the", "runtime", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L682-L717
127,737
go-delve/delve
pkg/proc/variables.go
stkbar
func (g *G) stkbar() ([]savedLR, error) { if g.stkbarVar == nil { // stack barriers were removed in Go 1.9 return nil, nil } g.stkbarVar.loadValue(LoadConfig{false, 1, 0, int(g.stkbarVar.Len), 3, 0}) if g.stkbarVar.Unreadable != nil { return nil, fmt.Errorf("unreadable stkbar: %v", g.stkbarVar.Unreadable) } r...
go
func (g *G) stkbar() ([]savedLR, error) { if g.stkbarVar == nil { // stack barriers were removed in Go 1.9 return nil, nil } g.stkbarVar.loadValue(LoadConfig{false, 1, 0, int(g.stkbarVar.Len), 3, 0}) if g.stkbarVar.Unreadable != nil { return nil, fmt.Errorf("unreadable stkbar: %v", g.stkbarVar.Unreadable) } r...
[ "func", "(", "g", "*", "G", ")", "stkbar", "(", ")", "(", "[", "]", "savedLR", ",", "error", ")", "{", "if", "g", ".", "stkbarVar", "==", "nil", "{", "// stack barriers were removed in Go 1.9", "return", "nil", ",", "nil", "\n", "}", "\n", "g", ".", ...
// Returns the list of saved return addresses used by stack barriers
[ "Returns", "the", "list", "of", "saved", "return", "addresses", "used", "by", "stack", "barriers" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L720-L742
127,738
go-delve/delve
pkg/proc/variables.go
SetVariable
func (scope *EvalScope) SetVariable(name, value string) error { t, err := parser.ParseExpr(name) if err != nil { return err } xv, err := scope.evalAST(t) if err != nil { return err } if xv.Addr == 0 { return fmt.Errorf("Can not assign to \"%s\"", name) } if xv.Unreadable != nil { return fmt.Errorf("...
go
func (scope *EvalScope) SetVariable(name, value string) error { t, err := parser.ParseExpr(name) if err != nil { return err } xv, err := scope.evalAST(t) if err != nil { return err } if xv.Addr == 0 { return fmt.Errorf("Can not assign to \"%s\"", name) } if xv.Unreadable != nil { return fmt.Errorf("...
[ "func", "(", "scope", "*", "EvalScope", ")", "SetVariable", "(", "name", ",", "value", "string", ")", "error", "{", "t", ",", "err", ":=", "parser", ".", "ParseExpr", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}"...
// SetVariable sets the value of the named variable
[ "SetVariable", "sets", "the", "value", "of", "the", "named", "variable" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L750-L780
127,739
go-delve/delve
pkg/proc/variables.go
LocalVariables
func (scope *EvalScope) LocalVariables(cfg LoadConfig) ([]*Variable, error) { vars, err := scope.Locals() if err != nil { return nil, err } vars = filterVariables(vars, func(v *Variable) bool { return (v.Flags & (VariableArgument | VariableReturnArgument)) == 0 }) cfg.MaxMapBuckets = maxMapBucketsFactor * cfg...
go
func (scope *EvalScope) LocalVariables(cfg LoadConfig) ([]*Variable, error) { vars, err := scope.Locals() if err != nil { return nil, err } vars = filterVariables(vars, func(v *Variable) bool { return (v.Flags & (VariableArgument | VariableReturnArgument)) == 0 }) cfg.MaxMapBuckets = maxMapBucketsFactor * cfg...
[ "func", "(", "scope", "*", "EvalScope", ")", "LocalVariables", "(", "cfg", "LoadConfig", ")", "(", "[", "]", "*", "Variable", ",", "error", ")", "{", "vars", ",", "err", ":=", "scope", ".", "Locals", "(", ")", "\n", "if", "err", "!=", "nil", "{", ...
// LocalVariables returns all local variables from the current function scope.
[ "LocalVariables", "returns", "all", "local", "variables", "from", "the", "current", "function", "scope", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L783-L794
127,740
go-delve/delve
pkg/proc/variables.go
PackageVariables
func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) { var vars []*Variable reader := scope.DwarfReader() var utypoff dwarf.Offset utypentry, err := reader.SeekToTypeNamed("<unspecified>") if err == nil { utypoff = utypentry.Offset } for entry, err := reader.NextPackageVariable(); en...
go
func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) { var vars []*Variable reader := scope.DwarfReader() var utypoff dwarf.Offset utypentry, err := reader.SeekToTypeNamed("<unspecified>") if err == nil { utypoff = utypentry.Offset } for entry, err := reader.NextPackageVariable(); en...
[ "func", "(", "scope", "*", "EvalScope", ")", "PackageVariables", "(", "cfg", "LoadConfig", ")", "(", "[", "]", "*", "Variable", ",", "error", ")", "{", "var", "vars", "[", "]", "*", "Variable", "\n", "reader", ":=", "scope", ".", "DwarfReader", "(", ...
// PackageVariables returns the name, value, and type of all package variables in the application.
[ "PackageVariables", "returns", "the", "name", "value", "and", "type", "of", "all", "package", "variables", "in", "the", "application", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L821-L850
127,741
go-delve/delve
pkg/proc/variables.go
extractVarInfoFromEntry
func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variable, error) { if varEntry == nil { return nil, fmt.Errorf("invalid entry") } if varEntry.Tag != dwarf.TagFormalParameter && varEntry.Tag != dwarf.TagVariable { return nil, fmt.Errorf("invalid entry tag, only supports FormalParameter a...
go
func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variable, error) { if varEntry == nil { return nil, fmt.Errorf("invalid entry") } if varEntry.Tag != dwarf.TagFormalParameter && varEntry.Tag != dwarf.TagVariable { return nil, fmt.Errorf("invalid entry tag, only supports FormalParameter a...
[ "func", "(", "scope", "*", "EvalScope", ")", "extractVarInfoFromEntry", "(", "varEntry", "*", "dwarf", ".", "Entry", ")", "(", "*", "Variable", ",", "error", ")", "{", "if", "varEntry", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(",...
// Extracts the name and type of a variable from a dwarf entry // then executes the instructions given in the DW_AT_location attribute to grab the variable's address
[ "Extracts", "the", "name", "and", "type", "of", "a", "variable", "from", "a", "dwarf", "entry", "then", "executes", "the", "instructions", "given", "in", "the", "DW_AT_location", "attribute", "to", "grab", "the", "variable", "s", "address" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L992-L1024
127,742
go-delve/delve
pkg/proc/variables.go
maybeDereference
func (v *Variable) maybeDereference() *Variable { if v.Unreadable != nil { return v } switch t := v.RealType.(type) { case *godwarf.PtrType: if v.Addr == 0 && len(v.Children) == 1 && v.loaded { // fake pointer variable constructed by casting an integer to a pointer type return &v.Children[0] } ptrval...
go
func (v *Variable) maybeDereference() *Variable { if v.Unreadable != nil { return v } switch t := v.RealType.(type) { case *godwarf.PtrType: if v.Addr == 0 && len(v.Children) == 1 && v.loaded { // fake pointer variable constructed by casting an integer to a pointer type return &v.Children[0] } ptrval...
[ "func", "(", "v", "*", "Variable", ")", "maybeDereference", "(", ")", "*", "Variable", "{", "if", "v", ".", "Unreadable", "!=", "nil", "{", "return", "v", "\n", "}", "\n\n", "switch", "t", ":=", "v", ".", "RealType", ".", "(", "type", ")", "{", "...
// If v is a pointer a new variable is returned containing the value pointed by v.
[ "If", "v", "is", "a", "pointer", "a", "new", "variable", "is", "returned", "containing", "the", "value", "pointed", "by", "v", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L1027-L1048
127,743
go-delve/delve
pkg/proc/variables.go
loadChanInfo
func (v *Variable) loadChanInfo() { chanType, ok := v.RealType.(*godwarf.ChanType) if !ok { v.Unreadable = errors.New("bad channel type") return } sv := v.clone() sv.RealType = resolveTypedef(&(chanType.TypedefType)) sv = sv.maybeDereference() if sv.Unreadable != nil || sv.Addr == 0 { return } v.Base = s...
go
func (v *Variable) loadChanInfo() { chanType, ok := v.RealType.(*godwarf.ChanType) if !ok { v.Unreadable = errors.New("bad channel type") return } sv := v.clone() sv.RealType = resolveTypedef(&(chanType.TypedefType)) sv = sv.maybeDereference() if sv.Unreadable != nil || sv.Addr == 0 { return } v.Base = s...
[ "func", "(", "v", "*", "Variable", ")", "loadChanInfo", "(", ")", "{", "chanType", ",", "ok", ":=", "v", ".", "RealType", ".", "(", "*", "godwarf", ".", "ChanType", ")", "\n", "if", "!", "ok", "{", "v", ".", "Unreadable", "=", "errors", ".", "New...
// loadChanInfo loads the buffer size of the channel and changes the type of // the buf field from unsafe.Pointer to an array of the correct type.
[ "loadChanInfo", "loads", "the", "buffer", "size", "of", "the", "channel", "and", "changes", "the", "type", "of", "the", "buf", "field", "from", "unsafe", ".", "Pointer", "to", "an", "array", "of", "the", "correct", "type", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L1377-L1434
127,744
go-delve/delve
pkg/proc/variables.go
writeEmptyInterface
func (v *Variable) writeEmptyInterface(typeAddr uint64, data *Variable) error { dstType, dstData, _ := v.readInterface() if v.Unreadable != nil { return v.Unreadable } dstType.writeUint(typeAddr, dstType.RealType.Size()) dstData.writeCopy(data) return nil }
go
func (v *Variable) writeEmptyInterface(typeAddr uint64, data *Variable) error { dstType, dstData, _ := v.readInterface() if v.Unreadable != nil { return v.Unreadable } dstType.writeUint(typeAddr, dstType.RealType.Size()) dstData.writeCopy(data) return nil }
[ "func", "(", "v", "*", "Variable", ")", "writeEmptyInterface", "(", "typeAddr", "uint64", ",", "data", "*", "Variable", ")", "error", "{", "dstType", ",", "dstData", ",", "_", ":=", "v", ".", "readInterface", "(", ")", "\n", "if", "v", ".", "Unreadable...
// writeInterface writes the empty interface of type typeAddr and data as the data field.
[ "writeInterface", "writes", "the", "empty", "interface", "of", "type", "typeAddr", "and", "data", "as", "the", "data", "field", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L1624-L1632
127,745
go-delve/delve
pkg/proc/variables.go
funcvalAddr
func (v *Variable) funcvalAddr() uint64 { val := make([]byte, v.bi.Arch.PtrSize()) _, err := v.mem.ReadMemory(val, v.Addr) if err != nil { v.Unreadable = err return 0 } return binary.LittleEndian.Uint64(val) }
go
func (v *Variable) funcvalAddr() uint64 { val := make([]byte, v.bi.Arch.PtrSize()) _, err := v.mem.ReadMemory(val, v.Addr) if err != nil { v.Unreadable = err return 0 } return binary.LittleEndian.Uint64(val) }
[ "func", "(", "v", "*", "Variable", ")", "funcvalAddr", "(", ")", "uint64", "{", "val", ":=", "make", "(", "[", "]", "byte", ",", "v", ".", "bi", ".", "Arch", ".", "PtrSize", "(", ")", ")", "\n", "_", ",", "err", ":=", "v", ".", "mem", ".", ...
// funcvalAddr reads the address of the funcval contained in a function variable.
[ "funcvalAddr", "reads", "the", "address", "of", "the", "funcval", "contained", "in", "a", "function", "variable", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L1697-L1705
127,746
go-delve/delve
pkg/proc/variables.go
ConstDescr
func (v *Variable) ConstDescr() string { if v.bi == nil || (v.Flags&VariableConstant != 0) { return "" } ctyp := v.bi.consts.Get(v.DwarfType) if ctyp == nil { return "" } if typename := v.DwarfType.Common().Name; strings.Index(typename, ".") < 0 || strings.HasPrefix(typename, "C.") { // only attempt to use ...
go
func (v *Variable) ConstDescr() string { if v.bi == nil || (v.Flags&VariableConstant != 0) { return "" } ctyp := v.bi.consts.Get(v.DwarfType) if ctyp == nil { return "" } if typename := v.DwarfType.Common().Name; strings.Index(typename, ".") < 0 || strings.HasPrefix(typename, "C.") { // only attempt to use ...
[ "func", "(", "v", "*", "Variable", ")", "ConstDescr", "(", ")", "string", "{", "if", "v", ".", "bi", "==", "nil", "||", "(", "v", ".", "Flags", "&", "VariableConstant", "!=", "0", ")", "{", "return", "\"", "\"", "\n", "}", "\n", "ctyp", ":=", "...
// ConstDescr describes the value of v using constants.
[ "ConstDescr", "describes", "the", "value", "of", "v", "using", "constants", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L2099-L2122
127,747
go-delve/delve
pkg/proc/variables.go
Locals
func (scope *EvalScope) Locals() ([]*Variable, error) { if scope.Fn == nil { return nil, errors.New("unable to find function context") } var vars []*Variable var depths []int varReader := reader.Variables(scope.BinInfo.dwarf, scope.Fn.offset, reader.ToRelAddr(scope.PC, scope.BinInfo.staticBase), scope.Line, tru...
go
func (scope *EvalScope) Locals() ([]*Variable, error) { if scope.Fn == nil { return nil, errors.New("unable to find function context") } var vars []*Variable var depths []int varReader := reader.Variables(scope.BinInfo.dwarf, scope.Fn.offset, reader.ToRelAddr(scope.PC, scope.BinInfo.staticBase), scope.Line, tru...
[ "func", "(", "scope", "*", "EvalScope", ")", "Locals", "(", ")", "(", "[", "]", "*", "Variable", ",", "error", ")", "{", "if", "scope", ".", "Fn", "==", "nil", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", ...
// Locals fetches all variables of a specific type in the current function scope.
[ "Locals", "fetches", "all", "variables", "of", "a", "specific", "type", "in", "the", "current", "function", "scope", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/variables.go#L2207-L2275
127,748
go-delve/delve
service/api/types.go
ValidBreakpointName
func ValidBreakpointName(name string) error { if _, err := strconv.Atoi(name); err == nil { return errors.New("breakpoint name can not be a number") } for _, ch := range name { if !(unicode.IsLetter(ch) || unicode.IsDigit(ch)) { return fmt.Errorf("invalid character in breakpoint name '%c'", ch) } } retu...
go
func ValidBreakpointName(name string) error { if _, err := strconv.Atoi(name); err == nil { return errors.New("breakpoint name can not be a number") } for _, ch := range name { if !(unicode.IsLetter(ch) || unicode.IsDigit(ch)) { return fmt.Errorf("invalid character in breakpoint name '%c'", ch) } } retu...
[ "func", "ValidBreakpointName", "(", "name", "string", ")", "error", "{", "if", "_", ",", "err", ":=", "strconv", ".", "Atoi", "(", "name", ")", ";", "err", "==", "nil", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", ...
// ValidBreakpointName returns an error if // the name to be chosen for a breakpoint is invalid. // The name can not be just a number, and must contain a series // of letters or numbers.
[ "ValidBreakpointName", "returns", "an", "error", "if", "the", "name", "to", "be", "chosen", "for", "a", "breakpoint", "is", "invalid", ".", "The", "name", "can", "not", "be", "just", "a", "number", "and", "must", "contain", "a", "series", "of", "letters", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/types.go#L87-L99
127,749
go-delve/delve
service/api/types.go
Var
func (frame *Stackframe) Var(name string) *Variable { for i := range frame.Locals { if frame.Locals[i].Name == name { return &frame.Locals[i] } } for i := range frame.Arguments { if frame.Arguments[i].Name == name { return &frame.Arguments[i] } } return nil }
go
func (frame *Stackframe) Var(name string) *Variable { for i := range frame.Locals { if frame.Locals[i].Name == name { return &frame.Locals[i] } } for i := range frame.Arguments { if frame.Arguments[i].Name == name { return &frame.Arguments[i] } } return nil }
[ "func", "(", "frame", "*", "Stackframe", ")", "Var", "(", "name", "string", ")", "*", "Variable", "{", "for", "i", ":=", "range", "frame", ".", "Locals", "{", "if", "frame", ".", "Locals", "[", "i", "]", ".", "Name", "==", "name", "{", "return", ...
// Var will return the variable described by 'name' within // this stack frame.
[ "Var", "will", "return", "the", "variable", "described", "by", "name", "within", "this", "stack", "frame", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/types.go#L160-L172
127,750
go-delve/delve
pkg/proc/threads.go
ReturnValues
func (t *CommonThread) ReturnValues(cfg LoadConfig) []*Variable { loadValues(t.returnValues, cfg) return t.returnValues }
go
func (t *CommonThread) ReturnValues(cfg LoadConfig) []*Variable { loadValues(t.returnValues, cfg) return t.returnValues }
[ "func", "(", "t", "*", "CommonThread", ")", "ReturnValues", "(", "cfg", "LoadConfig", ")", "[", "]", "*", "Variable", "{", "loadValues", "(", "t", ".", "returnValues", ",", "cfg", ")", "\n", "return", "t", ".", "returnValues", "\n", "}" ]
// ReturnValues reads the return values from the function executing on // this thread using the provided LoadConfig.
[ "ReturnValues", "reads", "the", "return", "values", "from", "the", "function", "executing", "on", "this", "thread", "using", "the", "provided", "LoadConfig", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L77-L80
127,751
go-delve/delve
pkg/proc/threads.go
topframe
func topframe(g *G, thread Thread) (Stackframe, Stackframe, error) { var frames []Stackframe var err error if g == nil { if thread.Blocked() { return Stackframe{}, Stackframe{}, ErrThreadBlocked{} } frames, err = ThreadStacktrace(thread, 1) } else { frames, err = g.Stacktrace(1, true) } if err != nil ...
go
func topframe(g *G, thread Thread) (Stackframe, Stackframe, error) { var frames []Stackframe var err error if g == nil { if thread.Blocked() { return Stackframe{}, Stackframe{}, ErrThreadBlocked{} } frames, err = ThreadStacktrace(thread, 1) } else { frames, err = g.Stacktrace(1, true) } if err != nil ...
[ "func", "topframe", "(", "g", "*", "G", ",", "thread", "Thread", ")", "(", "Stackframe", ",", "Stackframe", ",", "error", ")", "{", "var", "frames", "[", "]", "Stackframe", "\n", "var", "err", "error", "\n\n", "if", "g", "==", "nil", "{", "if", "th...
// topframe returns the two topmost frames of g, or thread if g is nil.
[ "topframe", "returns", "the", "two", "topmost", "frames", "of", "g", "or", "thread", "if", "g", "is", "nil", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L83-L106
127,752
go-delve/delve
pkg/proc/threads.go
removeInlinedCalls
func removeInlinedCalls(dbp Process, pcs []uint64, topframe Stackframe) ([]uint64, error) { bi := dbp.BinInfo() irdr := reader.InlineStack(bi.dwarf, topframe.Call.Fn.offset, 0) for irdr.Next() { e := irdr.Entry() if e.Offset == topframe.Call.Fn.offset { continue } ranges, err := bi.dwarf.Ranges(e) if er...
go
func removeInlinedCalls(dbp Process, pcs []uint64, topframe Stackframe) ([]uint64, error) { bi := dbp.BinInfo() irdr := reader.InlineStack(bi.dwarf, topframe.Call.Fn.offset, 0) for irdr.Next() { e := irdr.Entry() if e.Offset == topframe.Call.Fn.offset { continue } ranges, err := bi.dwarf.Ranges(e) if er...
[ "func", "removeInlinedCalls", "(", "dbp", "Process", ",", "pcs", "[", "]", "uint64", ",", "topframe", "Stackframe", ")", "(", "[", "]", "uint64", ",", "error", ")", "{", "bi", ":=", "dbp", ".", "BinInfo", "(", ")", "\n", "irdr", ":=", "reader", ".", ...
// Removes instructions belonging to inlined calls of topframe from pcs. // If includeCurrentFn is true it will also remove all instructions // belonging to the current function.
[ "Removes", "instructions", "belonging", "to", "inlined", "calls", "of", "topframe", "from", "pcs", ".", "If", "includeCurrentFn", "is", "true", "it", "will", "also", "remove", "all", "instructions", "belonging", "to", "the", "current", "function", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L345-L363
127,753
go-delve/delve
pkg/proc/threads.go
ThreadScope
func ThreadScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 1) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } return FrameToScope(thread.BinInfo(), thread, nil, locations...), nil }
go
func ThreadScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 1) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } return FrameToScope(thread.BinInfo(), thread, nil, locations...), nil }
[ "func", "ThreadScope", "(", "thread", "Thread", ")", "(", "*", "EvalScope", ",", "error", ")", "{", "locations", ",", "err", ":=", "ThreadStacktrace", "(", "thread", ",", "1", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n...
// ThreadScope returns an EvalScope for this thread.
[ "ThreadScope", "returns", "an", "EvalScope", "for", "this", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L519-L528
127,754
go-delve/delve
pkg/proc/threads.go
GoroutineScope
func GoroutineScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 1) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } g, err := GetG(thread) if err != nil { return nil, err } return FrameToScope(thread.Bin...
go
func GoroutineScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 1) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } g, err := GetG(thread) if err != nil { return nil, err } return FrameToScope(thread.Bin...
[ "func", "GoroutineScope", "(", "thread", "Thread", ")", "(", "*", "EvalScope", ",", "error", ")", "{", "locations", ",", "err", ":=", "ThreadStacktrace", "(", "thread", ",", "1", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", ...
// GoroutineScope returns an EvalScope for the goroutine running on this thread.
[ "GoroutineScope", "returns", "an", "EvalScope", "for", "the", "goroutine", "running", "on", "this", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L531-L544
127,755
go-delve/delve
pkg/proc/threads.go
onNextGoroutine
func onNextGoroutine(thread Thread, breakpoints *BreakpointMap) (bool, error) { var bp *Breakpoint for i := range breakpoints.M { if breakpoints.M[i].Kind != UserBreakpoint && breakpoints.M[i].internalCond != nil { bp = breakpoints.M[i] break } } if bp == nil { return false, nil } // Internal breakpoi...
go
func onNextGoroutine(thread Thread, breakpoints *BreakpointMap) (bool, error) { var bp *Breakpoint for i := range breakpoints.M { if breakpoints.M[i].Kind != UserBreakpoint && breakpoints.M[i].internalCond != nil { bp = breakpoints.M[i] break } } if bp == nil { return false, nil } // Internal breakpoi...
[ "func", "onNextGoroutine", "(", "thread", "Thread", ",", "breakpoints", "*", "BreakpointMap", ")", "(", "bool", ",", "error", ")", "{", "var", "bp", "*", "Breakpoint", "\n", "for", "i", ":=", "range", "breakpoints", ".", "M", "{", "if", "breakpoints", "....
// onNextGoroutine 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" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/threads.go#L547-L570
127,756
go-delve/delve
pkg/proc/core/minidump/minidump.go
Open
func Open(path string, logfn func(fmt string, args ...interface{})) (*Minidump, error) { rawbuf, err := ioutil.ReadFile(path) //TODO(aarzilli): mmap? if err != nil { return nil, err } buf := &minidumpBuf{buf: rawbuf, kind: "file"} var mdmp Minidump readMinidumpHeader(&mdmp, buf) if buf.err != nil { return...
go
func Open(path string, logfn func(fmt string, args ...interface{})) (*Minidump, error) { rawbuf, err := ioutil.ReadFile(path) //TODO(aarzilli): mmap? if err != nil { return nil, err } buf := &minidumpBuf{buf: rawbuf, kind: "file"} var mdmp Minidump readMinidumpHeader(&mdmp, buf) if buf.err != nil { return...
[ "func", "Open", "(", "path", "string", ",", "logfn", "func", "(", "fmt", "string", ",", "args", "...", "interface", "{", "}", ")", ")", "(", "*", "Minidump", ",", "error", ")", "{", "rawbuf", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "path"...
// Open reads the minidump file at path and returns it as a Minidump structure.
[ "Open", "reads", "the", "minidump", "file", "at", "path", "and", "returns", "it", "as", "a", "Minidump", "structure", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L320-L418
127,757
go-delve/delve
pkg/proc/core/minidump/minidump.go
readMinidumpHeader
func readMinidumpHeader(mdmp *Minidump, buf *minidumpBuf) { buf.ctx = "reading minidump header" if sig := buf.u32(); sig != minidumpSignature { buf.err = ErrNotAMinidump{"signature", sig} return } if ver := buf.u16(); ver != minidumpVersion { buf.err = ErrNotAMinidump{"version", uint32(ver)} return } b...
go
func readMinidumpHeader(mdmp *Minidump, buf *minidumpBuf) { buf.ctx = "reading minidump header" if sig := buf.u32(); sig != minidumpSignature { buf.err = ErrNotAMinidump{"signature", sig} return } if ver := buf.u16(); ver != minidumpVersion { buf.err = ErrNotAMinidump{"version", uint32(ver)} return } b...
[ "func", "readMinidumpHeader", "(", "mdmp", "*", "Minidump", ",", "buf", "*", "minidumpBuf", ")", "{", "buf", ".", "ctx", "=", "\"", "\"", "\n\n", "if", "sig", ":=", "buf", ".", "u32", "(", ")", ";", "sig", "!=", "minidumpSignature", "{", "buf", ".", ...
// readMinidumpHeader reads the minidump file header
[ "readMinidumpHeader", "reads", "the", "minidump", "file", "header" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L455-L474
127,758
go-delve/delve
pkg/proc/core/minidump/minidump.go
readThreadList
func readThreadList(mdmp *Minidump, buf *minidumpBuf) { threadNum := buf.u32() if buf.err != nil { return } mdmp.Threads = make([]Thread, threadNum) for i := range mdmp.Threads { buf.ctx = fmt.Sprintf("reading thread list entry %d", i) thread := &mdmp.Threads[i] thread.ID = buf.u32() thread.SuspendCou...
go
func readThreadList(mdmp *Minidump, buf *minidumpBuf) { threadNum := buf.u32() if buf.err != nil { return } mdmp.Threads = make([]Thread, threadNum) for i := range mdmp.Threads { buf.ctx = fmt.Sprintf("reading thread list entry %d", i) thread := &mdmp.Threads[i] thread.ID = buf.u32() thread.SuspendCou...
[ "func", "readThreadList", "(", "mdmp", "*", "Minidump", ",", "buf", "*", "minidumpBuf", ")", "{", "threadNum", ":=", "buf", ".", "u32", "(", ")", "\n", "if", "buf", ".", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "mdmp", ".", "Threads", ...
// readThreadList reads a thread list stream and adds the threads to the minidump.
[ "readThreadList", "reads", "a", "thread", "list", "stream", "and", "adds", "the", "threads", "to", "the", "minidump", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L525-L553
127,759
go-delve/delve
pkg/proc/core/minidump/minidump.go
readModuleList
func readModuleList(mdmp *Minidump, buf *minidumpBuf) { moduleNum := buf.u32() if buf.err != nil { return } mdmp.Modules = make([]Module, moduleNum) for i := range mdmp.Modules { buf.ctx = fmt.Sprintf("reading module list entry %d", i) module := &mdmp.Modules[i] module.BaseOfImage = buf.u64() module.S...
go
func readModuleList(mdmp *Minidump, buf *minidumpBuf) { moduleNum := buf.u32() if buf.err != nil { return } mdmp.Modules = make([]Module, moduleNum) for i := range mdmp.Modules { buf.ctx = fmt.Sprintf("reading module list entry %d", i) module := &mdmp.Modules[i] module.BaseOfImage = buf.u64() module.S...
[ "func", "readModuleList", "(", "mdmp", "*", "Minidump", ",", "buf", "*", "minidumpBuf", ")", "{", "moduleNum", ":=", "buf", ".", "u32", "(", ")", "\n", "if", "buf", ".", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "mdmp", ".", "Modules", ...
// readModuleList reads a module list stream and adds the modules to the minidump.
[ "readModuleList", "reads", "a", "module", "list", "stream", "and", "adds", "the", "modules", "to", "the", "minidump", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L556-L595
127,760
go-delve/delve
pkg/proc/core/minidump/minidump.go
readMiscInfo
func readMiscInfo(mdmp *Minidump, buf *minidumpBuf) { buf.u32() // size of info buf.u32() // flags1 mdmp.Pid = buf.u32() // process_id // there are more fields here, but we don't care about them }
go
func readMiscInfo(mdmp *Minidump, buf *minidumpBuf) { buf.u32() // size of info buf.u32() // flags1 mdmp.Pid = buf.u32() // process_id // there are more fields here, but we don't care about them }
[ "func", "readMiscInfo", "(", "mdmp", "*", "Minidump", ",", "buf", "*", "minidumpBuf", ")", "{", "buf", ".", "u32", "(", ")", "// size of info", "\n", "buf", ".", "u32", "(", ")", "// flags1", "\n\n", "mdmp", ".", "Pid", "=", "buf", ".", "u32", "(", ...
// readMiscInfo reads the process_id from a MiscInfo stream.
[ "readMiscInfo", "reads", "the", "process_id", "from", "a", "MiscInfo", "stream", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L663-L669
127,761
go-delve/delve
pkg/proc/core/minidump/minidump.go
readMemoryDescriptor
func readMemoryDescriptor(mdmp *Minidump, buf *minidumpBuf) { addr := buf.u64() if buf.err != nil { return } _, rawData := readLocationDescriptor(buf) if buf.err != nil { return } mdmp.addMemory(addr, rawData) }
go
func readMemoryDescriptor(mdmp *Minidump, buf *minidumpBuf) { addr := buf.u64() if buf.err != nil { return } _, rawData := readLocationDescriptor(buf) if buf.err != nil { return } mdmp.addMemory(addr, rawData) }
[ "func", "readMemoryDescriptor", "(", "mdmp", "*", "Minidump", ",", "buf", "*", "minidumpBuf", ")", "{", "addr", ":=", "buf", ".", "u64", "(", ")", "\n", "if", "buf", ".", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "_", ",", "rawData", ":="...
// readMemoryDescriptor reads a memory descriptor struct and adds it to the memory map of the minidump.
[ "readMemoryDescriptor", "reads", "a", "memory", "descriptor", "struct", "and", "adds", "it", "to", "the", "memory", "map", "of", "the", "minidump", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/minidump/minidump.go#L672-L682
127,762
go-delve/delve
pkg/proc/winutil/regs.go
NewAMD64Registers
func NewAMD64Registers(context *CONTEXT, TebBaseAddress uint64, floatingPoint bool) *AMD64Registers { regs := &AMD64Registers{ rax: uint64(context.Rax), rbx: uint64(context.Rbx), rcx: uint64(context.Rcx), rdx: uint64(context.Rdx), rdi: uint64(context.Rdi), rsi: uint64(context.Rsi), rbp:...
go
func NewAMD64Registers(context *CONTEXT, TebBaseAddress uint64, floatingPoint bool) *AMD64Registers { regs := &AMD64Registers{ rax: uint64(context.Rax), rbx: uint64(context.Rbx), rcx: uint64(context.Rcx), rdx: uint64(context.Rdx), rdi: uint64(context.Rdi), rsi: uint64(context.Rsi), rbp:...
[ "func", "NewAMD64Registers", "(", "context", "*", "CONTEXT", ",", "TebBaseAddress", "uint64", ",", "floatingPoint", "bool", ")", "*", "AMD64Registers", "{", "regs", ":=", "&", "AMD64Registers", "{", "rax", ":", "uint64", "(", "context", ".", "Rax", ")", ",",...
// NewAMD64Registers creates a new AMD64Registers struct from a CONTEXT // struct and the TEB base address of the thread.
[ "NewAMD64Registers", "creates", "a", "new", "AMD64Registers", "struct", "from", "a", "CONTEXT", "struct", "and", "the", "TEB", "base", "address", "of", "the", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/winutil/regs.go#L42-L74
127,763
go-delve/delve
pkg/proc/winutil/regs.go
NewCONTEXT
func NewCONTEXT() *CONTEXT { var c *CONTEXT buf := make([]byte, unsafe.Sizeof(*c)+15) return (*CONTEXT)(unsafe.Pointer((uintptr(unsafe.Pointer(&buf[15]))) &^ 15)) }
go
func NewCONTEXT() *CONTEXT { var c *CONTEXT buf := make([]byte, unsafe.Sizeof(*c)+15) return (*CONTEXT)(unsafe.Pointer((uintptr(unsafe.Pointer(&buf[15]))) &^ 15)) }
[ "func", "NewCONTEXT", "(", ")", "*", "CONTEXT", "{", "var", "c", "*", "CONTEXT", "\n", "buf", ":=", "make", "(", "[", "]", "byte", ",", "unsafe", ".", "Sizeof", "(", "*", "c", ")", "+", "15", ")", "\n", "return", "(", "*", "CONTEXT", ")", "(", ...
// NewCONTEXT allocates Windows CONTEXT structure aligned to 16 bytes.
[ "NewCONTEXT", "allocates", "Windows", "CONTEXT", "structure", "aligned", "to", "16", "bytes", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/winutil/regs.go#L426-L430
127,764
go-delve/delve
pkg/proc/native/proc_linux.go
Launch
func Launch(cmd []string, wd string, foreground bool, debugInfoDirs []string) (*Process, error) { var ( process *exec.Cmd err error ) // check that the argument to Launch is an executable file if fi, staterr := os.Stat(cmd[0]); staterr == nil && (fi.Mode()&0111) == 0 { return nil, proc.ErrNotExecutable }...
go
func Launch(cmd []string, wd string, foreground bool, debugInfoDirs []string) (*Process, error) { var ( process *exec.Cmd err error ) // check that the argument to Launch is an executable file if fi, staterr := os.Stat(cmd[0]); staterr == nil && (fi.Mode()&0111) == 0 { return nil, proc.ErrNotExecutable }...
[ "func", "Launch", "(", "cmd", "[", "]", "string", ",", "wd", "string", ",", "foreground", "bool", ",", "debugInfoDirs", "[", "]", "string", ")", "(", "*", "Process", ",", "error", ")", "{", "var", "(", "process", "*", "exec", ".", "Cmd", "\n", "err...
// Launch creates and begins debugging a new process. First entry in // `cmd` is the program to run, and then rest are the arguments // to be supplied to that process. `wd` is working directory of the program. // If the DWARF information cannot be found in the binary, Delve will look // for external debug files in the ...
[ "Launch", "creates", "and", "begins", "debugging", "a", "new", "process", ".", "First", "entry", "in", "cmd", "is", "the", "program", "to", "run", "and", "then", "rest", "are", "the", "arguments", "to", "be", "supplied", "to", "that", "process", ".", "wd...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_linux.go#L51-L97
127,765
go-delve/delve
pkg/proc/native/proc_linux.go
Attach
func Attach(pid int, debugInfoDirs []string) (*Process, error) { dbp := New(pid) dbp.common = proc.NewCommonProcess(true) var err error dbp.execPtraceFunc(func() { err = PtraceAttach(dbp.pid) }) if err != nil { return nil, err } _, _, err = dbp.wait(dbp.pid, 0) if err != nil { return nil, err } err = db...
go
func Attach(pid int, debugInfoDirs []string) (*Process, error) { dbp := New(pid) dbp.common = proc.NewCommonProcess(true) var err error dbp.execPtraceFunc(func() { err = PtraceAttach(dbp.pid) }) if err != nil { return nil, err } _, _, err = dbp.wait(dbp.pid, 0) if err != nil { return nil, err } err = db...
[ "func", "Attach", "(", "pid", "int", ",", "debugInfoDirs", "[", "]", "string", ")", "(", "*", "Process", ",", "error", ")", "{", "dbp", ":=", "New", "(", "pid", ")", "\n", "dbp", ".", "common", "=", "proc", ".", "NewCommonProcess", "(", "true", ")"...
// Attach to an existing process with the given PID. Once attached, if // the DWARF information cannot be found in the binary, Delve will look // for external debug files in the directories passed in.
[ "Attach", "to", "an", "existing", "process", "with", "the", "given", "PID", ".", "Once", "attached", "if", "the", "DWARF", "information", "cannot", "be", "found", "in", "the", "binary", "Delve", "will", "look", "for", "external", "debug", "files", "in", "t...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_linux.go#L102-L122
127,766
go-delve/delve
pkg/proc/native/proc_linux.go
kill
func (dbp *Process) kill() (err error) { if dbp.exited { return nil } if !dbp.threads[dbp.pid].Stopped() { return errors.New("process must be stopped in order to kill it") } if err = sys.Kill(-dbp.pid, sys.SIGKILL); err != nil { return errors.New("could not deliver signal " + err.Error()) } if _, _, err = ...
go
func (dbp *Process) kill() (err error) { if dbp.exited { return nil } if !dbp.threads[dbp.pid].Stopped() { return errors.New("process must be stopped in order to kill it") } if err = sys.Kill(-dbp.pid, sys.SIGKILL); err != nil { return errors.New("could not deliver signal " + err.Error()) } if _, _, err = ...
[ "func", "(", "dbp", "*", "Process", ")", "kill", "(", ")", "(", "err", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "nil", "\n", "}", "\n", "if", "!", "dbp", ".", "threads", "[", "dbp", ".", "pid", "]", ".", "Stopped", "(", "...
// kill kills the target process.
[ "kill", "kills", "the", "target", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_linux.go#L152-L167
127,767
go-delve/delve
pkg/proc/native/proc_linux.go
addThread
func (dbp *Process) addThread(tid int, attach bool) (*Thread, error) { if thread, ok := dbp.threads[tid]; ok { return thread, nil } var err error if attach { dbp.execPtraceFunc(func() { err = sys.PtraceAttach(tid) }) if err != nil && err != sys.EPERM { // Do not return err if err == EPERM, // we may al...
go
func (dbp *Process) addThread(tid int, attach bool) (*Thread, error) { if thread, ok := dbp.threads[tid]; ok { return thread, nil } var err error if attach { dbp.execPtraceFunc(func() { err = sys.PtraceAttach(tid) }) if err != nil && err != sys.EPERM { // Do not return err if err == EPERM, // we may al...
[ "func", "(", "dbp", "*", "Process", ")", "addThread", "(", "tid", "int", ",", "attach", "bool", ")", "(", "*", "Thread", ",", "error", ")", "{", "if", "thread", ",", "ok", ":=", "dbp", ".", "threads", "[", "tid", "]", ";", "ok", "{", "return", ...
// Attach to a newly created thread, and store that thread in our list of // known threads.
[ "Attach", "to", "a", "newly", "created", "thread", "and", "store", "that", "thread", "in", "our", "list", "of", "known", "threads", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_linux.go#L175-L222
127,768
go-delve/delve
pkg/proc/native/proc_linux.go
waitFast
func (dbp *Process) waitFast(pid int) (int, *sys.WaitStatus, error) { var s sys.WaitStatus wpid, err := sys.Wait4(pid, &s, sys.WALL, nil) return wpid, &s, err }
go
func (dbp *Process) waitFast(pid int) (int, *sys.WaitStatus, error) { var s sys.WaitStatus wpid, err := sys.Wait4(pid, &s, sys.WALL, nil) return wpid, &s, err }
[ "func", "(", "dbp", "*", "Process", ")", "waitFast", "(", "pid", "int", ")", "(", "int", ",", "*", "sys", ".", "WaitStatus", ",", "error", ")", "{", "var", "s", "sys", ".", "WaitStatus", "\n", "wpid", ",", "err", ":=", "sys", ".", "Wait4", "(", ...
// waitFast is like wait but does not handle process-exit correctly
[ "waitFast", "is", "like", "wait", "but", "does", "not", "handle", "process", "-", "exit", "correctly" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_linux.go#L356-L360
127,769
go-delve/delve
pkg/proc/bininfo.go
NewBinaryInfo
func NewBinaryInfo(goos, goarch string) *BinaryInfo { r := &BinaryInfo{GOOS: goos, nameOfRuntimeType: make(map[uintptr]nameOfRuntimeTypeEntry), typeCache: make(map[dwarf.Offset]godwarf.Type)} // TODO: find better way to determine proc arch (perhaps use executable file info). switch goarch { case "amd64": r.Arch ...
go
func NewBinaryInfo(goos, goarch string) *BinaryInfo { r := &BinaryInfo{GOOS: goos, nameOfRuntimeType: make(map[uintptr]nameOfRuntimeTypeEntry), typeCache: make(map[dwarf.Offset]godwarf.Type)} // TODO: find better way to determine proc arch (perhaps use executable file info). switch goarch { case "amd64": r.Arch ...
[ "func", "NewBinaryInfo", "(", "goos", ",", "goarch", "string", ")", "*", "BinaryInfo", "{", "r", ":=", "&", "BinaryInfo", "{", "GOOS", ":", "goos", ",", "nameOfRuntimeType", ":", "make", "(", "map", "[", "uintptr", "]", "nameOfRuntimeTypeEntry", ")", ",", ...
// NewBinaryInfo returns an initialized but unloaded BinaryInfo struct.
[ "NewBinaryInfo", "returns", "an", "initialized", "but", "unloaded", "BinaryInfo", "struct", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L306-L316
127,770
go-delve/delve
pkg/proc/bininfo.go
LoadBinaryInfo
func (bi *BinaryInfo) LoadBinaryInfo(path string, entryPoint uint64, debugInfoDirs []string) error { fi, err := os.Stat(path) if err == nil { bi.lastModified = fi.ModTime() } var wg sync.WaitGroup defer wg.Wait() bi.Path = path switch bi.GOOS { case "linux": return bi.LoadBinaryInfoElf(path, entryPoint, de...
go
func (bi *BinaryInfo) LoadBinaryInfo(path string, entryPoint uint64, debugInfoDirs []string) error { fi, err := os.Stat(path) if err == nil { bi.lastModified = fi.ModTime() } var wg sync.WaitGroup defer wg.Wait() bi.Path = path switch bi.GOOS { case "linux": return bi.LoadBinaryInfoElf(path, entryPoint, de...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "LoadBinaryInfo", "(", "path", "string", ",", "entryPoint", "uint64", ",", "debugInfoDirs", "[", "]", "string", ")", "error", "{", "fi", ",", "err", ":=", "os", ".", "Stat", "(", "path", ")", "\n", "if", "er...
// LoadBinaryInfo will load and store the information from the binary at 'path'. // It is expected this will be called in parallel with other initialization steps // so a sync.WaitGroup must be provided.
[ "LoadBinaryInfo", "will", "load", "and", "store", "the", "information", "from", "the", "binary", "at", "path", ".", "It", "is", "expected", "this", "will", "be", "called", "in", "parallel", "with", "other", "initialization", "steps", "so", "a", "sync", ".", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L321-L339
127,771
go-delve/delve
pkg/proc/bininfo.go
Types
func (bi *BinaryInfo) Types() ([]string, error) { types := make([]string, 0, len(bi.types)) for k := range bi.types { types = append(types, k) } return types, nil }
go
func (bi *BinaryInfo) Types() ([]string, error) { types := make([]string, 0, len(bi.types)) for k := range bi.types { types = append(types, k) } return types, nil }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "Types", "(", ")", "(", "[", "]", "string", ",", "error", ")", "{", "types", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "bi", ".", "types", ")", ")", "\n", "for", "k", ":=", ...
// Types returns list of types present in the debugged program.
[ "Types", "returns", "list", "of", "types", "present", "in", "the", "debugged", "program", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L358-L364
127,772
go-delve/delve
pkg/proc/bininfo.go
PCToFunc
func (bi *BinaryInfo) PCToFunc(pc uint64) *Function { i := sort.Search(len(bi.Functions), func(i int) bool { fn := bi.Functions[i] return pc <= fn.Entry || (fn.Entry <= pc && pc < fn.End) }) if i != len(bi.Functions) { fn := &bi.Functions[i] if fn.Entry <= pc && pc < fn.End { return fn } } return nil ...
go
func (bi *BinaryInfo) PCToFunc(pc uint64) *Function { i := sort.Search(len(bi.Functions), func(i int) bool { fn := bi.Functions[i] return pc <= fn.Entry || (fn.Entry <= pc && pc < fn.End) }) if i != len(bi.Functions) { fn := &bi.Functions[i] if fn.Entry <= pc && pc < fn.End { return fn } } return nil ...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "PCToFunc", "(", "pc", "uint64", ")", "*", "Function", "{", "i", ":=", "sort", ".", "Search", "(", "len", "(", "bi", ".", "Functions", ")", ",", "func", "(", "i", "int", ")", "bool", "{", "fn", ":=", "...
// PCToFunc returns the function containing the given PC address
[ "PCToFunc", "returns", "the", "function", "containing", "the", "given", "PC", "address" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L414-L426
127,773
go-delve/delve
pkg/proc/bininfo.go
AddImage
func (bi *BinaryInfo) AddImage(path string, addr uint64) { if !strings.HasPrefix(path, "/") { return } for _, image := range bi.Images { if image.Path == path && image.addr == addr { return } } //TODO(aarzilli): actually load informations about the image here bi.Images = append(bi.Images, &Image{Path: pa...
go
func (bi *BinaryInfo) AddImage(path string, addr uint64) { if !strings.HasPrefix(path, "/") { return } for _, image := range bi.Images { if image.Path == path && image.addr == addr { return } } //TODO(aarzilli): actually load informations about the image here bi.Images = append(bi.Images, &Image{Path: pa...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "AddImage", "(", "path", "string", ",", "addr", "uint64", ")", "{", "if", "!", "strings", ".", "HasPrefix", "(", "path", ",", "\"", "\"", ")", "{", "return", "\n", "}", "\n", "for", "_", ",", "image", ":...
// AddImage adds the specified image to bi.
[ "AddImage", "adds", "the", "specified", "image", "to", "bi", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L435-L446
127,774
go-delve/delve
pkg/proc/bininfo.go
Close
func (bi *BinaryInfo) Close() error { if bi.sepDebugCloser != nil { bi.sepDebugCloser.Close() } if bi.closer != nil { return bi.closer.Close() } return nil }
go
func (bi *BinaryInfo) Close() error { if bi.sepDebugCloser != nil { bi.sepDebugCloser.Close() } if bi.closer != nil { return bi.closer.Close() } return nil }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "Close", "(", ")", "error", "{", "if", "bi", ".", "sepDebugCloser", "!=", "nil", "{", "bi", ".", "sepDebugCloser", ".", "Close", "(", ")", "\n", "}", "\n", "if", "bi", ".", "closer", "!=", "nil", "{", "r...
// Close closes all internal readers.
[ "Close", "closes", "all", "internal", "readers", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L449-L457
127,775
go-delve/delve
pkg/proc/bininfo.go
LoadFromData
func (bi *BinaryInfo) LoadFromData(dwdata *dwarf.Data, debugFrameBytes, debugLineBytes, debugLocBytes []byte) { bi.closer = (*nilCloser)(nil) bi.sepDebugCloser = (*nilCloser)(nil) bi.dwarf = dwdata if debugFrameBytes != nil { bi.frameEntries = frame.Parse(debugFrameBytes, frame.DwarfEndian(debugFrameBytes), bi.s...
go
func (bi *BinaryInfo) LoadFromData(dwdata *dwarf.Data, debugFrameBytes, debugLineBytes, debugLocBytes []byte) { bi.closer = (*nilCloser)(nil) bi.sepDebugCloser = (*nilCloser)(nil) bi.dwarf = dwdata if debugFrameBytes != nil { bi.frameEntries = frame.Parse(debugFrameBytes, frame.DwarfEndian(debugFrameBytes), bi.s...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "LoadFromData", "(", "dwdata", "*", "dwarf", ".", "Data", ",", "debugFrameBytes", ",", "debugLineBytes", ",", "debugLocBytes", "[", "]", "byte", ")", "{", "bi", ".", "closer", "=", "(", "*", "nilCloser", ")", ...
// LoadFromData creates a new BinaryInfo object using the specified data. // This is used for debugging BinaryInfo, you should use LoadBinary instead.
[ "LoadFromData", "creates", "a", "new", "BinaryInfo", "object", "using", "the", "specified", "data", ".", "This", "is", "used", "for", "debugging", "BinaryInfo", "you", "should", "use", "LoadBinary", "instead", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L476-L488
127,776
go-delve/delve
pkg/proc/bininfo.go
loclistEntry
func (bi *BinaryInfo) loclistEntry(off int64, pc uint64) []byte { var base uint64 if cu := bi.findCompileUnit(pc); cu != nil { base = cu.lowPC } bi.loclist.Seek(int(off)) var e loclistEntry for bi.loclist.Next(&e) { if e.BaseAddressSelection() { base = e.highpc continue } if pc >= e.lowpc+base && p...
go
func (bi *BinaryInfo) loclistEntry(off int64, pc uint64) []byte { var base uint64 if cu := bi.findCompileUnit(pc); cu != nil { base = cu.lowPC } bi.loclist.Seek(int(off)) var e loclistEntry for bi.loclist.Next(&e) { if e.BaseAddressSelection() { base = e.highpc continue } if pc >= e.lowpc+base && p...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "loclistEntry", "(", "off", "int64", ",", "pc", "uint64", ")", "[", "]", "byte", "{", "var", "base", "uint64", "\n", "if", "cu", ":=", "bi", ".", "findCompileUnit", "(", "pc", ")", ";", "cu", "!=", "nil", ...
// loclistEntry returns the loclist entry in the loclist starting at off, // for address pc.
[ "loclistEntry", "returns", "the", "loclist", "entry", "in", "the", "loclist", "starting", "at", "off", "for", "address", "pc", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L538-L557
127,777
go-delve/delve
pkg/proc/bininfo.go
findCompileUnit
func (bi *BinaryInfo) findCompileUnit(pc uint64) *compileUnit { for _, cu := range bi.compileUnits { for _, rng := range cu.ranges { if pc >= rng[0] && pc < rng[1] { return cu } } } return nil }
go
func (bi *BinaryInfo) findCompileUnit(pc uint64) *compileUnit { for _, cu := range bi.compileUnits { for _, rng := range cu.ranges { if pc >= rng[0] && pc < rng[1] { return cu } } } return nil }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "findCompileUnit", "(", "pc", "uint64", ")", "*", "compileUnit", "{", "for", "_", ",", "cu", ":=", "range", "bi", ".", "compileUnits", "{", "for", "_", ",", "rng", ":=", "range", "cu", ".", "ranges", "{", ...
// findCompileUnit returns the compile unit containing address pc.
[ "findCompileUnit", "returns", "the", "compile", "unit", "containing", "address", "pc", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L560-L569
127,778
go-delve/delve
pkg/proc/bininfo.go
Producer
func (bi *BinaryInfo) Producer() string { for _, cu := range bi.compileUnits { if cu.isgo && cu.producer != "" { return cu.producer } } return "" }
go
func (bi *BinaryInfo) Producer() string { for _, cu := range bi.compileUnits { if cu.isgo && cu.producer != "" { return cu.producer } } return "" }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "Producer", "(", ")", "string", "{", "for", "_", ",", "cu", ":=", "range", "bi", ".", "compileUnits", "{", "if", "cu", ".", "isgo", "&&", "cu", ".", "producer", "!=", "\"", "\"", "{", "return", "cu", "."...
// Producer returns the value of DW_AT_producer.
[ "Producer", "returns", "the", "value", "of", "DW_AT_producer", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L581-L588
127,779
go-delve/delve
pkg/proc/bininfo.go
Type
func (bi *BinaryInfo) Type(offset dwarf.Offset) (godwarf.Type, error) { return godwarf.ReadType(bi.dwarf, offset, bi.typeCache) }
go
func (bi *BinaryInfo) Type(offset dwarf.Offset) (godwarf.Type, error) { return godwarf.ReadType(bi.dwarf, offset, bi.typeCache) }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "Type", "(", "offset", "dwarf", ".", "Offset", ")", "(", "godwarf", ".", "Type", ",", "error", ")", "{", "return", "godwarf", ".", "ReadType", "(", "bi", ".", "dwarf", ",", "offset", ",", "bi", ".", "typeC...
// Type returns the Dwarf type entry at `offset`.
[ "Type", "returns", "the", "Dwarf", "type", "entry", "at", "offset", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L591-L593
127,780
go-delve/delve
pkg/proc/bininfo.go
LoadBinaryInfoElf
func (bi *BinaryInfo) LoadBinaryInfoElf(path string, entryPoint uint64, debugInfoDirectories []string, wg *sync.WaitGroup) error { exe, err := os.OpenFile(path, 0, os.ModePerm) if err != nil { return err } bi.closer = exe elfFile, err := elf.NewFile(exe) if err != nil { return err } if elfFile.Machine != el...
go
func (bi *BinaryInfo) LoadBinaryInfoElf(path string, entryPoint uint64, debugInfoDirectories []string, wg *sync.WaitGroup) error { exe, err := os.OpenFile(path, 0, os.ModePerm) if err != nil { return err } bi.closer = exe elfFile, err := elf.NewFile(exe) if err != nil { return err } if elfFile.Machine != el...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "LoadBinaryInfoElf", "(", "path", "string", ",", "entryPoint", "uint64", ",", "debugInfoDirectories", "[", "]", "string", ",", "wg", "*", "sync", ".", "WaitGroup", ")", "error", "{", "exe", ",", "err", ":=", "os...
// LoadBinaryInfoElf specifically loads information from an ELF binary.
[ "LoadBinaryInfoElf", "specifically", "loads", "information", "from", "an", "ELF", "binary", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L685-L743
127,781
go-delve/delve
pkg/proc/bininfo.go
LoadBinaryInfoPE
func (bi *BinaryInfo) LoadBinaryInfoPE(path string, entryPoint uint64, wg *sync.WaitGroup) error { peFile, closer, err := openExecutablePathPE(path) if err != nil { return err } bi.closer = closer if peFile.Machine != pe.IMAGE_FILE_MACHINE_AMD64 { return ErrUnsupportedWindowsArch } bi.dwarf, err = peFile.DWA...
go
func (bi *BinaryInfo) LoadBinaryInfoPE(path string, entryPoint uint64, wg *sync.WaitGroup) error { peFile, closer, err := openExecutablePathPE(path) if err != nil { return err } bi.closer = closer if peFile.Machine != pe.IMAGE_FILE_MACHINE_AMD64 { return ErrUnsupportedWindowsArch } bi.dwarf, err = peFile.DWA...
[ "func", "(", "bi", "*", "BinaryInfo", ")", "LoadBinaryInfoPE", "(", "path", "string", ",", "entryPoint", "uint64", ",", "wg", "*", "sync", ".", "WaitGroup", ")", "error", "{", "peFile", ",", "closer", ",", "err", ":=", "openExecutablePathPE", "(", "path", ...
// LoadBinaryInfoPE specifically loads information from a PE binary.
[ "LoadBinaryInfoPE", "specifically", "loads", "information", "from", "a", "PE", "binary", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/bininfo.go#L812-L855
127,782
go-delve/delve
pkg/proc/eval.go
EvalExpression
func (scope *EvalScope) EvalExpression(expr string, cfg LoadConfig) (*Variable, error) { t, err := parser.ParseExpr(expr) if err != nil { return nil, err } ev, err := scope.evalToplevelTypeCast(t, cfg) if ev == nil && err == nil { ev, err = scope.evalAST(t) } if err != nil { return nil, err } ev.loadVal...
go
func (scope *EvalScope) EvalExpression(expr string, cfg LoadConfig) (*Variable, error) { t, err := parser.ParseExpr(expr) if err != nil { return nil, err } ev, err := scope.evalToplevelTypeCast(t, cfg) if ev == nil && err == nil { ev, err = scope.evalAST(t) } if err != nil { return nil, err } ev.loadVal...
[ "func", "(", "scope", "*", "EvalScope", ")", "EvalExpression", "(", "expr", "string", ",", "cfg", "LoadConfig", ")", "(", "*", "Variable", ",", "error", ")", "{", "t", ",", "err", ":=", "parser", ".", "ParseExpr", "(", "expr", ")", "\n", "if", "err",...
// EvalExpression returns the value of the given expression.
[ "EvalExpression", "returns", "the", "value", "of", "the", "given", "expression", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/eval.go#L25-L43
127,783
go-delve/delve
pkg/proc/eval.go
evalIdent
func (scope *EvalScope) evalIdent(node *ast.Ident) (*Variable, error) { switch node.Name { case "true", "false": return newConstant(constant.MakeBool(node.Name == "true"), scope.Mem), nil case "nil": return nilVariable, nil } vars, err := scope.Locals() if err != nil { return nil, err } for i := range va...
go
func (scope *EvalScope) evalIdent(node *ast.Ident) (*Variable, error) { switch node.Name { case "true", "false": return newConstant(constant.MakeBool(node.Name == "true"), scope.Mem), nil case "nil": return nilVariable, nil } vars, err := scope.Locals() if err != nil { return nil, err } for i := range va...
[ "func", "(", "scope", "*", "EvalScope", ")", "evalIdent", "(", "node", "*", "ast", ".", "Ident", ")", "(", "*", "Variable", ",", "error", ")", "{", "switch", "node", ".", "Name", "{", "case", "\"", "\"", ",", "\"", "\"", ":", "return", "newConstant...
// Evaluates identifier expressions
[ "Evaluates", "identifier", "expressions" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/eval.go#L590-L616
127,784
go-delve/delve
pkg/proc/eval.go
findMethod
func (v *Variable) findMethod(mname string) (*Variable, error) { if _, isiface := v.RealType.(*godwarf.InterfaceType); isiface { v.loadInterface(0, false, loadFullValue) if v.Unreadable != nil { return nil, v.Unreadable } return v.Children[0].findMethod(mname) } typ := v.DwarfType ptyp, isptr := typ.(*g...
go
func (v *Variable) findMethod(mname string) (*Variable, error) { if _, isiface := v.RealType.(*godwarf.InterfaceType); isiface { v.loadInterface(0, false, loadFullValue) if v.Unreadable != nil { return nil, v.Unreadable } return v.Children[0].findMethod(mname) } typ := v.DwarfType ptyp, isptr := typ.(*g...
[ "func", "(", "v", "*", "Variable", ")", "findMethod", "(", "mname", "string", ")", "(", "*", "Variable", ",", "error", ")", "{", "if", "_", ",", "isiface", ":=", "v", ".", "RealType", ".", "(", "*", "godwarf", ".", "InterfaceType", ")", ";", "isifa...
// findMethod finds method mname in the type of variable v
[ "findMethod", "finds", "method", "mname", "in", "the", "type", "of", "variable", "v" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/eval.go#L1374-L1430
127,785
go-delve/delve
pkg/dwarf/line/state_machine.go
copy
func (sm *StateMachine) copy() *StateMachine { var r StateMachine r = *sm r.buf = bytes.NewBuffer(sm.buf.Bytes()) return &r }
go
func (sm *StateMachine) copy() *StateMachine { var r StateMachine r = *sm r.buf = bytes.NewBuffer(sm.buf.Bytes()) return &r }
[ "func", "(", "sm", "*", "StateMachine", ")", "copy", "(", ")", "*", "StateMachine", "{", "var", "r", "StateMachine", "\n", "r", "=", "*", "sm", "\n", "r", ".", "buf", "=", "bytes", ".", "NewBuffer", "(", "sm", ".", "buf", ".", "Bytes", "(", ")", ...
// copy returns a copy of this state machine, running the returned state // machine will not affect sm.
[ "copy", "returns", "a", "copy", "of", "this", "state", "machine", "running", "the", "returned", "state", "machine", "will", "not", "affect", "sm", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/line/state_machine.go#L176-L181
127,786
go-delve/delve
pkg/dwarf/line/state_machine.go
PCToLine
func (lineInfo *DebugLineInfo) PCToLine(basePC, pc uint64) (string, int) { if lineInfo == nil { return "", 0 } if basePC > pc { panic(fmt.Errorf("basePC after pc %#x %#x", basePC, pc)) } var sm *StateMachine if basePC == 0 { sm = newStateMachine(lineInfo, lineInfo.Instructions) } else { // Try to use th...
go
func (lineInfo *DebugLineInfo) PCToLine(basePC, pc uint64) (string, int) { if lineInfo == nil { return "", 0 } if basePC > pc { panic(fmt.Errorf("basePC after pc %#x %#x", basePC, pc)) } var sm *StateMachine if basePC == 0 { sm = newStateMachine(lineInfo, lineInfo.Instructions) } else { // Try to use th...
[ "func", "(", "lineInfo", "*", "DebugLineInfo", ")", "PCToLine", "(", "basePC", ",", "pc", "uint64", ")", "(", "string", ",", "int", ")", "{", "if", "lineInfo", "==", "nil", "{", "return", "\"", "\"", ",", "0", "\n", "}", "\n", "if", "basePC", ">", ...
// PCToLine returns the filename and line number associated with pc. // If pc isn't found inside lineInfo's table it will return the filename and // line number associated with the closest PC address preceding pc. // basePC will be used for caching, it's normally the entry point for the // function containing pc.
[ "PCToLine", "returns", "the", "filename", "and", "line", "number", "associated", "with", "pc", ".", "If", "pc", "isn", "t", "found", "inside", "lineInfo", "s", "table", "it", "will", "return", "the", "filename", "and", "line", "number", "associated", "with",...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/line/state_machine.go#L199-L224
127,787
go-delve/delve
pkg/dwarf/line/state_machine.go
PrologueEndPC
func (lineInfo *DebugLineInfo) PrologueEndPC(start, end uint64) (pc uint64, file string, line int, ok bool) { sm := lineInfo.stateMachineForEntry(start) for { if sm.valid { if sm.address >= end { return 0, "", 0, false } if sm.prologueEnd { return sm.address, sm.file, sm.line, true } } if er...
go
func (lineInfo *DebugLineInfo) PrologueEndPC(start, end uint64) (pc uint64, file string, line int, ok bool) { sm := lineInfo.stateMachineForEntry(start) for { if sm.valid { if sm.address >= end { return 0, "", 0, false } if sm.prologueEnd { return sm.address, sm.file, sm.line, true } } if er...
[ "func", "(", "lineInfo", "*", "DebugLineInfo", ")", "PrologueEndPC", "(", "start", ",", "end", "uint64", ")", "(", "pc", "uint64", ",", "file", "string", ",", "line", "int", ",", "ok", "bool", ")", "{", "sm", ":=", "lineInfo", ".", "stateMachineForEntry"...
// PrologueEndPC returns the first PC address marked as prologue_end in the half open interval [start, end)
[ "PrologueEndPC", "returns", "the", "first", "PC", "address", "marked", "as", "prologue_end", "in", "the", "half", "open", "interval", "[", "start", "end", ")" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/line/state_machine.go#L291-L309
127,788
go-delve/delve
pkg/dwarf/reader/reader.go
Seek
func (reader *Reader) Seek(off dwarf.Offset) { reader.depth = 0 reader.Reader.Seek(off) }
go
func (reader *Reader) Seek(off dwarf.Offset) { reader.depth = 0 reader.Reader.Seek(off) }
[ "func", "(", "reader", "*", "Reader", ")", "Seek", "(", "off", "dwarf", ".", "Offset", ")", "{", "reader", ".", "depth", "=", "0", "\n", "reader", ".", "Reader", ".", "Seek", "(", "off", ")", "\n", "}" ]
// Seek moves the reader to an arbitrary offset.
[ "Seek", "moves", "the", "reader", "to", "an", "arbitrary", "offset", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L22-L25
127,789
go-delve/delve
pkg/dwarf/reader/reader.go
SeekToEntry
func (reader *Reader) SeekToEntry(entry *dwarf.Entry) error { reader.Seek(entry.Offset) // Consume the current entry so .Next works as intended _, err := reader.Next() return err }
go
func (reader *Reader) SeekToEntry(entry *dwarf.Entry) error { reader.Seek(entry.Offset) // Consume the current entry so .Next works as intended _, err := reader.Next() return err }
[ "func", "(", "reader", "*", "Reader", ")", "SeekToEntry", "(", "entry", "*", "dwarf", ".", "Entry", ")", "error", "{", "reader", ".", "Seek", "(", "entry", ".", "Offset", ")", "\n", "// Consume the current entry so .Next works as intended", "_", ",", "err", ...
// SeekToEntry moves the reader to an arbitrary entry.
[ "SeekToEntry", "moves", "the", "reader", "to", "an", "arbitrary", "entry", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L28-L33
127,790
go-delve/delve
pkg/dwarf/reader/reader.go
SeekToFunction
func (reader *Reader) SeekToFunction(pc RelAddr) (*dwarf.Entry, error) { reader.Seek(0) for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Tag != dwarf.TagSubprogram { continue } lowpc, ok := entry.Val(dwarf.AttrLowpc).(uint64) if...
go
func (reader *Reader) SeekToFunction(pc RelAddr) (*dwarf.Entry, error) { reader.Seek(0) for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Tag != dwarf.TagSubprogram { continue } lowpc, ok := entry.Val(dwarf.AttrLowpc).(uint64) if...
[ "func", "(", "reader", "*", "Reader", ")", "SeekToFunction", "(", "pc", "RelAddr", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "reader", ".", "Seek", "(", "0", ")", "\n", "for", "entry", ",", "err", ":=", "reader", ".", "Next", ...
// SeekToFunctionEntry moves the reader to the function that includes the // specified program counter.
[ "SeekToFunctionEntry", "moves", "the", "reader", "to", "the", "function", "that", "includes", "the", "specified", "program", "counter", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L37-L64
127,791
go-delve/delve
pkg/dwarf/reader/reader.go
AddrFor
func (reader *Reader) AddrFor(name string, staticBase uint64) (uint64, error) { entry, err := reader.FindEntryNamed(name, false) if err != nil { return 0, err } instructions, ok := entry.Val(dwarf.AttrLocation).([]byte) if !ok { return 0, fmt.Errorf("type assertion failed") } addr, _, err := op.ExecuteStackP...
go
func (reader *Reader) AddrFor(name string, staticBase uint64) (uint64, error) { entry, err := reader.FindEntryNamed(name, false) if err != nil { return 0, err } instructions, ok := entry.Val(dwarf.AttrLocation).([]byte) if !ok { return 0, fmt.Errorf("type assertion failed") } addr, _, err := op.ExecuteStackP...
[ "func", "(", "reader", "*", "Reader", ")", "AddrFor", "(", "name", "string", ",", "staticBase", "uint64", ")", "(", "uint64", ",", "error", ")", "{", "entry", ",", "err", ":=", "reader", ".", "FindEntryNamed", "(", "name", ",", "false", ")", "\n", "i...
// Returns the address for the named entry.
[ "Returns", "the", "address", "for", "the", "named", "entry", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L67-L81
127,792
go-delve/delve
pkg/dwarf/reader/reader.go
AddrForMember
func (reader *Reader) AddrForMember(member string, initialInstructions []byte) (uint64, error) { for { entry, err := reader.NextMemberVariable() if err != nil { return 0, err } if entry == nil { return 0, fmt.Errorf("nil entry for member named %s", member) } name, ok := entry.Val(dwarf.AttrName).(str...
go
func (reader *Reader) AddrForMember(member string, initialInstructions []byte) (uint64, error) { for { entry, err := reader.NextMemberVariable() if err != nil { return 0, err } if entry == nil { return 0, fmt.Errorf("nil entry for member named %s", member) } name, ok := entry.Val(dwarf.AttrName).(str...
[ "func", "(", "reader", "*", "Reader", ")", "AddrForMember", "(", "member", "string", ",", "initialInstructions", "[", "]", "byte", ")", "(", "uint64", ",", "error", ")", "{", "for", "{", "entry", ",", "err", ":=", "reader", ".", "NextMemberVariable", "("...
// Returns the address for the named struct member. Expects the reader to be at the parent entry // or one of the parents children, thus does not seek to parent by itself.
[ "Returns", "the", "address", "for", "the", "named", "struct", "member", ".", "Expects", "the", "reader", "to", "be", "at", "the", "parent", "entry", "or", "one", "of", "the", "parents", "children", "thus", "does", "not", "seek", "to", "parent", "by", "it...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L85-L105
127,793
go-delve/delve
pkg/dwarf/reader/reader.go
SeekToType
func (reader *Reader) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error) { offset, ok := entry.Val(dwarf.AttrType).(dwarf.Offset) if !ok { return nil, fmt.Errorf("entry does not have a type attribute") } // Seek to the first type offset reader.Seek(offset) // ...
go
func (reader *Reader) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error) { offset, ok := entry.Val(dwarf.AttrType).(dwarf.Offset) if !ok { return nil, fmt.Errorf("entry does not have a type attribute") } // Seek to the first type offset reader.Seek(offset) // ...
[ "func", "(", "reader", "*", "Reader", ")", "SeekToType", "(", "entry", "*", "dwarf", ".", "Entry", ",", "resolveTypedefs", "bool", ",", "resolvePointerTypes", "bool", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "offset", ",", "ok", ":...
// SeekToType moves the reader to the type specified by the entry, // optionally resolving typedefs and pointer types. If the reader is set // to a struct type the NextMemberVariable call can be used to walk all member data.
[ "SeekToType", "moves", "the", "reader", "to", "the", "type", "specified", "by", "the", "entry", "optionally", "resolving", "typedefs", "and", "pointer", "types", ".", "If", "the", "reader", "is", "set", "to", "a", "struct", "type", "the", "NextMemberVariable",...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L112-L144
127,794
go-delve/delve
pkg/dwarf/reader/reader.go
SeekToTypeNamed
func (reader *Reader) SeekToTypeNamed(name string) (*dwarf.Entry, error) { // Walk the types to the base for entry, err := reader.NextType(); entry != nil; entry, err = reader.NextType() { if err != nil { return nil, err } n, ok := entry.Val(dwarf.AttrName).(string) if !ok { continue } if n == nam...
go
func (reader *Reader) SeekToTypeNamed(name string) (*dwarf.Entry, error) { // Walk the types to the base for entry, err := reader.NextType(); entry != nil; entry, err = reader.NextType() { if err != nil { return nil, err } n, ok := entry.Val(dwarf.AttrName).(string) if !ok { continue } if n == nam...
[ "func", "(", "reader", "*", "Reader", ")", "SeekToTypeNamed", "(", "name", "string", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "// Walk the types to the base", "for", "entry", ",", "err", ":=", "reader", ".", "NextType", "(", ")", ";"...
// SeekToTypeNamed moves the reader to the type specified by the name. // If the reader is set to a struct type the NextMemberVariable call // can be used to walk all member data.
[ "SeekToTypeNamed", "moves", "the", "reader", "to", "the", "type", "specified", "by", "the", "name", ".", "If", "the", "reader", "is", "set", "to", "a", "struct", "type", "the", "NextMemberVariable", "call", "can", "be", "used", "to", "walk", "all", "member...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L164-L182
127,795
go-delve/delve
pkg/dwarf/reader/reader.go
FindEntryNamed
func (reader *Reader) FindEntryNamed(name string, member bool) (*dwarf.Entry, error) { depth := 1 for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Children { depth++ } if entry.Tag == 0 { depth-- if depth <= 0 { return n...
go
func (reader *Reader) FindEntryNamed(name string, member bool) (*dwarf.Entry, error) { depth := 1 for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Children { depth++ } if entry.Tag == 0 { depth-- if depth <= 0 { return n...
[ "func", "(", "reader", "*", "Reader", ")", "FindEntryNamed", "(", "name", "string", ",", "member", "bool", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "depth", ":=", "1", "\n", "for", "entry", ",", "err", ":=", "reader", ".", "Nex...
// Finds the entry for 'name'.
[ "Finds", "the", "entry", "for", "name", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L185-L220
127,796
go-delve/delve
pkg/dwarf/reader/reader.go
NextMemberVariable
func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error) { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } // All member variables will be at the same depth reader.SkipChildren() // End of the current depth if entry.Tag == 0 { br...
go
func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error) { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } // All member variables will be at the same depth reader.SkipChildren() // End of the current depth if entry.Tag == 0 { br...
[ "func", "(", "reader", "*", "Reader", ")", "NextMemberVariable", "(", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "for", "entry", ",", "err", ":=", "reader", ".", "Next", "(", ")", ";", "entry", "!=", "nil", ";", "entry", ",", "...
// NextMemberVariable 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", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L261-L282
127,797
go-delve/delve
pkg/dwarf/reader/reader.go
NextPackageVariable
func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error) { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Tag == dwarf.TagVariable { ext, ok := entry.Val(dwarf.AttrExternal).(bool) if ok && ext { return entry, nil }...
go
func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error) { for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { if err != nil { return nil, err } if entry.Tag == dwarf.TagVariable { ext, ok := entry.Val(dwarf.AttrExternal).(bool) if ok && ext { return entry, nil }...
[ "func", "(", "reader", "*", "Reader", ")", "NextPackageVariable", "(", ")", "(", "*", "dwarf", ".", "Entry", ",", "error", ")", "{", "for", "entry", ",", "err", ":=", "reader", ".", "Next", "(", ")", ";", "entry", "!=", "nil", ";", "entry", ",", ...
// 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.
[ "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", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L286-L307
127,798
go-delve/delve
pkg/dwarf/reader/reader.go
LoadAbstractOrigin
func LoadAbstractOrigin(entry *dwarf.Entry, aordr *dwarf.Reader) (Entry, dwarf.Offset) { ao, ok := entry.Val(dwarf.AttrAbstractOrigin).(dwarf.Offset) if !ok { return entry, entry.Offset } r := []*dwarf.Entry{entry} for { aordr.Seek(ao) e, _ := aordr.Next() if e == nil { break } r = append(r, e) ...
go
func LoadAbstractOrigin(entry *dwarf.Entry, aordr *dwarf.Reader) (Entry, dwarf.Offset) { ao, ok := entry.Val(dwarf.AttrAbstractOrigin).(dwarf.Offset) if !ok { return entry, entry.Offset } r := []*dwarf.Entry{entry} for { aordr.Seek(ao) e, _ := aordr.Next() if e == nil { break } r = append(r, e) ...
[ "func", "LoadAbstractOrigin", "(", "entry", "*", "dwarf", ".", "Entry", ",", "aordr", "*", "dwarf", ".", "Reader", ")", "(", "Entry", ",", "dwarf", ".", "Offset", ")", "{", "ao", ",", "ok", ":=", "entry", ".", "Val", "(", "dwarf", ".", "AttrAbstractO...
// LoadAbstractOrigin loads the entry corresponding to the // DW_AT_abstract_origin of entry and returns a combination of entry and its // abstract origin.
[ "LoadAbstractOrigin", "loads", "the", "entry", "corresponding", "to", "the", "DW_AT_abstract_origin", "of", "entry", "and", "returns", "a", "combination", "of", "entry", "and", "its", "abstract", "origin", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L344-L367
127,799
go-delve/delve
pkg/dwarf/reader/reader.go
InlineStack
func InlineStack(dwarf *dwarf.Data, fnoff dwarf.Offset, pc RelAddr) *InlineStackReader { reader := dwarf.Reader() reader.Seek(fnoff) return &InlineStackReader{dwarf: dwarf, reader: reader, entry: nil, depth: 0, pc: uint64(pc)} }
go
func InlineStack(dwarf *dwarf.Data, fnoff dwarf.Offset, pc RelAddr) *InlineStackReader { reader := dwarf.Reader() reader.Seek(fnoff) return &InlineStackReader{dwarf: dwarf, reader: reader, entry: nil, depth: 0, pc: uint64(pc)} }
[ "func", "InlineStack", "(", "dwarf", "*", "dwarf", ".", "Data", ",", "fnoff", "dwarf", ".", "Offset", ",", "pc", "RelAddr", ")", "*", "InlineStackReader", "{", "reader", ":=", "dwarf", ".", "Reader", "(", ")", "\n", "reader", ".", "Seek", "(", "fnoff",...
// InlineStack returns an InlineStackReader for the specified function and // PC address. // If pc is 0 then all inlined calls will be returned.
[ "InlineStack", "returns", "an", "InlineStackReader", "for", "the", "specified", "function", "and", "PC", "address", ".", "If", "pc", "is", "0", "then", "all", "inlined", "calls", "will", "be", "returned", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L383-L387