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,900
go-delve/delve
pkg/proc/proc.go
SameGoroutineCondition
func SameGoroutineCondition(g *G) ast.Expr { if g == nil { return nil } return &ast.BinaryExpr{ Op: token.EQL, X: &ast.SelectorExpr{ X: &ast.SelectorExpr{ X: &ast.Ident{Name: "runtime"}, Sel: &ast.Ident{Name: "curg"}, }, Sel: &ast.Ident{Name: "goid"}, }, Y: &ast.BasicLit{Kind: token.INT,...
go
func SameGoroutineCondition(g *G) ast.Expr { if g == nil { return nil } return &ast.BinaryExpr{ Op: token.EQL, X: &ast.SelectorExpr{ X: &ast.SelectorExpr{ X: &ast.Ident{Name: "runtime"}, Sel: &ast.Ident{Name: "curg"}, }, Sel: &ast.Ident{Name: "goid"}, }, Y: &ast.BasicLit{Kind: token.INT,...
[ "func", "SameGoroutineCondition", "(", "g", "*", "G", ")", "ast", ".", "Expr", "{", "if", "g", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "&", "ast", ".", "BinaryExpr", "{", "Op", ":", "token", ".", "EQL", ",", "X", ":", "&", ...
// SameGoroutineCondition returns an expression that evaluates to true when // the current goroutine is g.
[ "SameGoroutineCondition", "returns", "an", "expression", "that", "evaluates", "to", "true", "when", "the", "current", "goroutine", "is", "g", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L374-L389
127,901
go-delve/delve
pkg/proc/proc.go
StepOut
func StepOut(dbp Process) error { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } selg := dbp.SelectedGoroutine() curthread := dbp.CurrentThread() topframe, retframe, err := topframe(selg, curthread) if err != ni...
go
func StepOut(dbp Process) error { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } selg := dbp.SelectedGoroutine() curthread := dbp.CurrentThread() topframe, retframe, err := topframe(selg, curthread) if err != ni...
[ "func", "StepOut", "(", "dbp", "Process", ")", "error", "{", "if", "_", ",", "err", ":=", "dbp", ".", "Valid", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "dbp", ".", "Breakpoints", "(", ")", ".", "HasInternalB...
// StepOut will continue until the current goroutine exits the // function currently being executed or a deferred function is executed
[ "StepOut", "will", "continue", "until", "the", "current", "goroutine", "exits", "the", "function", "currently", "being", "executed", "or", "a", "deferred", "function", "is", "executed" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L415-L498
127,902
go-delve/delve
pkg/proc/proc.go
FindGoroutine
func FindGoroutine(dbp Process, gid int) (*G, error) { if selg := dbp.SelectedGoroutine(); (gid == -1) || (selg != nil && selg.ID == gid) || (selg == nil && gid == 0) { // Return the currently selected goroutine in the following circumstances: // // 1. if the caller asks for gid == -1 (because that's what a goro...
go
func FindGoroutine(dbp Process, gid int) (*G, error) { if selg := dbp.SelectedGoroutine(); (gid == -1) || (selg != nil && selg.ID == gid) || (selg == nil && gid == 0) { // Return the currently selected goroutine in the following circumstances: // // 1. if the caller asks for gid == -1 (because that's what a goro...
[ "func", "FindGoroutine", "(", "dbp", "Process", ",", "gid", "int", ")", "(", "*", "G", ",", "error", ")", "{", "if", "selg", ":=", "dbp", ".", "SelectedGoroutine", "(", ")", ";", "(", "gid", "==", "-", "1", ")", "||", "(", "selg", "!=", "nil", ...
// FindGoroutine returns a G struct representing the goroutine // specified by `gid`.
[ "FindGoroutine", "returns", "a", "G", "struct", "representing", "the", "goroutine", "specified", "by", "gid", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L599-L656
127,903
go-delve/delve
pkg/proc/proc.go
ConvertEvalScope
func ConvertEvalScope(dbp Process, gid, frame, deferCall int) (*EvalScope, error) { if _, err := dbp.Valid(); err != nil { return nil, err } ct := dbp.CurrentThread() g, err := FindGoroutine(dbp, gid) if err != nil { return nil, err } if g == nil { return ThreadScope(ct) } var thread MemoryReadWriter i...
go
func ConvertEvalScope(dbp Process, gid, frame, deferCall int) (*EvalScope, error) { if _, err := dbp.Valid(); err != nil { return nil, err } ct := dbp.CurrentThread() g, err := FindGoroutine(dbp, gid) if err != nil { return nil, err } if g == nil { return ThreadScope(ct) } var thread MemoryReadWriter i...
[ "func", "ConvertEvalScope", "(", "dbp", "Process", ",", "gid", ",", "frame", ",", "deferCall", "int", ")", "(", "*", "EvalScope", ",", "error", ")", "{", "if", "_", ",", "err", ":=", "dbp", ".", "Valid", "(", ")", ";", "err", "!=", "nil", "{", "r...
// ConvertEvalScope returns a new EvalScope in the context of the // specified goroutine ID and stack frame. // If deferCall is > 0 the eval scope will be relative to the specified deferred call.
[ "ConvertEvalScope", "returns", "a", "new", "EvalScope", "in", "the", "context", "of", "the", "specified", "goroutine", "ID", "and", "stack", "frame", ".", "If", "deferCall", "is", ">", "0", "the", "eval", "scope", "will", "be", "relative", "to", "the", "sp...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L661-L704
127,904
go-delve/delve
pkg/proc/proc.go
createUnrecoveredPanicBreakpoint
func createUnrecoveredPanicBreakpoint(p Process, writeBreakpoint WriteBreakpointFn) { panicpc, err := FindFunctionLocation(p, "runtime.startpanic", true, 0) if _, isFnNotFound := err.(*ErrFunctionNotFound); isFnNotFound { panicpc, err = FindFunctionLocation(p, "runtime.fatalpanic", true, 0) } if err == nil { bp...
go
func createUnrecoveredPanicBreakpoint(p Process, writeBreakpoint WriteBreakpointFn) { panicpc, err := FindFunctionLocation(p, "runtime.startpanic", true, 0) if _, isFnNotFound := err.(*ErrFunctionNotFound); isFnNotFound { panicpc, err = FindFunctionLocation(p, "runtime.fatalpanic", true, 0) } if err == nil { bp...
[ "func", "createUnrecoveredPanicBreakpoint", "(", "p", "Process", ",", "writeBreakpoint", "WriteBreakpointFn", ")", "{", "panicpc", ",", "err", ":=", "FindFunctionLocation", "(", "p", ",", "\"", "\"", ",", "true", ",", "0", ")", "\n", "if", "_", ",", "isFnNot...
// createUnrecoveredPanicBreakpoint creates the unrecoverable-panic breakpoint. // This function is meant to be called by implementations of the Process interface.
[ "createUnrecoveredPanicBreakpoint", "creates", "the", "unrecoverable", "-", "panic", "breakpoint", ".", "This", "function", "is", "meant", "to", "be", "called", "by", "implementations", "of", "the", "Process", "interface", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L738-L750
127,905
go-delve/delve
pkg/proc/proc.go
FirstPCAfterPrologue
func FirstPCAfterPrologue(p Process, fn *Function, sameline bool) (uint64, error) { pc, _, line, ok := fn.cu.lineInfo.PrologueEndPC(fn.Entry, fn.End) if ok { if !sameline { return pc, nil } _, entryLine := fn.cu.lineInfo.PCToLine(fn.Entry, fn.Entry) if entryLine == line { return pc, nil } } pc, err...
go
func FirstPCAfterPrologue(p Process, fn *Function, sameline bool) (uint64, error) { pc, _, line, ok := fn.cu.lineInfo.PrologueEndPC(fn.Entry, fn.End) if ok { if !sameline { return pc, nil } _, entryLine := fn.cu.lineInfo.PCToLine(fn.Entry, fn.Entry) if entryLine == line { return pc, nil } } pc, err...
[ "func", "FirstPCAfterPrologue", "(", "p", "Process", ",", "fn", "*", "Function", ",", "sameline", "bool", ")", "(", "uint64", ",", "error", ")", "{", "pc", ",", "_", ",", "line", ",", "ok", ":=", "fn", ".", "cu", ".", "lineInfo", ".", "PrologueEndPC"...
// FirstPCAfterPrologue returns the address of the first // instruction after the prologue for function fn. // If sameline is set FirstPCAfterPrologue will always return an // address associated with the same line as fn.Entry.
[ "FirstPCAfterPrologue", "returns", "the", "address", "of", "the", "first", "instruction", "after", "the", "prologue", "for", "function", "fn", ".", "If", "sameline", "is", "set", "FirstPCAfterPrologue", "will", "always", "return", "an", "address", "associated", "w...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L766-L794
127,906
go-delve/delve
pkg/config/config.go
LoadConfig
func LoadConfig() *Config { err := createConfigPath() if err != nil { fmt.Printf("Could not create config directory: %v.", err) return &Config{} } fullConfigFile, err := GetConfigFilePath(configFile) if err != nil { fmt.Printf("Unable to get config file path: %v.", err) return &Config{} } hasOldConfig, ...
go
func LoadConfig() *Config { err := createConfigPath() if err != nil { fmt.Printf("Could not create config directory: %v.", err) return &Config{} } fullConfigFile, err := GetConfigFilePath(configFile) if err != nil { fmt.Printf("Unable to get config file path: %v.", err) return &Config{} } hasOldConfig, ...
[ "func", "LoadConfig", "(", ")", "*", "Config", "{", "err", ":=", "createConfigPath", "(", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Printf", "(", "\"", "\"", ",", "err", ")", "\n", "return", "&", "Config", "{", "}", "\n", "}", "\n", ...
// LoadConfig attempts to populate a Config object from the config.yml file.
[ "LoadConfig", "attempts", "to", "populate", "a", "Config", "object", "from", "the", "config", ".", "yml", "file", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/config/config.go#L60-L125
127,907
go-delve/delve
pkg/config/config.go
SaveConfig
func SaveConfig(conf *Config) error { fullConfigFile, err := GetConfigFilePath(configFile) if err != nil { return err } out, err := yaml.Marshal(*conf) if err != nil { return err } f, err := os.Create(fullConfigFile) if err != nil { return err } defer f.Close() _, err = f.Write(out) return err }
go
func SaveConfig(conf *Config) error { fullConfigFile, err := GetConfigFilePath(configFile) if err != nil { return err } out, err := yaml.Marshal(*conf) if err != nil { return err } f, err := os.Create(fullConfigFile) if err != nil { return err } defer f.Close() _, err = f.Write(out) return err }
[ "func", "SaveConfig", "(", "conf", "*", "Config", ")", "error", "{", "fullConfigFile", ",", "err", ":=", "GetConfigFilePath", "(", "configFile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "out", ",", "err", ":=", "yam...
// SaveConfig will marshal and save the config struct // to disk.
[ "SaveConfig", "will", "marshal", "and", "save", "the", "config", "struct", "to", "disk", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/config/config.go#L129-L148
127,908
go-delve/delve
pkg/config/config.go
createConfigPath
func createConfigPath() error { path, err := GetConfigFilePath("") if err != nil { return err } return os.MkdirAll(path, 0700) }
go
func createConfigPath() error { path, err := GetConfigFilePath("") if err != nil { return err } return os.MkdirAll(path, 0700) }
[ "func", "createConfigPath", "(", ")", "error", "{", "path", ",", "err", ":=", "GetConfigFilePath", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "os", ".", "MkdirAll", "(", "path", ",", "0700",...
// createConfigPath creates the directory structure at which all config files are saved.
[ "createConfigPath", "creates", "the", "directory", "structure", "at", "which", "all", "config", "files", "are", "saved", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/config/config.go#L229-L235
127,909
go-delve/delve
pkg/config/config.go
GetConfigFilePath
func GetConfigFilePath(file string) (string, error) { if configPath := os.Getenv("XDG_CONFIG_HOME"); configPath != "" { return path.Join(configPath, configDir, file), nil } userHomeDir := getUserHomeDir() if runtime.GOOS == "linux" { return path.Join(userHomeDir, ".config", configDir, file), nil } return pa...
go
func GetConfigFilePath(file string) (string, error) { if configPath := os.Getenv("XDG_CONFIG_HOME"); configPath != "" { return path.Join(configPath, configDir, file), nil } userHomeDir := getUserHomeDir() if runtime.GOOS == "linux" { return path.Join(userHomeDir, ".config", configDir, file), nil } return pa...
[ "func", "GetConfigFilePath", "(", "file", "string", ")", "(", "string", ",", "error", ")", "{", "if", "configPath", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", ";", "configPath", "!=", "\"", "\"", "{", "return", "path", ".", "Join", "(", "config...
// GetConfigFilePath gets the full path to the given config file name.
[ "GetConfigFilePath", "gets", "the", "full", "path", "to", "the", "given", "config", "file", "name", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/config/config.go#L238-L249
127,910
go-delve/delve
pkg/proc/core/linux_amd64_core.go
readNotes
func readNotes(core *elf.File) ([]*Note, error) { var notesProg *elf.Prog for _, prog := range core.Progs { if prog.Type == elf.PT_NOTE { notesProg = prog break } } r := notesProg.Open() notes := []*Note{} for { note, err := readNote(r) if err == io.EOF { break } if err != nil { return ni...
go
func readNotes(core *elf.File) ([]*Note, error) { var notesProg *elf.Prog for _, prog := range core.Progs { if prog.Type == elf.PT_NOTE { notesProg = prog break } } r := notesProg.Open() notes := []*Note{} for { note, err := readNote(r) if err == io.EOF { break } if err != nil { return ni...
[ "func", "readNotes", "(", "core", "*", "elf", ".", "File", ")", "(", "[", "]", "*", "Note", ",", "error", ")", "{", "var", "notesProg", "*", "elf", ".", "Prog", "\n", "for", "_", ",", "prog", ":=", "range", "core", ".", "Progs", "{", "if", "pro...
// readNotes reads all the notes from the notes prog in core.
[ "readNotes", "reads", "all", "the", "notes", "from", "the", "notes", "prog", "in", "core", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/linux_amd64_core.go#L133-L156
127,911
go-delve/delve
pkg/proc/core/linux_amd64_core.go
skipPadding
func skipPadding(r io.ReadSeeker, pad int64) error { pos, err := r.Seek(0, os.SEEK_CUR) if err != nil { return err } if pos%pad == 0 { return nil } if _, err := r.Seek(pad-(pos%pad), os.SEEK_CUR); err != nil { return err } return nil }
go
func skipPadding(r io.ReadSeeker, pad int64) error { pos, err := r.Seek(0, os.SEEK_CUR) if err != nil { return err } if pos%pad == 0 { return nil } if _, err := r.Seek(pad-(pos%pad), os.SEEK_CUR); err != nil { return err } return nil }
[ "func", "skipPadding", "(", "r", "io", ".", "ReadSeeker", ",", "pad", "int64", ")", "error", "{", "pos", ",", "err", ":=", "r", ".", "Seek", "(", "0", ",", "os", ".", "SEEK_CUR", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", ...
// skipPadding moves r to the next multiple of pad.
[ "skipPadding", "moves", "r", "to", "the", "next", "multiple", "of", "pad", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/linux_amd64_core.go#L228-L240
127,912
go-delve/delve
pkg/dwarf/reader/variables.go
Variables
func Variables(dwarf *dwarf.Data, off dwarf.Offset, pc RelAddr, line int, onlyVisible bool) *VariableReader { reader := dwarf.Reader() reader.Seek(off) return &VariableReader{dwarf: dwarf, reader: reader, entry: nil, depth: 0, onlyVisible: onlyVisible, pc: uint64(pc), line: line, err: nil} }
go
func Variables(dwarf *dwarf.Data, off dwarf.Offset, pc RelAddr, line int, onlyVisible bool) *VariableReader { reader := dwarf.Reader() reader.Seek(off) return &VariableReader{dwarf: dwarf, reader: reader, entry: nil, depth: 0, onlyVisible: onlyVisible, pc: uint64(pc), line: line, err: nil} }
[ "func", "Variables", "(", "dwarf", "*", "dwarf", ".", "Data", ",", "off", "dwarf", ".", "Offset", ",", "pc", "RelAddr", ",", "line", "int", ",", "onlyVisible", "bool", ")", "*", "VariableReader", "{", "reader", ":=", "dwarf", ".", "Reader", "(", ")", ...
// Variables returns a VariableReader for the function or lexical block at off. // If onlyVisible is true only variables visible at pc will be returned by // the VariableReader.
[ "Variables", "returns", "a", "VariableReader", "for", "the", "function", "or", "lexical", "block", "at", "off", ".", "If", "onlyVisible", "is", "true", "only", "variables", "visible", "at", "pc", "will", "be", "returned", "by", "the", "VariableReader", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/variables.go#L33-L37
127,913
go-delve/delve
pkg/dwarf/reader/variables.go
Next
func (vrdr *VariableReader) Next() bool { if vrdr.err != nil { return false } for { vrdr.entry, vrdr.err = vrdr.reader.Next() if vrdr.entry == nil || vrdr.err != nil { return false } switch vrdr.entry.Tag { case 0: vrdr.depth-- if vrdr.depth == 0 { return false } case dwarf.TagLexDwa...
go
func (vrdr *VariableReader) Next() bool { if vrdr.err != nil { return false } for { vrdr.entry, vrdr.err = vrdr.reader.Next() if vrdr.entry == nil || vrdr.err != nil { return false } switch vrdr.entry.Tag { case 0: vrdr.depth-- if vrdr.depth == 0 { return false } case dwarf.TagLexDwa...
[ "func", "(", "vrdr", "*", "VariableReader", ")", "Next", "(", ")", "bool", "{", "if", "vrdr", ".", "err", "!=", "nil", "{", "return", "false", "\n", "}", "\n\n", "for", "{", "vrdr", ".", "entry", ",", "vrdr", ".", "err", "=", "vrdr", ".", "reader...
// Next reads the next variable entry, returns false if there aren't any.
[ "Next", "reads", "the", "next", "variable", "entry", "returns", "false", "if", "there", "aren", "t", "any", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/variables.go#L40-L86
127,914
go-delve/delve
pkg/dwarf/line/line_parser.go
ParseAll
func ParseAll(data []byte, logfn func(string, ...interface{}), staticBase uint64) DebugLines { var ( lines = make(DebugLines, 0) buf = bytes.NewBuffer(data) ) // We have to parse multiple file name tables here. for buf.Len() > 0 { lines = append(lines, Parse("", buf, logfn, staticBase)) } return lines }
go
func ParseAll(data []byte, logfn func(string, ...interface{}), staticBase uint64) DebugLines { var ( lines = make(DebugLines, 0) buf = bytes.NewBuffer(data) ) // We have to parse multiple file name tables here. for buf.Len() > 0 { lines = append(lines, Parse("", buf, logfn, staticBase)) } return lines }
[ "func", "ParseAll", "(", "data", "[", "]", "byte", ",", "logfn", "func", "(", "string", ",", "...", "interface", "{", "}", ")", ",", "staticBase", "uint64", ")", "DebugLines", "{", "var", "(", "lines", "=", "make", "(", "DebugLines", ",", "0", ")", ...
// ParseAll parses all debug_line segments found in data
[ "ParseAll", "parses", "all", "debug_line", "segments", "found", "in", "data" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/line/line_parser.go#L52-L64
127,915
go-delve/delve
pkg/dwarf/line/line_parser.go
Parse
func Parse(compdir string, buf *bytes.Buffer, logfn func(string, ...interface{}), staticBase uint64) *DebugLineInfo { dbl := new(DebugLineInfo) dbl.Logf = logfn dbl.staticBase = staticBase dbl.Lookup = make(map[string]*FileEntry) if compdir != "" { dbl.IncludeDirs = append(dbl.IncludeDirs, compdir) } dbl.stat...
go
func Parse(compdir string, buf *bytes.Buffer, logfn func(string, ...interface{}), staticBase uint64) *DebugLineInfo { dbl := new(DebugLineInfo) dbl.Logf = logfn dbl.staticBase = staticBase dbl.Lookup = make(map[string]*FileEntry) if compdir != "" { dbl.IncludeDirs = append(dbl.IncludeDirs, compdir) } dbl.stat...
[ "func", "Parse", "(", "compdir", "string", ",", "buf", "*", "bytes", ".", "Buffer", ",", "logfn", "func", "(", "string", ",", "...", "interface", "{", "}", ")", ",", "staticBase", "uint64", ")", "*", "DebugLineInfo", "{", "dbl", ":=", "new", "(", "De...
// Parse parses a single debug_line segment from buf. Compdir is the // DW_AT_comp_dir attribute of the associated compile unit.
[ "Parse", "parses", "a", "single", "debug_line", "segment", "from", "buf", ".", "Compdir", "is", "the", "DW_AT_comp_dir", "attribute", "of", "the", "associated", "compile", "unit", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/line/line_parser.go#L68-L91
127,916
go-delve/delve
pkg/proc/stack.go
ThreadStacktrace
func ThreadStacktrace(thread Thread, depth int) ([]Stackframe, error) { g, _ := GetG(thread) if g == nil { regs, err := thread.Registers(true) if err != nil { return nil, err } it := newStackIterator(thread.BinInfo(), thread, thread.BinInfo().Arch.RegistersToDwarfRegisters(regs, thread.BinInfo().staticBase...
go
func ThreadStacktrace(thread Thread, depth int) ([]Stackframe, error) { g, _ := GetG(thread) if g == nil { regs, err := thread.Registers(true) if err != nil { return nil, err } it := newStackIterator(thread.BinInfo(), thread, thread.BinInfo().Arch.RegistersToDwarfRegisters(regs, thread.BinInfo().staticBase...
[ "func", "ThreadStacktrace", "(", "thread", "Thread", ",", "depth", "int", ")", "(", "[", "]", "Stackframe", ",", "error", ")", "{", "g", ",", "_", ":=", "GetG", "(", "thread", ")", "\n", "if", "g", "==", "nil", "{", "regs", ",", "err", ":=", "thr...
// ThreadStacktrace returns the stack trace for thread. // Note the locations in the array are return addresses not call addresses.
[ "ThreadStacktrace", "returns", "the", "stack", "trace", "for", "thread", ".", "Note", "the", "locations", "in", "the", "array", "are", "return", "addresses", "not", "call", "addresses", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L96-L107
127,917
go-delve/delve
pkg/proc/stack.go
Stacktrace
func (g *G) Stacktrace(depth int, readDefers bool) ([]Stackframe, error) { it, err := g.stackIterator() if err != nil { return nil, err } frames, err := it.stacktrace(depth) if err != nil { return nil, err } if readDefers { g.readDefers(frames) } return frames, nil }
go
func (g *G) Stacktrace(depth int, readDefers bool) ([]Stackframe, error) { it, err := g.stackIterator() if err != nil { return nil, err } frames, err := it.stacktrace(depth) if err != nil { return nil, err } if readDefers { g.readDefers(frames) } return frames, nil }
[ "func", "(", "g", "*", "G", ")", "Stacktrace", "(", "depth", "int", ",", "readDefers", "bool", ")", "(", "[", "]", "Stackframe", ",", "error", ")", "{", "it", ",", "err", ":=", "g", ".", "stackIterator", "(", ")", "\n", "if", "err", "!=", "nil", ...
// Stacktrace returns the stack trace for a goroutine. // Note the locations in the array are return addresses not call addresses.
[ "Stacktrace", "returns", "the", "stack", "trace", "for", "a", "goroutine", ".", "Note", "the", "locations", "in", "the", "array", "are", "return", "addresses", "not", "call", "addresses", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L127-L140
127,918
go-delve/delve
pkg/proc/stack.go
Next
func (it *stackIterator) Next() bool { if it.err != nil || it.atend { return false } callFrameRegs, ret, retaddr := it.advanceRegs() it.frame = it.newStackframe(ret, retaddr) if it.stkbar != nil && it.frame.Ret == it.stackBarrierPC && it.frame.addrret == it.stkbar[0].ptr { // Skip stack barrier frames it.fr...
go
func (it *stackIterator) Next() bool { if it.err != nil || it.atend { return false } callFrameRegs, ret, retaddr := it.advanceRegs() it.frame = it.newStackframe(ret, retaddr) if it.stkbar != nil && it.frame.Ret == it.stackBarrierPC && it.frame.addrret == it.stkbar[0].ptr { // Skip stack barrier frames it.fr...
[ "func", "(", "it", "*", "stackIterator", ")", "Next", "(", ")", "bool", "{", "if", "it", ".", "err", "!=", "nil", "||", "it", ".", "atend", "{", "return", "false", "\n", "}", "\n", "callFrameRegs", ",", "ret", ",", "retaddr", ":=", "it", ".", "ad...
// Next points the iterator to the next stack frame.
[ "Next", "points", "the", "iterator", "to", "the", "next", "stack", "frame", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L216-L242
127,919
go-delve/delve
pkg/proc/stack.go
switchStack
func (it *stackIterator) switchStack() bool { if it.frame.Current.Fn == nil { return false } switch it.frame.Current.Fn.Name { case "runtime.asmcgocall": if it.top || !it.systemstack { return false } // This function is called by a goroutine to execute a C function and // switches from the goroutine s...
go
func (it *stackIterator) switchStack() bool { if it.frame.Current.Fn == nil { return false } switch it.frame.Current.Fn.Name { case "runtime.asmcgocall": if it.top || !it.systemstack { return false } // This function is called by a goroutine to execute a C function and // switches from the goroutine s...
[ "func", "(", "it", "*", "stackIterator", ")", "switchStack", "(", ")", "bool", "{", "if", "it", ".", "frame", ".", "Current", ".", "Fn", "==", "nil", "{", "return", "false", "\n", "}", "\n", "switch", "it", ".", "frame", ".", "Current", ".", "Fn", ...
// switchStack will use the current frame to determine if it's time to // switch between the system stack and the goroutine stack or vice versa. // Sets it.atend when the top of the stack is reached.
[ "switchStack", "will", "use", "the", "current", "frame", "to", "determine", "if", "it", "s", "time", "to", "switch", "between", "the", "system", "stack", "and", "the", "goroutine", "stack", "or", "vice", "versa", ".", "Sets", "it", ".", "atend", "when", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L252-L340
127,920
go-delve/delve
pkg/proc/stack.go
Frame
func (it *stackIterator) Frame() Stackframe { it.frame.Bottom = it.atend return it.frame }
go
func (it *stackIterator) Frame() Stackframe { it.frame.Bottom = it.atend return it.frame }
[ "func", "(", "it", "*", "stackIterator", ")", "Frame", "(", ")", "Stackframe", "{", "it", ".", "frame", ".", "Bottom", "=", "it", ".", "atend", "\n", "return", "it", ".", "frame", "\n", "}" ]
// Frame returns the frame the iterator is pointing at.
[ "Frame", "returns", "the", "frame", "the", "iterator", "is", "pointing", "at", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L343-L346
127,921
go-delve/delve
pkg/proc/stack.go
frameBase
func (it *stackIterator) frameBase(fn *Function) int64 { it.dwarfReader.Seek(fn.offset) e, err := it.dwarfReader.Next() if err != nil { return 0 } fb, _, _, _ := it.bi.Location(e, dwarf.AttrFrameBase, it.pc, it.regs) return fb }
go
func (it *stackIterator) frameBase(fn *Function) int64 { it.dwarfReader.Seek(fn.offset) e, err := it.dwarfReader.Next() if err != nil { return 0 } fb, _, _, _ := it.bi.Location(e, dwarf.AttrFrameBase, it.pc, it.regs) return fb }
[ "func", "(", "it", "*", "stackIterator", ")", "frameBase", "(", "fn", "*", "Function", ")", "int64", "{", "it", ".", "dwarfReader", ".", "Seek", "(", "fn", ".", "offset", ")", "\n", "e", ",", "err", ":=", "it", ".", "dwarfReader", ".", "Next", "(",...
// frameBase calculates the frame base pseudo-register for DWARF for fn and // the current frame.
[ "frameBase", "calculates", "the", "frame", "base", "pseudo", "-", "register", "for", "DWARF", "for", "fn", "and", "the", "current", "frame", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L355-L363
127,922
go-delve/delve
pkg/proc/stack.go
advanceRegs
func (it *stackIterator) advanceRegs() (callFrameRegs op.DwarfRegisters, ret uint64, retaddr uint64) { fde, err := it.bi.frameEntries.FDEForPC(it.pc) var framectx *frame.FrameContext if _, nofde := err.(*frame.ErrNoFDEForPC); nofde { framectx = it.bi.Arch.FixFrameUnwindContext(nil, it.pc, it.bi) } else { framec...
go
func (it *stackIterator) advanceRegs() (callFrameRegs op.DwarfRegisters, ret uint64, retaddr uint64) { fde, err := it.bi.frameEntries.FDEForPC(it.pc) var framectx *frame.FrameContext if _, nofde := err.(*frame.ErrNoFDEForPC); nofde { framectx = it.bi.Arch.FixFrameUnwindContext(nil, it.pc, it.bi) } else { framec...
[ "func", "(", "it", "*", "stackIterator", ")", "advanceRegs", "(", ")", "(", "callFrameRegs", "op", ".", "DwarfRegisters", ",", "ret", "uint64", ",", "retaddr", "uint64", ")", "{", "fde", ",", "err", ":=", "it", ".", "bi", ".", "frameEntries", ".", "FDE...
// advanceRegs calculates it.callFrameRegs using it.regs and the frame // descriptor entry for the current stack frame. // it.regs.CallFrameCFA is updated.
[ "advanceRegs", "calculates", "it", ".", "callFrameRegs", "using", "it", ".", "regs", "and", "the", "frame", "descriptor", "entry", "for", "the", "current", "stack", "frame", ".", "it", ".", "regs", ".", "CallFrameCFA", "is", "updated", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L474-L518
127,923
go-delve/delve
pkg/proc/stack.go
readDefers
func (g *G) readDefers(frames []Stackframe) { curdefer := g.Defer() i := 0 // scan simultaneously frames and the curdefer linked list, assigning // defers to their associated frames. for { if curdefer == nil || i >= len(frames) { return } if curdefer.Unreadable != nil { // Current defer is unreadable,...
go
func (g *G) readDefers(frames []Stackframe) { curdefer := g.Defer() i := 0 // scan simultaneously frames and the curdefer linked list, assigning // defers to their associated frames. for { if curdefer == nil || i >= len(frames) { return } if curdefer.Unreadable != nil { // Current defer is unreadable,...
[ "func", "(", "g", "*", "G", ")", "readDefers", "(", "frames", "[", "]", "Stackframe", ")", "{", "curdefer", ":=", "g", ".", "Defer", "(", ")", "\n", "i", ":=", "0", "\n\n", "// scan simultaneously frames and the curdefer linked list, assigning", "// defers to th...
// readDefers decorates the frames with the function deferred at each stack frame.
[ "readDefers", "decorates", "the", "frames", "with", "the", "function", "deferred", "at", "each", "stack", "frame", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L589-L630
127,924
go-delve/delve
pkg/proc/stack.go
Next
func (d *Defer) Next() *Defer { if d.link == nil { return nil } d.link.load() if d.link.SP < d.SP { d.link.Unreadable = errSPDecreased } return d.link }
go
func (d *Defer) Next() *Defer { if d.link == nil { return nil } d.link.load() if d.link.SP < d.SP { d.link.Unreadable = errSPDecreased } return d.link }
[ "func", "(", "d", "*", "Defer", ")", "Next", "(", ")", "*", "Defer", "{", "if", "d", ".", "link", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "d", ".", "link", ".", "load", "(", ")", "\n", "if", "d", ".", "link", ".", "SP", "<", "...
// Next returns the next defer in the linked list
[ "Next", "returns", "the", "next", "defer", "in", "the", "linked", "list" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L665-L674
127,925
go-delve/delve
pkg/proc/stack.go
EvalScope
func (d *Defer) EvalScope(thread Thread) (*EvalScope, error) { scope, err := GoroutineScope(thread) if err != nil { return nil, fmt.Errorf("could not get scope: %v", err) } bi := thread.BinInfo() scope.PC = d.DeferredPC scope.File, scope.Line, scope.Fn = bi.PCToLine(d.DeferredPC) if scope.Fn == nil { retur...
go
func (d *Defer) EvalScope(thread Thread) (*EvalScope, error) { scope, err := GoroutineScope(thread) if err != nil { return nil, fmt.Errorf("could not get scope: %v", err) } bi := thread.BinInfo() scope.PC = d.DeferredPC scope.File, scope.Line, scope.Fn = bi.PCToLine(d.DeferredPC) if scope.Fn == nil { retur...
[ "func", "(", "d", "*", "Defer", ")", "EvalScope", "(", "thread", "Thread", ")", "(", "*", "EvalScope", ",", "error", ")", "{", "scope", ",", "err", ":=", "GoroutineScope", "(", "thread", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",...
// EvalScope returns an EvalScope relative to the argument frame of this deferred call. // The argument frame of a deferred call is stored in memory immediately // after the deferred header.
[ "EvalScope", "returns", "an", "EvalScope", "relative", "to", "the", "argument", "frame", "of", "this", "deferred", "call", ".", "The", "argument", "frame", "of", "a", "deferred", "call", "is", "stored", "in", "memory", "immediately", "after", "the", "deferred"...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/stack.go#L679-L711
127,926
go-delve/delve
pkg/terminal/terminal.go
New
func New(client service.Client, conf *config.Config) *Term { cmds := DebugCommands(client) if conf != nil && conf.Aliases != nil { cmds.Merge(conf.Aliases) } if conf == nil { conf = &config.Config{} } var w io.Writer dumb := strings.ToLower(os.Getenv("TERM")) == "dumb" if dumb { w = os.Stdout } else {...
go
func New(client service.Client, conf *config.Config) *Term { cmds := DebugCommands(client) if conf != nil && conf.Aliases != nil { cmds.Merge(conf.Aliases) } if conf == nil { conf = &config.Config{} } var w io.Writer dumb := strings.ToLower(os.Getenv("TERM")) == "dumb" if dumb { w = os.Stdout } else {...
[ "func", "New", "(", "client", "service", ".", "Client", ",", "conf", "*", "config", ".", "Config", ")", "*", "Term", "{", "cmds", ":=", "DebugCommands", "(", "client", ")", "\n", "if", "conf", "!=", "nil", "&&", "conf", ".", "Aliases", "!=", "nil", ...
// New returns a new Term.
[ "New", "returns", "a", "new", "Term", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/terminal.go#L66-L105
127,927
go-delve/delve
pkg/terminal/terminal.go
Run
func (t *Term) Run() (int, error) { defer t.Close() multiClient := t.client.IsMulticlient() // Send the debugger a halt command on SIGINT ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGINT) go t.sigintGuard(ch, multiClient) t.line.SetCompleter(func(line string) (c []string) { for _, cmd := range t....
go
func (t *Term) Run() (int, error) { defer t.Close() multiClient := t.client.IsMulticlient() // Send the debugger a halt command on SIGINT ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGINT) go t.sigintGuard(ch, multiClient) t.line.SetCompleter(func(line string) (c []string) { for _, cmd := range t....
[ "func", "(", "t", "*", "Term", ")", "Run", "(", ")", "(", "int", ",", "error", ")", "{", "defer", "t", ".", "Close", "(", ")", "\n\n", "multiClient", ":=", "t", ".", "client", ".", "IsMulticlient", "(", ")", "\n\n", "// Send the debugger a halt command...
// Run begins running dlv in the terminal.
[ "Run", "begins", "running", "dlv", "in", "the", "terminal", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/terminal.go#L152-L230
127,928
go-delve/delve
pkg/terminal/terminal.go
Println
func (t *Term) Println(prefix, str string) { if !t.dumb { terminalColorEscapeCode := fmt.Sprintf(terminalHighlightEscapeCode, t.conf.SourceListLineColor) prefix = fmt.Sprintf("%s%s%s", terminalColorEscapeCode, prefix, terminalResetEscapeCode) } fmt.Fprintf(t.stdout, "%s%s\n", prefix, str) }
go
func (t *Term) Println(prefix, str string) { if !t.dumb { terminalColorEscapeCode := fmt.Sprintf(terminalHighlightEscapeCode, t.conf.SourceListLineColor) prefix = fmt.Sprintf("%s%s%s", terminalColorEscapeCode, prefix, terminalResetEscapeCode) } fmt.Fprintf(t.stdout, "%s%s\n", prefix, str) }
[ "func", "(", "t", "*", "Term", ")", "Println", "(", "prefix", ",", "str", "string", ")", "{", "if", "!", "t", ".", "dumb", "{", "terminalColorEscapeCode", ":=", "fmt", ".", "Sprintf", "(", "terminalHighlightEscapeCode", ",", "t", ".", "conf", ".", "Sou...
// Println prints a line to the terminal.
[ "Println", "prints", "a", "line", "to", "the", "terminal", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/terminal.go#L233-L239
127,929
go-delve/delve
pkg/terminal/terminal.go
loadConfig
func (t *Term) loadConfig() api.LoadConfig { r := api.LoadConfig{true, 1, 64, 64, -1} if t.conf != nil && t.conf.MaxStringLen != nil { r.MaxStringLen = *t.conf.MaxStringLen } if t.conf != nil && t.conf.MaxArrayValues != nil { r.MaxArrayValues = *t.conf.MaxArrayValues } return r }
go
func (t *Term) loadConfig() api.LoadConfig { r := api.LoadConfig{true, 1, 64, 64, -1} if t.conf != nil && t.conf.MaxStringLen != nil { r.MaxStringLen = *t.conf.MaxStringLen } if t.conf != nil && t.conf.MaxArrayValues != nil { r.MaxArrayValues = *t.conf.MaxArrayValues } return r }
[ "func", "(", "t", "*", "Term", ")", "loadConfig", "(", ")", "api", ".", "LoadConfig", "{", "r", ":=", "api", ".", "LoadConfig", "{", "true", ",", "1", ",", "64", ",", "64", ",", "-", "1", "}", "\n\n", "if", "t", ".", "conf", "!=", "nil", "&&"...
// loadConfig returns an api.LoadConfig with the parameterss specified in // the configuration file.
[ "loadConfig", "returns", "an", "api", ".", "LoadConfig", "with", "the", "parameterss", "specified", "in", "the", "configuration", "file", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/terminal.go#L380-L391
127,930
go-delve/delve
service/api/prettyprint.go
SinglelineString
func (v *Variable) SinglelineString() string { var buf bytes.Buffer v.writeTo(&buf, true, false, true, "") return buf.String() }
go
func (v *Variable) SinglelineString() string { var buf bytes.Buffer v.writeTo(&buf, true, false, true, "") return buf.String() }
[ "func", "(", "v", "*", "Variable", ")", "SinglelineString", "(", ")", "string", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "v", ".", "writeTo", "(", "&", "buf", ",", "true", ",", "false", ",", "true", ",", "\"", "\"", ")", "\n", "return", "...
// SinglelineString returns a representation of v on a single line.
[ "SinglelineString", "returns", "a", "representation", "of", "v", "on", "a", "single", "line", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/prettyprint.go#L19-L23
127,931
go-delve/delve
service/api/prettyprint.go
MultilineString
func (v *Variable) MultilineString(indent string) string { var buf bytes.Buffer v.writeTo(&buf, true, true, true, indent) return buf.String() }
go
func (v *Variable) MultilineString(indent string) string { var buf bytes.Buffer v.writeTo(&buf, true, true, true, indent) return buf.String() }
[ "func", "(", "v", "*", "Variable", ")", "MultilineString", "(", "indent", "string", ")", "string", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "v", ".", "writeTo", "(", "&", "buf", ",", "true", ",", "true", ",", "true", ",", "indent", ")", "\n...
// MultilineString returns a representation of v on multiple lines.
[ "MultilineString", "returns", "a", "representation", "of", "v", "on", "multiple", "lines", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/prettyprint.go#L26-L30
127,932
go-delve/delve
pkg/dwarf/op/regs.go
Uint64Val
func (regs *DwarfRegisters) Uint64Val(idx uint64) uint64 { reg := regs.Reg(idx) if reg == nil { return 0 } return regs.Regs[idx].Uint64Val }
go
func (regs *DwarfRegisters) Uint64Val(idx uint64) uint64 { reg := regs.Reg(idx) if reg == nil { return 0 } return regs.Regs[idx].Uint64Val }
[ "func", "(", "regs", "*", "DwarfRegisters", ")", "Uint64Val", "(", "idx", "uint64", ")", "uint64", "{", "reg", ":=", "regs", ".", "Reg", "(", "idx", ")", "\n", "if", "reg", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "regs", ".", ...
// Uint64Val returns the uint64 value of register idx.
[ "Uint64Val", "returns", "the", "uint64", "value", "of", "register", "idx", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/op/regs.go#L28-L34
127,933
go-delve/delve
pkg/dwarf/op/regs.go
Bytes
func (regs *DwarfRegisters) Bytes(idx uint64) []byte { reg := regs.Reg(idx) if reg == nil { return nil } if reg.Bytes == nil { var buf bytes.Buffer binary.Write(&buf, regs.ByteOrder, reg.Uint64Val) reg.Bytes = buf.Bytes() } return reg.Bytes }
go
func (regs *DwarfRegisters) Bytes(idx uint64) []byte { reg := regs.Reg(idx) if reg == nil { return nil } if reg.Bytes == nil { var buf bytes.Buffer binary.Write(&buf, regs.ByteOrder, reg.Uint64Val) reg.Bytes = buf.Bytes() } return reg.Bytes }
[ "func", "(", "regs", "*", "DwarfRegisters", ")", "Bytes", "(", "idx", "uint64", ")", "[", "]", "byte", "{", "reg", ":=", "regs", ".", "Reg", "(", "idx", ")", "\n", "if", "reg", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "reg", "....
// Bytes returns the bytes value of register idx, nil if the register is not // defined.
[ "Bytes", "returns", "the", "bytes", "value", "of", "register", "idx", "nil", "if", "the", "register", "is", "not", "defined", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/op/regs.go#L38-L49
127,934
go-delve/delve
pkg/dwarf/op/regs.go
Reg
func (regs *DwarfRegisters) Reg(idx uint64) *DwarfRegister { if idx >= uint64(len(regs.Regs)) { return nil } return regs.Regs[idx] }
go
func (regs *DwarfRegisters) Reg(idx uint64) *DwarfRegister { if idx >= uint64(len(regs.Regs)) { return nil } return regs.Regs[idx] }
[ "func", "(", "regs", "*", "DwarfRegisters", ")", "Reg", "(", "idx", "uint64", ")", "*", "DwarfRegister", "{", "if", "idx", ">=", "uint64", "(", "len", "(", "regs", ".", "Regs", ")", ")", "{", "return", "nil", "\n", "}", "\n", "return", "regs", ".",...
// Reg returns register idx or nil if the register is not defined.
[ "Reg", "returns", "register", "idx", "or", "nil", "if", "the", "register", "is", "not", "defined", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/op/regs.go#L52-L57
127,935
go-delve/delve
pkg/dwarf/op/regs.go
AddReg
func (regs *DwarfRegisters) AddReg(idx uint64, reg *DwarfRegister) { if idx >= uint64(len(regs.Regs)) { newRegs := make([]*DwarfRegister, idx+1) copy(newRegs, regs.Regs) regs.Regs = newRegs } regs.Regs[idx] = reg }
go
func (regs *DwarfRegisters) AddReg(idx uint64, reg *DwarfRegister) { if idx >= uint64(len(regs.Regs)) { newRegs := make([]*DwarfRegister, idx+1) copy(newRegs, regs.Regs) regs.Regs = newRegs } regs.Regs[idx] = reg }
[ "func", "(", "regs", "*", "DwarfRegisters", ")", "AddReg", "(", "idx", "uint64", ",", "reg", "*", "DwarfRegister", ")", "{", "if", "idx", ">=", "uint64", "(", "len", "(", "regs", ".", "Regs", ")", ")", "{", "newRegs", ":=", "make", "(", "[", "]", ...
// AddReg adds register idx to regs.
[ "AddReg", "adds", "register", "idx", "to", "regs", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/op/regs.go#L72-L79
127,936
go-delve/delve
pkg/goversion/compat.go
Compatible
func Compatible(producer string) error { ver := parseProducer(producer) if ver.IsDevel() { return nil } if !ver.AfterOrEqual(GoVersion{1, minSupportedVersionOfGoMinor, -1, 0, 0, ""}) { return goTooOldErr } if ver.AfterOrEqual(GoVersion{1, maxSupportedVersionOfGoMinor + 1, -1, 0, 0, ""}) { return dlvTooOldEr...
go
func Compatible(producer string) error { ver := parseProducer(producer) if ver.IsDevel() { return nil } if !ver.AfterOrEqual(GoVersion{1, minSupportedVersionOfGoMinor, -1, 0, 0, ""}) { return goTooOldErr } if ver.AfterOrEqual(GoVersion{1, maxSupportedVersionOfGoMinor + 1, -1, 0, 0, ""}) { return dlvTooOldEr...
[ "func", "Compatible", "(", "producer", "string", ")", "error", "{", "ver", ":=", "parseProducer", "(", "producer", ")", "\n", "if", "ver", ".", "IsDevel", "(", ")", "{", "return", "nil", "\n", "}", "\n", "if", "!", "ver", ".", "AfterOrEqual", "(", "G...
// Compatible checks that the version specified in the producer string is compatible with // this version of delve.
[ "Compatible", "checks", "that", "the", "version", "specified", "in", "the", "producer", "string", "is", "compatible", "with", "this", "version", "of", "delve", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/goversion/compat.go#L16-L28
127,937
go-delve/delve
cmd/dlv/cmds/commands.go
remove
func remove(path string) { err := os.Remove(path) if err != nil { fmt.Fprintf(os.Stderr, "could not remove %v: %v\n", path, err) } }
go
func remove(path string) { err := os.Remove(path) if err != nil { fmt.Fprintf(os.Stderr, "could not remove %v: %v\n", path, err) } }
[ "func", "remove", "(", "path", "string", ")", "{", "err", ":=", "os", ".", "Remove", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintf", "(", "os", ".", "Stderr", ",", "\"", "\\n", "\"", ",", "path", ",", "err", ")", ...
// Remove the file at path and issue a warning to stderr if this fails.
[ "Remove", "the", "file", "at", "path", "and", "issue", "a", "warning", "to", "stderr", "if", "this", "fails", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/cmd/dlv/cmds/commands.go#L304-L309
127,938
go-delve/delve
cmd/dlv/cmds/commands.go
SafeRemoveAll
func SafeRemoveAll(dir string) { dh, err := os.Open(dir) if err != nil { return } defer dh.Close() fis, err := dh.Readdir(-1) if err != nil { return } for _, fi := range fis { if fi.IsDir() { return } } for _, fi := range fis { if err := os.Remove(filepath.Join(dir, fi.Name())); err != nil { r...
go
func SafeRemoveAll(dir string) { dh, err := os.Open(dir) if err != nil { return } defer dh.Close() fis, err := dh.Readdir(-1) if err != nil { return } for _, fi := range fis { if fi.IsDir() { return } } for _, fi := range fis { if err := os.Remove(filepath.Join(dir, fi.Name())); err != nil { r...
[ "func", "SafeRemoveAll", "(", "dir", "string", ")", "{", "dh", ",", "err", ":=", "os", ".", "Open", "(", "dir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "defer", "dh", ".", "Close", "(", ")", "\n", "fis", ",", "err",...
// SafeRemoveAll removes dir and its contents but only as long as dir does // not contain directories.
[ "SafeRemoveAll", "removes", "dir", "and", "its", "contents", "but", "only", "as", "long", "as", "dir", "does", "not", "contain", "directories", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/cmd/dlv/cmds/commands.go#L700-L721
127,939
go-delve/delve
pkg/terminal/terminal_windows.go
getColorableWriter
func getColorableWriter() io.Writer { if strings.ToLower(os.Getenv("ConEmuANSI")) == "on" { // The ConEmu terminal is installed. Use it. return os.Stdout } const ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 h, err := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE) if err != nil { return os.Stdout } var m ...
go
func getColorableWriter() io.Writer { if strings.ToLower(os.Getenv("ConEmuANSI")) == "on" { // The ConEmu terminal is installed. Use it. return os.Stdout } const ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 h, err := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE) if err != nil { return os.Stdout } var m ...
[ "func", "getColorableWriter", "(", ")", "io", ".", "Writer", "{", "if", "strings", ".", "ToLower", "(", "os", ".", "Getenv", "(", "\"", "\"", ")", ")", "==", "\"", "\"", "{", "// The ConEmu terminal is installed. Use it.", "return", "os", ".", "Stdout", "\...
// getColorableWriter will return a writer that is capable // of interpreting ANSI escape codes for terminal colors.
[ "getColorableWriter", "will", "return", "a", "writer", "that", "is", "capable", "of", "interpreting", "ANSI", "escape", "codes", "for", "terminal", "colors", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/terminal/terminal_windows.go#L14-L35
127,940
go-delve/delve
pkg/dwarf/dwarfbuilder/loc.go
LocationBlock
func LocationBlock(args ...interface{}) []byte { var buf bytes.Buffer for _, arg := range args { switch x := arg.(type) { case op.Opcode: buf.WriteByte(byte(x)) case int: util.EncodeSLEB128(&buf, int64(x)) case uint: util.EncodeULEB128(&buf, uint64(x)) default: panic("unsupported value type") ...
go
func LocationBlock(args ...interface{}) []byte { var buf bytes.Buffer for _, arg := range args { switch x := arg.(type) { case op.Opcode: buf.WriteByte(byte(x)) case int: util.EncodeSLEB128(&buf, int64(x)) case uint: util.EncodeULEB128(&buf, uint64(x)) default: panic("unsupported value type") ...
[ "func", "LocationBlock", "(", "args", "...", "interface", "{", "}", ")", "[", "]", "byte", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "for", "_", ",", "arg", ":=", "range", "args", "{", "switch", "x", ":=", "arg", ".", "(", "type", ")", "{"...
// LocationBlock returns a DWARF expression corresponding to the list of // arguments.
[ "LocationBlock", "returns", "a", "DWARF", "expression", "corresponding", "to", "the", "list", "of", "arguments", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/loc.go#L19-L34
127,941
go-delve/delve
service/debugger/debugger.go
New
func New(config *Config, processArgs []string) (*Debugger, error) { logger := logflags.DebuggerLogger() d := &Debugger{ config: config, processArgs: processArgs, log: logger, } // Create the process by either attaching or launching. switch { case d.config.AttachPid > 0: d.log.Infof("attachin...
go
func New(config *Config, processArgs []string) (*Debugger, error) { logger := logflags.DebuggerLogger() d := &Debugger{ config: config, processArgs: processArgs, log: logger, } // Create the process by either attaching or launching. switch { case d.config.AttachPid > 0: d.log.Infof("attachin...
[ "func", "New", "(", "config", "*", "Config", ",", "processArgs", "[", "]", "string", ")", "(", "*", "Debugger", ",", "error", ")", "{", "logger", ":=", "logflags", ".", "DebuggerLogger", "(", ")", "\n", "d", ":=", "&", "Debugger", "{", "config", ":",...
// New creates a new Debugger. ProcessArgs specify the commandline arguments for the // new process.
[ "New", "creates", "a", "new", "Debugger", ".", "ProcessArgs", "specify", "the", "commandline", "arguments", "for", "the", "new", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L80-L141
127,942
go-delve/delve
service/debugger/debugger.go
Launch
func (d *Debugger) Launch(processArgs []string, wd string) (proc.Process, error) { switch d.config.Backend { case "native": return native.Launch(processArgs, wd, d.config.Foreground, d.config.DebugInfoDirectories) case "lldb": return betterGdbserialLaunchError(gdbserial.LLDBLaunch(processArgs, wd, d.config.Foreg...
go
func (d *Debugger) Launch(processArgs []string, wd string) (proc.Process, error) { switch d.config.Backend { case "native": return native.Launch(processArgs, wd, d.config.Foreground, d.config.DebugInfoDirectories) case "lldb": return betterGdbserialLaunchError(gdbserial.LLDBLaunch(processArgs, wd, d.config.Foreg...
[ "func", "(", "d", "*", "Debugger", ")", "Launch", "(", "processArgs", "[", "]", "string", ",", "wd", "string", ")", "(", "proc", ".", "Process", ",", "error", ")", "{", "switch", "d", ".", "config", ".", "Backend", "{", "case", "\"", "\"", ":", "...
// Launch will start a process with the given args and working directory.
[ "Launch", "will", "start", "a", "process", "with", "the", "given", "args", "and", "working", "directory", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L155-L172
127,943
go-delve/delve
service/debugger/debugger.go
Attach
func (d *Debugger) Attach(pid int, path string) (proc.Process, error) { switch d.config.Backend { case "native": return native.Attach(pid, d.config.DebugInfoDirectories) case "lldb": return betterGdbserialLaunchError(gdbserial.LLDBAttach(pid, path, d.config.DebugInfoDirectories)) case "default": if runtime.GO...
go
func (d *Debugger) Attach(pid int, path string) (proc.Process, error) { switch d.config.Backend { case "native": return native.Attach(pid, d.config.DebugInfoDirectories) case "lldb": return betterGdbserialLaunchError(gdbserial.LLDBAttach(pid, path, d.config.DebugInfoDirectories)) case "default": if runtime.GO...
[ "func", "(", "d", "*", "Debugger", ")", "Attach", "(", "pid", "int", ",", "path", "string", ")", "(", "proc", ".", "Process", ",", "error", ")", "{", "switch", "d", ".", "config", ".", "Backend", "{", "case", "\"", "\"", ":", "return", "native", ...
// Attach will attach to the process specified by 'pid'.
[ "Attach", "will", "attach", "to", "the", "process", "specified", "by", "pid", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L180-L194
127,944
go-delve/delve
service/debugger/debugger.go
FunctionReturnLocations
func (d *Debugger) FunctionReturnLocations(fnName string) ([]uint64, error) { return proc.FunctionReturnLocations(d.target, fnName) }
go
func (d *Debugger) FunctionReturnLocations(fnName string) ([]uint64, error) { return proc.FunctionReturnLocations(d.target, fnName) }
[ "func", "(", "d", "*", "Debugger", ")", "FunctionReturnLocations", "(", "fnName", "string", ")", "(", "[", "]", "uint64", ",", "error", ")", "{", "return", "proc", ".", "FunctionReturnLocations", "(", "d", ".", "target", ",", "fnName", ")", "\n", "}" ]
// FunctionReturnLocations returns all return locations // for the given function. See the documentation for the // function of the same name within the `proc` package for // more information.
[ "FunctionReturnLocations", "returns", "all", "return", "locations", "for", "the", "given", "function", ".", "See", "the", "documentation", "for", "the", "function", "of", "the", "same", "name", "within", "the", "proc", "package", "for", "more", "information", "....
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L225-L227
127,945
go-delve/delve
service/debugger/debugger.go
Detach
func (d *Debugger) Detach(kill bool) error { d.processMutex.Lock() defer d.processMutex.Unlock() return d.detach(kill) }
go
func (d *Debugger) Detach(kill bool) error { d.processMutex.Lock() defer d.processMutex.Unlock() return d.detach(kill) }
[ "func", "(", "d", "*", "Debugger", ")", "Detach", "(", "kill", "bool", ")", "error", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n\n", "return", "d", ".", "detach", "(", ...
// Detach detaches from the target process. // If `kill` is true we will kill the process after // detaching.
[ "Detach", "detaches", "from", "the", "target", "process", ".", "If", "kill", "is", "true", "we", "will", "kill", "the", "process", "after", "detaching", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L232-L237
127,946
go-delve/delve
service/debugger/debugger.go
Restart
func (d *Debugger) Restart(pos string, resetArgs bool, newArgs []string) ([]api.DiscardedBreakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if recorded, _ := d.target.Recorded(); recorded { return nil, d.target.Restart(pos) } if pos != "" { return nil, proc.ErrNotRecorded } if valid,...
go
func (d *Debugger) Restart(pos string, resetArgs bool, newArgs []string) ([]api.DiscardedBreakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if recorded, _ := d.target.Recorded(); recorded { return nil, d.target.Restart(pos) } if pos != "" { return nil, proc.ErrNotRecorded } if valid,...
[ "func", "(", "d", "*", "Debugger", ")", "Restart", "(", "pos", "string", ",", "resetArgs", "bool", ",", "newArgs", "[", "]", "string", ")", "(", "[", "]", "api", ".", "DiscardedBreakpoint", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock...
// Restart will restart the target process, first killing // and then exec'ing it again. // If the target process is a recording it will restart it from the given // position. If pos starts with 'c' it's a checkpoint ID, otherwise it's an // event number. If resetArgs is true, newArgs will replace the process args.
[ "Restart", "will", "restart", "the", "target", "process", "first", "killing", "and", "then", "exec", "ing", "it", "again", ".", "If", "the", "target", "process", "is", "a", "recording", "it", "will", "restart", "it", "from", "the", "given", "position", "."...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L251-L302
127,947
go-delve/delve
service/debugger/debugger.go
State
func (d *Debugger) State(nowait bool) (*api.DebuggerState, error) { if d.isRunning() && nowait { return &api.DebuggerState{Running: true}, nil } d.processMutex.Lock() defer d.processMutex.Unlock() return d.state(nil) }
go
func (d *Debugger) State(nowait bool) (*api.DebuggerState, error) { if d.isRunning() && nowait { return &api.DebuggerState{Running: true}, nil } d.processMutex.Lock() defer d.processMutex.Unlock() return d.state(nil) }
[ "func", "(", "d", "*", "Debugger", ")", "State", "(", "nowait", "bool", ")", "(", "*", "api", ".", "DebuggerState", ",", "error", ")", "{", "if", "d", ".", "isRunning", "(", ")", "&&", "nowait", "{", "return", "&", "api", ".", "DebuggerState", "{",...
// State returns the current state of the debugger.
[ "State", "returns", "the", "current", "state", "of", "the", "debugger", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L305-L313
127,948
go-delve/delve
service/debugger/debugger.go
CreateBreakpoint
func (d *Debugger) CreateBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() var ( createdBp *api.Breakpoint addr uint64 err error ) if requestedBp.Name != "" { if err = api.ValidBreakpointName(requestedBp.Name); err != nil { ...
go
func (d *Debugger) CreateBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() var ( createdBp *api.Breakpoint addr uint64 err error ) if requestedBp.Name != "" { if err = api.ValidBreakpointName(requestedBp.Name); err != nil { ...
[ "func", "(", "d", "*", "Debugger", ")", "CreateBreakpoint", "(", "requestedBp", "*", "api", ".", "Breakpoint", ")", "(", "*", "api", ".", "Breakpoint", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", ...
// CreateBreakpoint creates a breakpoint.
[ "CreateBreakpoint", "creates", "a", "breakpoint", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L362-L424
127,949
go-delve/delve
service/debugger/debugger.go
AmendBreakpoint
func (d *Debugger) AmendBreakpoint(amend *api.Breakpoint) error { d.processMutex.Lock() defer d.processMutex.Unlock() original := d.findBreakpoint(amend.ID) if original == nil { return fmt.Errorf("no breakpoint with ID %d", amend.ID) } if err := api.ValidBreakpointName(amend.Name); err != nil { return err }...
go
func (d *Debugger) AmendBreakpoint(amend *api.Breakpoint) error { d.processMutex.Lock() defer d.processMutex.Unlock() original := d.findBreakpoint(amend.ID) if original == nil { return fmt.Errorf("no breakpoint with ID %d", amend.ID) } if err := api.ValidBreakpointName(amend.Name); err != nil { return err }...
[ "func", "(", "d", "*", "Debugger", ")", "AmendBreakpoint", "(", "amend", "*", "api", ".", "Breakpoint", ")", "error", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n\n", "ori...
// AmendBreakpoint will update the breakpoint with the matching ID.
[ "AmendBreakpoint", "will", "update", "the", "breakpoint", "with", "the", "matching", "ID", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L427-L439
127,950
go-delve/delve
service/debugger/debugger.go
ClearBreakpoint
func (d *Debugger) ClearBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() var clearedBp *api.Breakpoint bp, err := d.target.ClearBreakpoint(requestedBp.Addr) if err != nil { return nil, fmt.Errorf("Can't clear breakpoint @%x: %s", requestedBp....
go
func (d *Debugger) ClearBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() var clearedBp *api.Breakpoint bp, err := d.target.ClearBreakpoint(requestedBp.Addr) if err != nil { return nil, fmt.Errorf("Can't clear breakpoint @%x: %s", requestedBp....
[ "func", "(", "d", "*", "Debugger", ")", "ClearBreakpoint", "(", "requestedBp", "*", "api", ".", "Breakpoint", ")", "(", "*", "api", ".", "Breakpoint", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", ...
// ClearBreakpoint clears a breakpoint.
[ "ClearBreakpoint", "clears", "a", "breakpoint", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L464-L476
127,951
go-delve/delve
service/debugger/debugger.go
Breakpoints
func (d *Debugger) Breakpoints() []*api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() return d.breakpoints() }
go
func (d *Debugger) Breakpoints() []*api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() return d.breakpoints() }
[ "func", "(", "d", "*", "Debugger", ")", "Breakpoints", "(", ")", "[", "]", "*", "api", ".", "Breakpoint", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "return", "d", ...
// Breakpoints returns the list of current breakpoints.
[ "Breakpoints", "returns", "the", "list", "of", "current", "breakpoints", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L479-L483
127,952
go-delve/delve
service/debugger/debugger.go
FindBreakpoint
func (d *Debugger) FindBreakpoint(id int) *api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() bp := d.findBreakpoint(id) if bp == nil { return nil } return api.ConvertBreakpoint(bp) }
go
func (d *Debugger) FindBreakpoint(id int) *api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() bp := d.findBreakpoint(id) if bp == nil { return nil } return api.ConvertBreakpoint(bp) }
[ "func", "(", "d", "*", "Debugger", ")", "FindBreakpoint", "(", "id", "int", ")", "*", "api", ".", "Breakpoint", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n\n", "bp", ":...
// FindBreakpoint returns the breakpoint specified by 'id'.
[ "FindBreakpoint", "returns", "the", "breakpoint", "specified", "by", "id", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L496-L505
127,953
go-delve/delve
service/debugger/debugger.go
FindBreakpointByName
func (d *Debugger) FindBreakpointByName(name string) *api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() return d.findBreakpointByName(name) }
go
func (d *Debugger) FindBreakpointByName(name string) *api.Breakpoint { d.processMutex.Lock() defer d.processMutex.Unlock() return d.findBreakpointByName(name) }
[ "func", "(", "d", "*", "Debugger", ")", "FindBreakpointByName", "(", "name", "string", ")", "*", "api", ".", "Breakpoint", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "...
// FindBreakpointByName returns the breakpoint specified by 'name'
[ "FindBreakpointByName", "returns", "the", "breakpoint", "specified", "by", "name" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L517-L521
127,954
go-delve/delve
service/debugger/debugger.go
Threads
func (d *Debugger) Threads() ([]*api.Thread, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } threads := []*api.Thread{} for _, th := range d.target.ThreadList() { threads = append(threads, api.ConvertThread(th)) } return threads, n...
go
func (d *Debugger) Threads() ([]*api.Thread, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } threads := []*api.Thread{} for _, th := range d.target.ThreadList() { threads = append(threads, api.ConvertThread(th)) } return threads, n...
[ "func", "(", "d", "*", "Debugger", ")", "Threads", "(", ")", "(", "[", "]", "*", "api", ".", "Thread", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\...
// Threads returns the threads of the target process.
[ "Threads", "returns", "the", "threads", "of", "the", "target", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L533-L546
127,955
go-delve/delve
service/debugger/debugger.go
FindThread
func (d *Debugger) FindThread(id int) (*api.Thread, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } for _, th := range d.target.ThreadList() { if th.ThreadID() == id { return api.ConvertThread(th), nil } } return nil, nil }
go
func (d *Debugger) FindThread(id int) (*api.Thread, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } for _, th := range d.target.ThreadList() { if th.ThreadID() == id { return api.ConvertThread(th), nil } } return nil, nil }
[ "func", "(", "d", "*", "Debugger", ")", "FindThread", "(", "id", "int", ")", "(", "*", "api", ".", "Thread", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")"...
// FindThread returns the thread for the given 'id'.
[ "FindThread", "returns", "the", "thread", "for", "the", "given", "id", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L549-L563
127,956
go-delve/delve
service/debugger/debugger.go
Sources
func (d *Debugger) Sources(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } files := []string{} for _, f := range d.target.BinInfo().Sources { if r...
go
func (d *Debugger) Sources(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } files := []string{} for _, f := range d.target.BinInfo().Sources { if r...
[ "func", "(", "d", "*", "Debugger", ")", "Sources", "(", "filter", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "...
// Sources returns a list of the source files for target binary.
[ "Sources", "returns", "a", "list", "of", "the", "source", "files", "for", "target", "binary", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L741-L757
127,957
go-delve/delve
service/debugger/debugger.go
Functions
func (d *Debugger) Functions(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() return regexFilterFuncs(filter, d.target.BinInfo().Functions) }
go
func (d *Debugger) Functions(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() return regexFilterFuncs(filter, d.target.BinInfo().Functions) }
[ "func", "(", "d", "*", "Debugger", ")", "Functions", "(", "filter", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", ...
// Functions returns a list of functions in the target process.
[ "Functions", "returns", "a", "list", "of", "functions", "in", "the", "target", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L760-L765
127,958
go-delve/delve
service/debugger/debugger.go
Types
func (d *Debugger) Types(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } types, err := d.target.BinInfo().Types() if err != nil { return nil, err ...
go
func (d *Debugger) Types(filter string) ([]string, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } types, err := d.target.BinInfo().Types() if err != nil { return nil, err ...
[ "func", "(", "d", "*", "Debugger", ")", "Types", "(", "filter", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n...
// Types returns all type information in the binary.
[ "Types", "returns", "all", "type", "information", "in", "the", "binary", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L768-L790
127,959
go-delve/delve
service/debugger/debugger.go
PackageVariables
func (d *Debugger) PackageVariables(threadID int, filter string, cfg proc.LoadConfig) ([]api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } vars := []api.Variable{}...
go
func (d *Debugger) PackageVariables(threadID int, filter string, cfg proc.LoadConfig) ([]api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() regex, err := regexp.Compile(filter) if err != nil { return nil, fmt.Errorf("invalid filter argument: %s", err.Error()) } vars := []api.Variable{}...
[ "func", "(", "d", "*", "Debugger", ")", "PackageVariables", "(", "threadID", "int", ",", "filter", "string", ",", "cfg", "proc", ".", "LoadConfig", ")", "(", "[", "]", "api", ".", "Variable", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lo...
// PackageVariables returns a list of package variables for the thread, // optionally regexp filtered using regexp described in 'filter'.
[ "PackageVariables", "returns", "a", "list", "of", "package", "variables", "for", "the", "thread", "optionally", "regexp", "filtered", "using", "regexp", "described", "in", "filter", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L809-L837
127,960
go-delve/delve
service/debugger/debugger.go
Registers
func (d *Debugger) Registers(threadID int, floatingPoint bool) (api.Registers, error) { d.processMutex.Lock() defer d.processMutex.Unlock() thread, found := d.target.FindThread(threadID) if !found { return nil, fmt.Errorf("couldn't find thread %d", threadID) } regs, err := thread.Registers(floatingPoint) if e...
go
func (d *Debugger) Registers(threadID int, floatingPoint bool) (api.Registers, error) { d.processMutex.Lock() defer d.processMutex.Unlock() thread, found := d.target.FindThread(threadID) if !found { return nil, fmt.Errorf("couldn't find thread %d", threadID) } regs, err := thread.Registers(floatingPoint) if e...
[ "func", "(", "d", "*", "Debugger", ")", "Registers", "(", "threadID", "int", ",", "floatingPoint", "bool", ")", "(", "api", ".", "Registers", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMu...
// Registers returns string representation of the CPU registers.
[ "Registers", "returns", "string", "representation", "of", "the", "CPU", "registers", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L840-L853
127,961
go-delve/delve
service/debugger/debugger.go
LocalVariables
func (d *Debugger) LocalVariables(scope api.EvalScope, cfg proc.LoadConfig) ([]api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return nil, err } pv, err := s.LocalVariables(c...
go
func (d *Debugger) LocalVariables(scope api.EvalScope, cfg proc.LoadConfig) ([]api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return nil, err } pv, err := s.LocalVariables(c...
[ "func", "(", "d", "*", "Debugger", ")", "LocalVariables", "(", "scope", "api", ".", "EvalScope", ",", "cfg", "proc", ".", "LoadConfig", ")", "(", "[", "]", "api", ".", "Variable", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ...
// LocalVariables returns a list of the local variables.
[ "LocalVariables", "returns", "a", "list", "of", "the", "local", "variables", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L867-L880
127,962
go-delve/delve
service/debugger/debugger.go
EvalVariableInScope
func (d *Debugger) EvalVariableInScope(scope api.EvalScope, symbol string, cfg proc.LoadConfig) (*api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return nil, err } v, err := ...
go
func (d *Debugger) EvalVariableInScope(scope api.EvalScope, symbol string, cfg proc.LoadConfig) (*api.Variable, error) { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return nil, err } v, err := ...
[ "func", "(", "d", "*", "Debugger", ")", "EvalVariableInScope", "(", "scope", "api", ".", "EvalScope", ",", "symbol", "string", ",", "cfg", "proc", ".", "LoadConfig", ")", "(", "*", "api", ".", "Variable", ",", "error", ")", "{", "d", ".", "processMutex...
// EvalVariableInScope will attempt to evaluate the variable represented by 'symbol' // in the scope provided.
[ "EvalVariableInScope", "will", "attempt", "to", "evaluate", "the", "variable", "represented", "by", "symbol", "in", "the", "scope", "provided", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L900-L913
127,963
go-delve/delve
service/debugger/debugger.go
SetVariableInScope
func (d *Debugger) SetVariableInScope(scope api.EvalScope, symbol, value string) error { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return err } return s.SetVariable(symbol, value) }
go
func (d *Debugger) SetVariableInScope(scope api.EvalScope, symbol, value string) error { d.processMutex.Lock() defer d.processMutex.Unlock() s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall) if err != nil { return err } return s.SetVariable(symbol, value) }
[ "func", "(", "d", "*", "Debugger", ")", "SetVariableInScope", "(", "scope", "api", ".", "EvalScope", ",", "symbol", ",", "value", "string", ")", "error", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", "."...
// SetVariableInScope will set the value of the variable represented by // 'symbol' to the value given, in the given scope.
[ "SetVariableInScope", "will", "set", "the", "value", "of", "the", "variable", "represented", "by", "symbol", "to", "the", "value", "given", "in", "the", "given", "scope", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L917-L926
127,964
go-delve/delve
service/debugger/debugger.go
Goroutines
func (d *Debugger) Goroutines(start, count int) ([]*api.Goroutine, int, error) { d.processMutex.Lock() defer d.processMutex.Unlock() goroutines := []*api.Goroutine{} gs, nextg, err := proc.GoroutinesInfo(d.target, start, count) if err != nil { return nil, 0, err } for _, g := range gs { goroutines = append(...
go
func (d *Debugger) Goroutines(start, count int) ([]*api.Goroutine, int, error) { d.processMutex.Lock() defer d.processMutex.Unlock() goroutines := []*api.Goroutine{} gs, nextg, err := proc.GoroutinesInfo(d.target, start, count) if err != nil { return nil, 0, err } for _, g := range gs { goroutines = append(...
[ "func", "(", "d", "*", "Debugger", ")", "Goroutines", "(", "start", ",", "count", "int", ")", "(", "[", "]", "*", "api", ".", "Goroutine", ",", "int", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ...
// Goroutines will return a list of goroutines in the target process.
[ "Goroutines", "will", "return", "a", "list", "of", "goroutines", "in", "the", "target", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L929-L942
127,965
go-delve/delve
service/debugger/debugger.go
FindLocation
func (d *Debugger) FindLocation(scope api.EvalScope, locStr string) ([]api.Location, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } loc, err := parseLocationSpec(locStr) if err != nil { return nil, err } s, _ := proc.ConvertEvalS...
go
func (d *Debugger) FindLocation(scope api.EvalScope, locStr string) ([]api.Location, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } loc, err := parseLocationSpec(locStr) if err != nil { return nil, err } s, _ := proc.ConvertEvalS...
[ "func", "(", "d", "*", "Debugger", ")", "FindLocation", "(", "scope", "api", ".", "EvalScope", ",", "locStr", "string", ")", "(", "[", "]", "api", ".", "Location", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defe...
// FindLocation will find the location specified by 'locStr'.
[ "FindLocation", "will", "find", "the", "location", "specified", "by", "locStr", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1084-L1107
127,966
go-delve/delve
service/debugger/debugger.go
Disassemble
func (d *Debugger) Disassemble(scope api.EvalScope, startPC, endPC uint64, flavour api.AssemblyFlavour) (api.AsmInstructions, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } if endPC == 0 { _, _, fn := d.target.BinInfo().PCToLine(star...
go
func (d *Debugger) Disassemble(scope api.EvalScope, startPC, endPC uint64, flavour api.AssemblyFlavour) (api.AsmInstructions, error) { d.processMutex.Lock() defer d.processMutex.Unlock() if _, err := d.target.Valid(); err != nil { return nil, err } if endPC == 0 { _, _, fn := d.target.BinInfo().PCToLine(star...
[ "func", "(", "d", "*", "Debugger", ")", "Disassemble", "(", "scope", "api", ".", "EvalScope", ",", "startPC", ",", "endPC", "uint64", ",", "flavour", "api", ".", "AssemblyFlavour", ")", "(", "api", ".", "AsmInstructions", ",", "error", ")", "{", "d", "...
// Disassemble code between startPC and endPC // if endPC == 0 it will find the function containing startPC and disassemble the whole function
[ "Disassemble", "code", "between", "startPC", "and", "endPC", "if", "endPC", "==", "0", "it", "will", "find", "the", "function", "containing", "startPC", "and", "disassemble", "the", "whole", "function" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1111-L1144
127,967
go-delve/delve
service/debugger/debugger.go
Recorded
func (d *Debugger) Recorded() (recorded bool, tracedir string) { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.Recorded() }
go
func (d *Debugger) Recorded() (recorded bool, tracedir string) { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.Recorded() }
[ "func", "(", "d", "*", "Debugger", ")", "Recorded", "(", ")", "(", "recorded", "bool", ",", "tracedir", "string", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "re...
// Recorded returns true if the target is a recording.
[ "Recorded", "returns", "true", "if", "the", "target", "is", "a", "recording", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1147-L1151
127,968
go-delve/delve
service/debugger/debugger.go
Checkpoint
func (d *Debugger) Checkpoint(where string) (int, error) { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.Checkpoint(where) }
go
func (d *Debugger) Checkpoint(where string) (int, error) { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.Checkpoint(where) }
[ "func", "(", "d", "*", "Debugger", ")", "Checkpoint", "(", "where", "string", ")", "(", "int", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "return"...
// Checkpoint will set a checkpoint specified by the locspec.
[ "Checkpoint", "will", "set", "a", "checkpoint", "specified", "by", "the", "locspec", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1154-L1158
127,969
go-delve/delve
service/debugger/debugger.go
Checkpoints
func (d *Debugger) Checkpoints() ([]api.Checkpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() cps, err := d.target.Checkpoints() if err != nil { return nil, err } r := make([]api.Checkpoint, len(cps)) for i := range cps { r[i] = api.ConvertCheckpoint(cps[i]) } return r, nil }
go
func (d *Debugger) Checkpoints() ([]api.Checkpoint, error) { d.processMutex.Lock() defer d.processMutex.Unlock() cps, err := d.target.Checkpoints() if err != nil { return nil, err } r := make([]api.Checkpoint, len(cps)) for i := range cps { r[i] = api.ConvertCheckpoint(cps[i]) } return r, nil }
[ "func", "(", "d", "*", "Debugger", ")", "Checkpoints", "(", ")", "(", "[", "]", "api", ".", "Checkpoint", ",", "error", ")", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "...
// Checkpoints will return a list of checkpoints.
[ "Checkpoints", "will", "return", "a", "list", "of", "checkpoints", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1161-L1173
127,970
go-delve/delve
service/debugger/debugger.go
ClearCheckpoint
func (d *Debugger) ClearCheckpoint(id int) error { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.ClearCheckpoint(id) }
go
func (d *Debugger) ClearCheckpoint(id int) error { d.processMutex.Lock() defer d.processMutex.Unlock() return d.target.ClearCheckpoint(id) }
[ "func", "(", "d", "*", "Debugger", ")", "ClearCheckpoint", "(", "id", "int", ")", "error", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "return", "d", ".", "target", "...
// ClearCheckpoint will clear the checkpoint of the given ID.
[ "ClearCheckpoint", "will", "clear", "the", "checkpoint", "of", "the", "given", "ID", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1176-L1180
127,971
go-delve/delve
service/debugger/debugger.go
ListDynamicLibraries
func (d *Debugger) ListDynamicLibraries() []api.Image { d.processMutex.Lock() defer d.processMutex.Unlock() bi := d.target.BinInfo() r := make([]api.Image, len(bi.Images)) for i := range bi.Images { r[i] = api.ConvertImage(bi.Images[i]) } return r }
go
func (d *Debugger) ListDynamicLibraries() []api.Image { d.processMutex.Lock() defer d.processMutex.Unlock() bi := d.target.BinInfo() r := make([]api.Image, len(bi.Images)) for i := range bi.Images { r[i] = api.ConvertImage(bi.Images[i]) } return r }
[ "func", "(", "d", "*", "Debugger", ")", "ListDynamicLibraries", "(", ")", "[", "]", "api", ".", "Image", "{", "d", ".", "processMutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "processMutex", ".", "Unlock", "(", ")", "\n", "bi", ":=", "d", ...
// ListDynamicLibraries returns a list of loaded dynamic libraries.
[ "ListDynamicLibraries", "returns", "a", "list", "of", "loaded", "dynamic", "libraries", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/debugger/debugger.go#L1183-L1192
127,972
go-delve/delve
pkg/goversion/go_version.go
Parse
func Parse(ver string) (GoVersion, bool) { var r GoVersion var err1, err2, err3 error if strings.HasPrefix(ver, "devel") { return GoVersion{-1, 0, 0, 0, 0, ""}, true } if strings.HasPrefix(ver, "go") { ver := strings.Split(ver, " ")[0] v := strings.SplitN(ver[2:], ".", 4) switch len(v) { case 2: r.M...
go
func Parse(ver string) (GoVersion, bool) { var r GoVersion var err1, err2, err3 error if strings.HasPrefix(ver, "devel") { return GoVersion{-1, 0, 0, 0, 0, ""}, true } if strings.HasPrefix(ver, "go") { ver := strings.Split(ver, " ")[0] v := strings.SplitN(ver[2:], ".", 4) switch len(v) { case 2: r.M...
[ "func", "Parse", "(", "ver", "string", ")", "(", "GoVersion", ",", "bool", ")", "{", "var", "r", "GoVersion", "\n", "var", "err1", ",", "err2", ",", "err3", "error", "\n\n", "if", "strings", ".", "HasPrefix", "(", "ver", ",", "\"", "\"", ")", "{", ...
// Parse parses a go version string
[ "Parse", "parses", "a", "go", "version", "string" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/goversion/go_version.go#L26-L96
127,973
go-delve/delve
pkg/goversion/go_version.go
AfterOrEqual
func (v *GoVersion) AfterOrEqual(b GoVersion) bool { if v.Major < b.Major { return false } else if v.Major > b.Major { return true } if v.Minor < b.Minor { return false } else if v.Minor > b.Minor { return true } if v.Rev < b.Rev { return false } else if v.Rev > b.Rev { return true } if v.Beta ...
go
func (v *GoVersion) AfterOrEqual(b GoVersion) bool { if v.Major < b.Major { return false } else if v.Major > b.Major { return true } if v.Minor < b.Minor { return false } else if v.Minor > b.Minor { return true } if v.Rev < b.Rev { return false } else if v.Rev > b.Rev { return true } if v.Beta ...
[ "func", "(", "v", "*", "GoVersion", ")", "AfterOrEqual", "(", "b", "GoVersion", ")", "bool", "{", "if", "v", ".", "Major", "<", "b", ".", "Major", "{", "return", "false", "\n", "}", "else", "if", "v", ".", "Major", ">", "b", ".", "Major", "{", ...
// AfterOrEqual returns whether one GoVersion is after or // equal to the other.
[ "AfterOrEqual", "returns", "whether", "one", "GoVersion", "is", "after", "or", "equal", "to", "the", "other", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/goversion/go_version.go#L100-L128
127,974
go-delve/delve
pkg/goversion/go_version.go
Installed
func Installed() (GoVersion, bool) { out, err := exec.Command("go", "version").CombinedOutput() if err != nil { return GoVersion{}, false } s := string(out) if !strings.HasPrefix(s, goVersionPrefix) { return GoVersion{}, false } return Parse(s[len(goVersionPrefix):]) }
go
func Installed() (GoVersion, bool) { out, err := exec.Command("go", "version").CombinedOutput() if err != nil { return GoVersion{}, false } s := string(out) if !strings.HasPrefix(s, goVersionPrefix) { return GoVersion{}, false } return Parse(s[len(goVersionPrefix):]) }
[ "func", "Installed", "(", ")", "(", "GoVersion", ",", "bool", ")", "{", "out", ",", "err", ":=", "exec", ".", "Command", "(", "\"", "\"", ",", "\"", "\"", ")", ".", "CombinedOutput", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "GoVer...
// Installed runs "go version" and parses the output
[ "Installed", "runs", "go", "version", "and", "parses", "the", "output" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/goversion/go_version.go#L139-L152
127,975
go-delve/delve
pkg/goversion/go_version.go
ProducerAfterOrEqual
func ProducerAfterOrEqual(producer string, major, minor int) bool { ver := parseProducer(producer) if ver.IsDevel() { return true } return ver.AfterOrEqual(GoVersion{major, minor, -1, 0, 0, ""}) }
go
func ProducerAfterOrEqual(producer string, major, minor int) bool { ver := parseProducer(producer) if ver.IsDevel() { return true } return ver.AfterOrEqual(GoVersion{major, minor, -1, 0, 0, ""}) }
[ "func", "ProducerAfterOrEqual", "(", "producer", "string", ",", "major", ",", "minor", "int", ")", "bool", "{", "ver", ":=", "parseProducer", "(", "producer", ")", "\n", "if", "ver", ".", "IsDevel", "(", ")", "{", "return", "true", "\n", "}", "\n", "re...
// ProducerAfterOrEqual checks that the DW_AT_producer version is // major.minor or a later version, or a development version.
[ "ProducerAfterOrEqual", "checks", "that", "the", "DW_AT_producer", "version", "is", "major", ".", "minor", "or", "a", "later", "version", "or", "a", "development", "version", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/goversion/go_version.go#L169-L175
127,976
go-delve/delve
pkg/proc/native/nonative_darwin.go
Launch
func Launch(cmd []string, wd string, foreground bool, _ []string) (*Process, error) { return nil, ErrNativeBackendDisabled }
go
func Launch(cmd []string, wd string, foreground bool, _ []string) (*Process, error) { return nil, ErrNativeBackendDisabled }
[ "func", "Launch", "(", "cmd", "[", "]", "string", ",", "wd", "string", ",", "foreground", "bool", ",", "_", "[", "]", "string", ")", "(", "*", "Process", ",", "error", ")", "{", "return", "nil", ",", "ErrNativeBackendDisabled", "\n", "}" ]
// Launch returns ErrNativeBackendDisabled.
[ "Launch", "returns", "ErrNativeBackendDisabled", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/nonative_darwin.go#L15-L17
127,977
go-delve/delve
pkg/proc/native/nonative_darwin.go
WriteMemory
func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) { panic(ErrNativeBackendDisabled) }
go
func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) { panic(ErrNativeBackendDisabled) }
[ "func", "(", "t", "*", "Thread", ")", "WriteMemory", "(", "addr", "uintptr", ",", "data", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "panic", "(", "ErrNativeBackendDisabled", ")", "\n", "}" ]
// WriteMemory writes the contents of data at addr.
[ "WriteMemory", "writes", "the", "contents", "of", "data", "at", "addr", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/nonative_darwin.go#L110-L112
127,978
apache/thrift
lib/go/thrift/server_socket.go
NewTServerSocketFromAddrTimeout
func NewTServerSocketFromAddrTimeout(addr net.Addr, clientTimeout time.Duration) *TServerSocket { return &TServerSocket{addr: addr, clientTimeout: clientTimeout} }
go
func NewTServerSocketFromAddrTimeout(addr net.Addr, clientTimeout time.Duration) *TServerSocket { return &TServerSocket{addr: addr, clientTimeout: clientTimeout} }
[ "func", "NewTServerSocketFromAddrTimeout", "(", "addr", "net", ".", "Addr", ",", "clientTimeout", "time", ".", "Duration", ")", "*", "TServerSocket", "{", "return", "&", "TServerSocket", "{", "addr", ":", "addr", ",", "clientTimeout", ":", "clientTimeout", "}", ...
// Creates a TServerSocket from a net.Addr
[ "Creates", "a", "TServerSocket", "from", "a", "net", ".", "Addr" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/server_socket.go#L51-L53
127,979
apache/thrift
lib/go/thrift/exception.go
PrependError
func PrependError(prepend string, err error) error { if t, ok := err.(TTransportException); ok { return NewTTransportException(t.TypeId(), prepend+t.Error()) } if t, ok := err.(TProtocolException); ok { return NewTProtocolExceptionWithType(t.TypeId(), errors.New(prepend+err.Error())) } if t, ok := err.(TApplic...
go
func PrependError(prepend string, err error) error { if t, ok := err.(TTransportException); ok { return NewTTransportException(t.TypeId(), prepend+t.Error()) } if t, ok := err.(TProtocolException); ok { return NewTProtocolExceptionWithType(t.TypeId(), errors.New(prepend+err.Error())) } if t, ok := err.(TApplic...
[ "func", "PrependError", "(", "prepend", "string", ",", "err", "error", ")", "error", "{", "if", "t", ",", "ok", ":=", "err", ".", "(", "TTransportException", ")", ";", "ok", "{", "return", "NewTTransportException", "(", "t", ".", "TypeId", "(", ")", ",...
// Prepends additional information to an error without losing the Thrift exception interface
[ "Prepends", "additional", "information", "to", "an", "error", "without", "losing", "the", "Thrift", "exception", "interface" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/exception.go#L32-L44
127,980
apache/thrift
lib/go/thrift/socket.go
NewTSocketTimeout
func NewTSocketTimeout(hostPort string, timeout time.Duration) (*TSocket, error) { //conn, err := net.DialTimeout(network, address, timeout) addr, err := net.ResolveTCPAddr("tcp", hostPort) if err != nil { return nil, err } return NewTSocketFromAddrTimeout(addr, timeout), nil }
go
func NewTSocketTimeout(hostPort string, timeout time.Duration) (*TSocket, error) { //conn, err := net.DialTimeout(network, address, timeout) addr, err := net.ResolveTCPAddr("tcp", hostPort) if err != nil { return nil, err } return NewTSocketFromAddrTimeout(addr, timeout), nil }
[ "func", "NewTSocketTimeout", "(", "hostPort", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "*", "TSocket", ",", "error", ")", "{", "//conn, err := net.DialTimeout(network, address, timeout)", "addr", ",", "err", ":=", "net", ".", "ResolveTCPAddr", ...
// NewTSocketTimeout creates a net.Conn-backed TTransport, given a host and port // it also accepts a timeout as a time.Duration
[ "NewTSocketTimeout", "creates", "a", "net", ".", "Conn", "-", "backed", "TTransport", "given", "a", "host", "and", "port", "it", "also", "accepts", "a", "timeout", "as", "a", "time", ".", "Duration" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/socket.go#L44-L51
127,981
apache/thrift
lib/go/thrift/socket.go
NewTSocketFromAddrTimeout
func NewTSocketFromAddrTimeout(addr net.Addr, timeout time.Duration) *TSocket { return &TSocket{addr: addr, timeout: timeout} }
go
func NewTSocketFromAddrTimeout(addr net.Addr, timeout time.Duration) *TSocket { return &TSocket{addr: addr, timeout: timeout} }
[ "func", "NewTSocketFromAddrTimeout", "(", "addr", "net", ".", "Addr", ",", "timeout", "time", ".", "Duration", ")", "*", "TSocket", "{", "return", "&", "TSocket", "{", "addr", ":", "addr", ",", "timeout", ":", "timeout", "}", "\n", "}" ]
// Creates a TSocket from a net.Addr
[ "Creates", "a", "TSocket", "from", "a", "net", ".", "Addr" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/socket.go#L54-L56
127,982
apache/thrift
lib/go/thrift/socket.go
NewTSocketFromConnTimeout
func NewTSocketFromConnTimeout(conn net.Conn, timeout time.Duration) *TSocket { return &TSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout} }
go
func NewTSocketFromConnTimeout(conn net.Conn, timeout time.Duration) *TSocket { return &TSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout} }
[ "func", "NewTSocketFromConnTimeout", "(", "conn", "net", ".", "Conn", ",", "timeout", "time", ".", "Duration", ")", "*", "TSocket", "{", "return", "&", "TSocket", "{", "conn", ":", "conn", ",", "addr", ":", "conn", ".", "RemoteAddr", "(", ")", ",", "ti...
// Creates a TSocket from an existing net.Conn
[ "Creates", "a", "TSocket", "from", "an", "existing", "net", ".", "Conn" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/socket.go#L59-L61
127,983
apache/thrift
lib/go/thrift/http_transport.go
NewThriftHandlerFunc
func NewThriftHandlerFunc(processor TProcessor, inPfactory, outPfactory TProtocolFactory) func(w http.ResponseWriter, r *http.Request) { return gz(func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Type", "application/x-thrift") transport := NewStreamTransport(r.Body, w) processor.Process(...
go
func NewThriftHandlerFunc(processor TProcessor, inPfactory, outPfactory TProtocolFactory) func(w http.ResponseWriter, r *http.Request) { return gz(func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Type", "application/x-thrift") transport := NewStreamTransport(r.Body, w) processor.Process(...
[ "func", "NewThriftHandlerFunc", "(", "processor", "TProcessor", ",", "inPfactory", ",", "outPfactory", "TProtocolFactory", ")", "func", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "return", "gz", "(", "func", "("...
// NewThriftHandlerFunc is a function that create a ready to use Apache Thrift Handler function
[ "NewThriftHandlerFunc", "is", "a", "function", "that", "create", "a", "ready", "to", "use", "Apache", "Thrift", "Handler", "function" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/http_transport.go#L30-L39
127,984
apache/thrift
lib/go/thrift/http_transport.go
gz
func gz(handler http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") { handler(w, r) return } w.Header().Set("Content-Encoding", "gzip") gz := gzip.NewWriter(w) defer gz.Close() gzw := gzipResponseWrit...
go
func gz(handler http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") { handler(w, r) return } w.Header().Set("Content-Encoding", "gzip") gz := gzip.NewWriter(w) defer gz.Close() gzw := gzipResponseWrit...
[ "func", "gz", "(", "handler", "http", ".", "HandlerFunc", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "if", "!", "strings", ".", "Contains", "(", "r...
// gz transparently compresses the HTTP response if the client supports it.
[ "gz", "transparently", "compresses", "the", "HTTP", "response", "if", "the", "client", "supports", "it", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/http_transport.go#L42-L54
127,985
apache/thrift
lib/go/thrift/ssl_socket.go
NewTSSLSocketFromAddrTimeout
func NewTSSLSocketFromAddrTimeout(addr net.Addr, cfg *tls.Config, timeout time.Duration) *TSSLSocket { return &TSSLSocket{addr: addr, timeout: timeout, cfg: cfg} }
go
func NewTSSLSocketFromAddrTimeout(addr net.Addr, cfg *tls.Config, timeout time.Duration) *TSSLSocket { return &TSSLSocket{addr: addr, timeout: timeout, cfg: cfg} }
[ "func", "NewTSSLSocketFromAddrTimeout", "(", "addr", "net", ".", "Addr", ",", "cfg", "*", "tls", ".", "Config", ",", "timeout", "time", ".", "Duration", ")", "*", "TSSLSocket", "{", "return", "&", "TSSLSocket", "{", "addr", ":", "addr", ",", "timeout", "...
// Creates a TSSLSocket from a net.Addr
[ "Creates", "a", "TSSLSocket", "from", "a", "net", ".", "Addr" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/ssl_socket.go#L59-L61
127,986
apache/thrift
lib/go/thrift/ssl_socket.go
NewTSSLSocketFromConnTimeout
func NewTSSLSocketFromConnTimeout(conn net.Conn, cfg *tls.Config, timeout time.Duration) *TSSLSocket { return &TSSLSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout, cfg: cfg} }
go
func NewTSSLSocketFromConnTimeout(conn net.Conn, cfg *tls.Config, timeout time.Duration) *TSSLSocket { return &TSSLSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout, cfg: cfg} }
[ "func", "NewTSSLSocketFromConnTimeout", "(", "conn", "net", ".", "Conn", ",", "cfg", "*", "tls", ".", "Config", ",", "timeout", "time", ".", "Duration", ")", "*", "TSSLSocket", "{", "return", "&", "TSSLSocket", "{", "conn", ":", "conn", ",", "addr", ":",...
// Creates a TSSLSocket from an existing net.Conn
[ "Creates", "a", "TSSLSocket", "from", "an", "existing", "net", ".", "Conn" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/ssl_socket.go#L64-L66
127,987
apache/thrift
lib/go/thrift/iostream_transport.go
Open
func (p *StreamTransport) Open() error { if !p.closed { return NewTTransportException(ALREADY_OPEN, "StreamTransport already open.") } else { return NewTTransportException(NOT_OPEN, "cannot reopen StreamTransport.") } }
go
func (p *StreamTransport) Open() error { if !p.closed { return NewTTransportException(ALREADY_OPEN, "StreamTransport already open.") } else { return NewTTransportException(NOT_OPEN, "cannot reopen StreamTransport.") } }
[ "func", "(", "p", "*", "StreamTransport", ")", "Open", "(", ")", "error", "{", "if", "!", "p", ".", "closed", "{", "return", "NewTTransportException", "(", "ALREADY_OPEN", ",", "\"", "\"", ")", "\n", "}", "else", "{", "return", "NewTTransportException", ...
// implicitly opened on creation, can't be reopened once closed
[ "implicitly", "opened", "on", "creation", "can", "t", "be", "reopened", "once", "closed" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/iostream_transport.go#L102-L108
127,988
apache/thrift
lib/go/thrift/iostream_transport.go
Close
func (p *StreamTransport) Close() error { if p.closed { return NewTTransportException(NOT_OPEN, "StreamTransport already closed.") } p.closed = true closedReader := false if p.Reader != nil { c, ok := p.Reader.(io.Closer) if ok { e := c.Close() closedReader = true if e != nil { return e } }...
go
func (p *StreamTransport) Close() error { if p.closed { return NewTTransportException(NOT_OPEN, "StreamTransport already closed.") } p.closed = true closedReader := false if p.Reader != nil { c, ok := p.Reader.(io.Closer) if ok { e := c.Close() closedReader = true if e != nil { return e } }...
[ "func", "(", "p", "*", "StreamTransport", ")", "Close", "(", ")", "error", "{", "if", "p", ".", "closed", "{", "return", "NewTTransportException", "(", "NOT_OPEN", ",", "\"", "\"", ")", "\n", "}", "\n", "p", ".", "closed", "=", "true", "\n", "closedR...
// Closes both the input and output streams.
[ "Closes", "both", "the", "input", "and", "output", "streams", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/iostream_transport.go#L111-L139
127,989
apache/thrift
lib/go/thrift/iostream_transport.go
Flush
func (p *StreamTransport) Flush(ctx context.Context) error { if p.Writer == nil { return NewTTransportException(NOT_OPEN, "Cannot flush null outputStream") } f, ok := p.Writer.(Flusher) if ok { err := f.Flush() if err != nil { return NewTTransportExceptionFromError(err) } } return nil }
go
func (p *StreamTransport) Flush(ctx context.Context) error { if p.Writer == nil { return NewTTransportException(NOT_OPEN, "Cannot flush null outputStream") } f, ok := p.Writer.(Flusher) if ok { err := f.Flush() if err != nil { return NewTTransportExceptionFromError(err) } } return nil }
[ "func", "(", "p", "*", "StreamTransport", ")", "Flush", "(", "ctx", "context", ".", "Context", ")", "error", "{", "if", "p", ".", "Writer", "==", "nil", "{", "return", "NewTTransportException", "(", "NOT_OPEN", ",", "\"", "\"", ")", "\n", "}", "\n", ...
// Flushes the underlying output stream if not null.
[ "Flushes", "the", "underlying", "output", "stream", "if", "not", "null", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/iostream_transport.go#L142-L154
127,990
apache/thrift
lib/go/thrift/simple_json_protocol.go
safePeekContains
func (p *TSimpleJSONProtocol) safePeekContains(b []byte) bool { for i := 0; i < len(b); i++ { a, _ := p.reader.Peek(i + 1) if len(a) < (i+1) || a[i] != b[i] { return false } } return true }
go
func (p *TSimpleJSONProtocol) safePeekContains(b []byte) bool { for i := 0; i < len(b); i++ { a, _ := p.reader.Peek(i + 1) if len(a) < (i+1) || a[i] != b[i] { return false } } return true }
[ "func", "(", "p", "*", "TSimpleJSONProtocol", ")", "safePeekContains", "(", "b", "[", "]", "byte", ")", "bool", "{", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "b", ")", ";", "i", "++", "{", "a", ",", "_", ":=", "p", ".", "reader", "."...
// Safely peeks into the buffer, reading only what is necessary
[ "Safely", "peeks", "into", "the", "buffer", "reading", "only", "what", "is", "necessary" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/simple_json_protocol.go#L1316-L1324
127,991
apache/thrift
lib/go/thrift/simple_json_protocol.go
resetContextStack
func (p *TSimpleJSONProtocol) resetContextStack() { p.parseContextStack = []int{int(_CONTEXT_IN_TOPLEVEL)} p.dumpContext = []int{int(_CONTEXT_IN_TOPLEVEL)} }
go
func (p *TSimpleJSONProtocol) resetContextStack() { p.parseContextStack = []int{int(_CONTEXT_IN_TOPLEVEL)} p.dumpContext = []int{int(_CONTEXT_IN_TOPLEVEL)} }
[ "func", "(", "p", "*", "TSimpleJSONProtocol", ")", "resetContextStack", "(", ")", "{", "p", ".", "parseContextStack", "=", "[", "]", "int", "{", "int", "(", "_CONTEXT_IN_TOPLEVEL", ")", "}", "\n", "p", ".", "dumpContext", "=", "[", "]", "int", "{", "in...
// Reset the context stack to its initial state.
[ "Reset", "the", "context", "stack", "to", "its", "initial", "state", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/simple_json_protocol.go#L1327-L1330
127,992
apache/thrift
lib/go/thrift/compact_protocol.go
NewTCompactProtocol
func NewTCompactProtocol(trans TTransport) *TCompactProtocol { p := &TCompactProtocol{origTransport: trans, lastField: []int{}} if et, ok := trans.(TRichTransport); ok { p.trans = et } else { p.trans = NewTRichTransport(trans) } return p }
go
func NewTCompactProtocol(trans TTransport) *TCompactProtocol { p := &TCompactProtocol{origTransport: trans, lastField: []int{}} if et, ok := trans.(TRichTransport); ok { p.trans = et } else { p.trans = NewTRichTransport(trans) } return p }
[ "func", "NewTCompactProtocol", "(", "trans", "TTransport", ")", "*", "TCompactProtocol", "{", "p", ":=", "&", "TCompactProtocol", "{", "origTransport", ":", "trans", ",", "lastField", ":", "[", "]", "int", "{", "}", "}", "\n", "if", "et", ",", "ok", ":="...
// Create a TCompactProtocol given a TTransport
[ "Create", "a", "TCompactProtocol", "given", "a", "TTransport" ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L110-L120
127,993
apache/thrift
lib/go/thrift/compact_protocol.go
WriteStructBegin
func (p *TCompactProtocol) WriteStructBegin(name string) error { p.lastField = append(p.lastField, p.lastFieldId) p.lastFieldId = 0 return nil }
go
func (p *TCompactProtocol) WriteStructBegin(name string) error { p.lastField = append(p.lastField, p.lastFieldId) p.lastFieldId = 0 return nil }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteStructBegin", "(", "name", "string", ")", "error", "{", "p", ".", "lastField", "=", "append", "(", "p", ".", "lastField", ",", "p", ".", "lastFieldId", ")", "\n", "p", ".", "lastFieldId", "=", "0", ...
// Write a struct begin. This doesn't actually put anything on the wire. We // use it as an opportunity to put special placeholder markers on the field // stack so we can get the field id deltas correct.
[ "Write", "a", "struct", "begin", ".", "This", "doesn", "t", "actually", "put", "anything", "on", "the", "wire", ".", "We", "use", "it", "as", "an", "opportunity", "to", "put", "special", "placeholder", "markers", "on", "the", "field", "stack", "so", "we"...
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L151-L155
127,994
apache/thrift
lib/go/thrift/compact_protocol.go
WriteStructEnd
func (p *TCompactProtocol) WriteStructEnd() error { p.lastFieldId = p.lastField[len(p.lastField)-1] p.lastField = p.lastField[:len(p.lastField)-1] return nil }
go
func (p *TCompactProtocol) WriteStructEnd() error { p.lastFieldId = p.lastField[len(p.lastField)-1] p.lastField = p.lastField[:len(p.lastField)-1] return nil }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteStructEnd", "(", ")", "error", "{", "p", ".", "lastFieldId", "=", "p", ".", "lastField", "[", "len", "(", "p", ".", "lastField", ")", "-", "1", "]", "\n", "p", ".", "lastField", "=", "p", ".", ...
// Write a struct end. This doesn't actually put anything on the wire. We use // this as an opportunity to pop the last field from the current struct off // of the field stack.
[ "Write", "a", "struct", "end", ".", "This", "doesn", "t", "actually", "put", "anything", "on", "the", "wire", ".", "We", "use", "this", "as", "an", "opportunity", "to", "pop", "the", "last", "field", "from", "the", "current", "struct", "off", "of", "th...
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L160-L164
127,995
apache/thrift
lib/go/thrift/compact_protocol.go
WriteListBegin
func (p *TCompactProtocol) WriteListBegin(elemType TType, size int) error { _, err := p.writeCollectionBegin(elemType, size) return NewTProtocolException(err) }
go
func (p *TCompactProtocol) WriteListBegin(elemType TType, size int) error { _, err := p.writeCollectionBegin(elemType, size) return NewTProtocolException(err) }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteListBegin", "(", "elemType", "TType", ",", "size", "int", ")", "error", "{", "_", ",", "err", ":=", "p", ".", "writeCollectionBegin", "(", "elemType", ",", "size", ")", "\n", "return", "NewTProtocolExce...
// Write a list header.
[ "Write", "a", "list", "header", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L239-L242
127,996
apache/thrift
lib/go/thrift/compact_protocol.go
WriteI16
func (p *TCompactProtocol) WriteI16(value int16) error { _, err := p.writeVarint32(p.int32ToZigzag(int32(value))) return NewTProtocolException(err) }
go
func (p *TCompactProtocol) WriteI16(value int16) error { _, err := p.writeVarint32(p.int32ToZigzag(int32(value))) return NewTProtocolException(err) }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteI16", "(", "value", "int16", ")", "error", "{", "_", ",", "err", ":=", "p", ".", "writeVarint32", "(", "p", ".", "int32ToZigzag", "(", "int32", "(", "value", ")", ")", ")", "\n", "return", "NewTPr...
// Write an I16 as a zigzag varint.
[ "Write", "an", "I16", "as", "a", "zigzag", "varint", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L277-L280
127,997
apache/thrift
lib/go/thrift/compact_protocol.go
WriteI32
func (p *TCompactProtocol) WriteI32(value int32) error { _, err := p.writeVarint32(p.int32ToZigzag(value)) return NewTProtocolException(err) }
go
func (p *TCompactProtocol) WriteI32(value int32) error { _, err := p.writeVarint32(p.int32ToZigzag(value)) return NewTProtocolException(err) }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteI32", "(", "value", "int32", ")", "error", "{", "_", ",", "err", ":=", "p", ".", "writeVarint32", "(", "p", ".", "int32ToZigzag", "(", "value", ")", ")", "\n", "return", "NewTProtocolException", "(", ...
// Write an i32 as a zigzag varint.
[ "Write", "an", "i32", "as", "a", "zigzag", "varint", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L283-L286
127,998
apache/thrift
lib/go/thrift/compact_protocol.go
WriteI64
func (p *TCompactProtocol) WriteI64(value int64) error { _, err := p.writeVarint64(p.int64ToZigzag(value)) return NewTProtocolException(err) }
go
func (p *TCompactProtocol) WriteI64(value int64) error { _, err := p.writeVarint64(p.int64ToZigzag(value)) return NewTProtocolException(err) }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteI64", "(", "value", "int64", ")", "error", "{", "_", ",", "err", ":=", "p", ".", "writeVarint64", "(", "p", ".", "int64ToZigzag", "(", "value", ")", ")", "\n", "return", "NewTProtocolException", "(", ...
// Write an i64 as a zigzag varint.
[ "Write", "an", "i64", "as", "a", "zigzag", "varint", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L289-L292
127,999
apache/thrift
lib/go/thrift/compact_protocol.go
WriteDouble
func (p *TCompactProtocol) WriteDouble(value float64) error { buf := p.buffer[0:8] binary.LittleEndian.PutUint64(buf, math.Float64bits(value)) _, err := p.trans.Write(buf) return NewTProtocolException(err) }
go
func (p *TCompactProtocol) WriteDouble(value float64) error { buf := p.buffer[0:8] binary.LittleEndian.PutUint64(buf, math.Float64bits(value)) _, err := p.trans.Write(buf) return NewTProtocolException(err) }
[ "func", "(", "p", "*", "TCompactProtocol", ")", "WriteDouble", "(", "value", "float64", ")", "error", "{", "buf", ":=", "p", ".", "buffer", "[", "0", ":", "8", "]", "\n", "binary", ".", "LittleEndian", ".", "PutUint64", "(", "buf", ",", "math", ".", ...
// Write a double to the wire as 8 bytes.
[ "Write", "a", "double", "to", "the", "wire", "as", "8", "bytes", "." ]
366cc3dee0f279b652644ae96b05fabd6fae2e06
https://github.com/apache/thrift/blob/366cc3dee0f279b652644ae96b05fabd6fae2e06/lib/go/thrift/compact_protocol.go#L295-L300