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,800
go-delve/delve
pkg/dwarf/reader/reader.go
Next
func (irdr *InlineStackReader) Next() bool { if irdr.err != nil { return false } for { irdr.entry, irdr.err = irdr.reader.Next() if irdr.entry == nil || irdr.err != nil { return false } switch irdr.entry.Tag { case 0: irdr.depth-- if irdr.depth == 0 { return false } case dwarf.TagLex...
go
func (irdr *InlineStackReader) Next() bool { if irdr.err != nil { return false } for { irdr.entry, irdr.err = irdr.reader.Next() if irdr.entry == nil || irdr.err != nil { return false } switch irdr.entry.Tag { case 0: irdr.depth-- if irdr.depth == 0 { return false } case dwarf.TagLex...
[ "func", "(", "irdr", "*", "InlineStackReader", ")", "Next", "(", ")", "bool", "{", "if", "irdr", ".", "err", "!=", "nil", "{", "return", "false", "\n", "}", "\n\n", "for", "{", "irdr", ".", "entry", ",", "irdr", ".", "err", "=", "irdr", ".", "rea...
// Next reads next inlined call in the stack, returns false if there aren't any.
[ "Next", "reads", "next", "inlined", "call", "in", "the", "stack", "returns", "false", "if", "there", "aren", "t", "any", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/reader/reader.go#L390-L431
127,801
go-delve/delve
pkg/proc/native/threads.go
Continue
func (t *Thread) Continue() error { pc, err := t.PC() if err != nil { return err } // Check whether we are stopped at a breakpoint, and // if so, single step over it before continuing. if _, ok := t.dbp.FindBreakpoint(pc); ok { if err := t.StepInstruction(); err != nil { return err } } return t.resume(...
go
func (t *Thread) Continue() error { pc, err := t.PC() if err != nil { return err } // Check whether we are stopped at a breakpoint, and // if so, single step over it before continuing. if _, ok := t.dbp.FindBreakpoint(pc); ok { if err := t.StepInstruction(); err != nil { return err } } return t.resume(...
[ "func", "(", "t", "*", "Thread", ")", "Continue", "(", ")", "error", "{", "pc", ",", "err", ":=", "t", ".", "PC", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "// Check whether we are stopped at a breakpoint, and", "...
// Continue the execution of this thread. // // If we are currently at a breakpoint, we'll clear it // first and then resume execution. Thread will continue until // it hits a breakpoint or is signaled.
[ "Continue", "the", "execution", "of", "this", "thread", ".", "If", "we", "are", "currently", "at", "a", "breakpoint", "we", "ll", "clear", "it", "first", "and", "then", "resume", "execution", ".", "Thread", "will", "continue", "until", "it", "hits", "a", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L30-L43
127,802
go-delve/delve
pkg/proc/native/threads.go
StepInstruction
func (t *Thread) StepInstruction() (err error) { t.singleStepping = true defer func() { t.singleStepping = false }() pc, err := t.PC() if err != nil { return err } bp, ok := t.dbp.FindBreakpoint(pc) if ok { // Clear the breakpoint so that we can continue execution. err = t.ClearBreakpoint(bp) if err ...
go
func (t *Thread) StepInstruction() (err error) { t.singleStepping = true defer func() { t.singleStepping = false }() pc, err := t.PC() if err != nil { return err } bp, ok := t.dbp.FindBreakpoint(pc) if ok { // Clear the breakpoint so that we can continue execution. err = t.ClearBreakpoint(bp) if err ...
[ "func", "(", "t", "*", "Thread", ")", "StepInstruction", "(", ")", "(", "err", "error", ")", "{", "t", ".", "singleStepping", "=", "true", "\n", "defer", "func", "(", ")", "{", "t", ".", "singleStepping", "=", "false", "\n", "}", "(", ")", "\n", ...
// StepInstruction steps a single instruction. // // Executes exactly one instruction and then returns. // If the thread is at a breakpoint, we first clear it, // execute the instruction, and then replace the breakpoint. // Otherwise we simply execute the next instruction.
[ "StepInstruction", "steps", "a", "single", "instruction", ".", "Executes", "exactly", "one", "instruction", "and", "then", "returns", ".", "If", "the", "thread", "is", "at", "a", "breakpoint", "we", "first", "clear", "it", "execute", "the", "instruction", "and...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L51-L83
127,803
go-delve/delve
pkg/proc/native/threads.go
SetCurrentBreakpoint
func (t *Thread) SetCurrentBreakpoint() error { t.CurrentBreakpoint.Clear() pc, err := t.PC() if err != nil { return err } if bp, ok := t.dbp.FindBreakpoint(pc); ok { if err = t.SetPC(bp.Addr); err != nil { return err } t.CurrentBreakpoint = bp.CheckCondition(t) if t.CurrentBreakpoint.Breakpoint != ni...
go
func (t *Thread) SetCurrentBreakpoint() error { t.CurrentBreakpoint.Clear() pc, err := t.PC() if err != nil { return err } if bp, ok := t.dbp.FindBreakpoint(pc); ok { if err = t.SetPC(bp.Addr); err != nil { return err } t.CurrentBreakpoint = bp.CheckCondition(t) if t.CurrentBreakpoint.Breakpoint != ni...
[ "func", "(", "t", "*", "Thread", ")", "SetCurrentBreakpoint", "(", ")", "error", "{", "t", ".", "CurrentBreakpoint", ".", "Clear", "(", ")", "\n", "pc", ",", "err", ":=", "t", ".", "PC", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "e...
// SetCurrentBreakpoint sets the current breakpoint that this // thread is stopped at as CurrentBreakpoint on the thread struct.
[ "SetCurrentBreakpoint", "sets", "the", "current", "breakpoint", "that", "this", "thread", "is", "stopped", "at", "as", "CurrentBreakpoint", "on", "the", "thread", "struct", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L116-L135
127,804
go-delve/delve
pkg/proc/native/threads.go
ClearBreakpoint
func (t *Thread) ClearBreakpoint(bp *proc.Breakpoint) error { if _, err := t.WriteMemory(uintptr(bp.Addr), bp.OriginalData); err != nil { return fmt.Errorf("could not clear breakpoint %s", err) } return nil }
go
func (t *Thread) ClearBreakpoint(bp *proc.Breakpoint) error { if _, err := t.WriteMemory(uintptr(bp.Addr), bp.OriginalData); err != nil { return fmt.Errorf("could not clear breakpoint %s", err) } return nil }
[ "func", "(", "t", "*", "Thread", ")", "ClearBreakpoint", "(", "bp", "*", "proc", ".", "Breakpoint", ")", "error", "{", "if", "_", ",", "err", ":=", "t", ".", "WriteMemory", "(", "uintptr", "(", "bp", ".", "Addr", ")", ",", "bp", ".", "OriginalData"...
// ClearBreakpoint clears the specified breakpoint.
[ "ClearBreakpoint", "clears", "the", "specified", "breakpoint", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L149-L154
127,805
go-delve/delve
pkg/proc/native/threads.go
RestoreRegisters
func (t *Thread) RestoreRegisters(savedRegs proc.Registers) error { return t.restoreRegisters(savedRegs) }
go
func (t *Thread) RestoreRegisters(savedRegs proc.Registers) error { return t.restoreRegisters(savedRegs) }
[ "func", "(", "t", "*", "Thread", ")", "RestoreRegisters", "(", "savedRegs", "proc", ".", "Registers", ")", "error", "{", "return", "t", ".", "restoreRegisters", "(", "savedRegs", ")", "\n", "}" ]
// RestoreRegisters will set the value of the CPU registers to those // passed in via 'savedRegs'.
[ "RestoreRegisters", "will", "set", "the", "value", "of", "the", "CPU", "registers", "to", "those", "passed", "in", "via", "savedRegs", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L163-L165
127,806
go-delve/delve
pkg/proc/native/threads.go
PC
func (t *Thread) PC() (uint64, error) { regs, err := t.Registers(false) if err != nil { return 0, err } return regs.PC(), nil }
go
func (t *Thread) PC() (uint64, error) { regs, err := t.Registers(false) if err != nil { return 0, err } return regs.PC(), nil }
[ "func", "(", "t", "*", "Thread", ")", "PC", "(", ")", "(", "uint64", ",", "error", ")", "{", "regs", ",", "err", ":=", "t", ".", "Registers", "(", "false", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", ...
// PC returns the current program counter value for this thread.
[ "PC", "returns", "the", "current", "program", "counter", "value", "for", "this", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/threads.go#L168-L174
127,807
go-delve/delve
pkg/proc/registers.go
AppendEflagReg
func AppendEflagReg(regs []Register, name string, value uint64) []Register { return appendFlagReg(regs, name, value, eflagsDescription, 64) }
go
func AppendEflagReg(regs []Register, name string, value uint64) []Register { return appendFlagReg(regs, name, value, eflagsDescription, 64) }
[ "func", "AppendEflagReg", "(", "regs", "[", "]", "Register", ",", "name", "string", ",", "value", "uint64", ")", "[", "]", "Register", "{", "return", "appendFlagReg", "(", "regs", ",", "name", ",", "value", ",", "eflagsDescription", ",", "64", ")", "\n",...
// AppendEflagReg appends EFLAG register to regs.
[ "AppendEflagReg", "appends", "EFLAG", "register", "to", "regs", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/registers.go#L67-L69
127,808
go-delve/delve
pkg/proc/registers.go
AppendMxcsrReg
func AppendMxcsrReg(regs []Register, name string, value uint64) []Register { return appendFlagReg(regs, name, value, mxcsrDescription, 32) }
go
func AppendMxcsrReg(regs []Register, name string, value uint64) []Register { return appendFlagReg(regs, name, value, mxcsrDescription, 32) }
[ "func", "AppendMxcsrReg", "(", "regs", "[", "]", "Register", ",", "name", "string", ",", "value", "uint64", ")", "[", "]", "Register", "{", "return", "appendFlagReg", "(", "regs", ",", "name", ",", "value", ",", "mxcsrDescription", ",", "32", ")", "\n", ...
// AppendMxcsrReg appends MXCSR register to regs.
[ "AppendMxcsrReg", "appends", "MXCSR", "register", "to", "regs", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/registers.go#L72-L74
127,809
go-delve/delve
pkg/proc/registers.go
AppendX87Reg
func AppendX87Reg(regs []Register, index int, exponent uint16, mantissa uint64) []Register { var f float64 fset := false const ( _SIGNBIT = 1 << 15 _EXP_BIAS = (1 << 14) - 1 // 2^(n-1) - 1 = 16383 _SPECIALEXP = (1 << 15) - 1 // all bits set _HIGHBIT = 1 << 63 _QUIETBIT = 1 << 62 ) sign := 1.0...
go
func AppendX87Reg(regs []Register, index int, exponent uint16, mantissa uint64) []Register { var f float64 fset := false const ( _SIGNBIT = 1 << 15 _EXP_BIAS = (1 << 14) - 1 // 2^(n-1) - 1 = 16383 _SPECIALEXP = (1 << 15) - 1 // all bits set _HIGHBIT = 1 << 63 _QUIETBIT = 1 << 62 ) sign := 1.0...
[ "func", "AppendX87Reg", "(", "regs", "[", "]", "Register", ",", "index", "int", ",", "exponent", "uint16", ",", "mantissa", "uint64", ")", "[", "]", "Register", "{", "var", "f", "float64", "\n", "fset", ":=", "false", "\n\n", "const", "(", "_SIGNBIT", ...
// AppendX87Reg appends a 80 bit float register to regs.
[ "AppendX87Reg", "appends", "a", "80", "bit", "float", "register", "to", "regs", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/registers.go#L77-L134
127,810
go-delve/delve
pkg/proc/native/proc_windows.go
Launch
func Launch(cmd []string, wd string, foreground bool, _ []string) (*Process, error) { argv0Go, err := filepath.Abs(cmd[0]) if err != nil { return nil, err } // Make sure the binary exists and is an executable file if filepath.Base(cmd[0]) == cmd[0] { if _, err := exec.LookPath(cmd[0]); err != nil { return ...
go
func Launch(cmd []string, wd string, foreground bool, _ []string) (*Process, error) { argv0Go, err := filepath.Abs(cmd[0]) if err != nil { return nil, err } // Make sure the binary exists and is an executable file if filepath.Base(cmd[0]) == cmd[0] { if _, err := exec.LookPath(cmd[0]); err != nil { return ...
[ "func", "Launch", "(", "cmd", "[", "]", "string", ",", "wd", "string", ",", "foreground", "bool", ",", "_", "[", "]", "string", ")", "(", "*", "Process", ",", "error", ")", "{", "argv0Go", ",", "err", ":=", "filepath", ".", "Abs", "(", "cmd", "["...
// Launch creates and begins debugging a new process.
[ "Launch", "creates", "and", "begins", "debugging", "a", "new", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_windows.go#L39-L84
127,811
go-delve/delve
pkg/proc/native/proc_windows.go
findExePath
func findExePath(pid int) (string, error) { // Original code suggested different approach (see below). // Maybe it could be useful in the future. // // Find executable path from PID/handle on Windows: // https://msdn.microsoft.com/en-us/library/aa366789(VS.85).aspx p, err := syscall.OpenProcess(syscall.PROCESS_Q...
go
func findExePath(pid int) (string, error) { // Original code suggested different approach (see below). // Maybe it could be useful in the future. // // Find executable path from PID/handle on Windows: // https://msdn.microsoft.com/en-us/library/aa366789(VS.85).aspx p, err := syscall.OpenProcess(syscall.PROCESS_Q...
[ "func", "findExePath", "(", "pid", "int", ")", "(", "string", ",", "error", ")", "{", "// Original code suggested different approach (see below).", "// Maybe it could be useful in the future.", "//", "// Find executable path from PID/handle on Windows:", "// https://msdn.microsoft.co...
// findExePath searches for process pid, and returns its executable path.
[ "findExePath", "searches", "for", "process", "pid", "and", "returns", "its", "executable", "path", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_windows.go#L120-L151
127,812
go-delve/delve
pkg/proc/native/proc_windows.go
kill
func (dbp *Process) kill() error { if dbp.exited { return nil } p, err := os.FindProcess(dbp.pid) if err != nil { return err } defer p.Release() // TODO: Should not have to ignore failures here, // but some tests appear to Kill twice causing // this to fail on second attempt. _ = syscall.TerminateProces...
go
func (dbp *Process) kill() error { if dbp.exited { return nil } p, err := os.FindProcess(dbp.pid) if err != nil { return err } defer p.Release() // TODO: Should not have to ignore failures here, // but some tests appear to Kill twice causing // this to fail on second attempt. _ = syscall.TerminateProces...
[ "func", "(", "dbp", "*", "Process", ")", "kill", "(", ")", "error", "{", "if", "dbp", ".", "exited", "{", "return", "nil", "\n", "}", "\n\n", "p", ",", "err", ":=", "os", ".", "FindProcess", "(", "dbp", ".", "pid", ")", "\n", "if", "err", "!=",...
// kill kills the process.
[ "kill", "kills", "the", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_windows.go#L173-L197
127,813
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
TagOpen
func (b *Builder) TagOpen(tag dwarf.Tag, name string) dwarf.Offset { if len(b.tagStack) > 0 { b.tagStack[len(b.tagStack)-1].children = true } ts := &tagState{off: dwarf.Offset(b.info.Len())} ts.tag = tag b.info.WriteByte(0) b.tagStack = append(b.tagStack, ts) b.Attr(dwarf.AttrName, name) return ts.off }
go
func (b *Builder) TagOpen(tag dwarf.Tag, name string) dwarf.Offset { if len(b.tagStack) > 0 { b.tagStack[len(b.tagStack)-1].children = true } ts := &tagState{off: dwarf.Offset(b.info.Len())} ts.tag = tag b.info.WriteByte(0) b.tagStack = append(b.tagStack, ts) b.Attr(dwarf.AttrName, name) return ts.off }
[ "func", "(", "b", "*", "Builder", ")", "TagOpen", "(", "tag", "dwarf", ".", "Tag", ",", "name", "string", ")", "dwarf", ".", "Offset", "{", "if", "len", "(", "b", ".", "tagStack", ")", ">", "0", "{", "b", ".", "tagStack", "[", "len", "(", "b", ...
// TagOpen starts a new DIE, call TagClose after adding all attributes and // children elements.
[ "TagOpen", "starts", "a", "new", "DIE", "call", "TagClose", "after", "adding", "all", "attributes", "and", "children", "elements", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L87-L98
127,814
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
TagClose
func (b *Builder) TagClose() { if len(b.tagStack) <= 0 { panic("TagClose with no open tags") } tag := b.tagStack[len(b.tagStack)-1] abbrev := b.abbrevFor(tag.tagDescr) b.info.Bytes()[tag.off] = abbrev if tag.children { b.info.WriteByte(0) } b.tagStack = b.tagStack[:len(b.tagStack)-1] return }
go
func (b *Builder) TagClose() { if len(b.tagStack) <= 0 { panic("TagClose with no open tags") } tag := b.tagStack[len(b.tagStack)-1] abbrev := b.abbrevFor(tag.tagDescr) b.info.Bytes()[tag.off] = abbrev if tag.children { b.info.WriteByte(0) } b.tagStack = b.tagStack[:len(b.tagStack)-1] return }
[ "func", "(", "b", "*", "Builder", ")", "TagClose", "(", ")", "{", "if", "len", "(", "b", ".", "tagStack", ")", "<=", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "tag", ":=", "b", ".", "tagStack", "[", "len", "(", "b", ".", "ta...
// TagClose closes the current DIE.
[ "TagClose", "closes", "the", "current", "DIE", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L109-L121
127,815
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
abbrevFor
func (b *Builder) abbrevFor(tag tagDescr) byte { for abbrev, descr := range b.abbrevs { if sameTagDescr(descr, tag) { return byte(abbrev + 1) } } b.abbrevs = append(b.abbrevs, tag) return byte(len(b.abbrevs)) }
go
func (b *Builder) abbrevFor(tag tagDescr) byte { for abbrev, descr := range b.abbrevs { if sameTagDescr(descr, tag) { return byte(abbrev + 1) } } b.abbrevs = append(b.abbrevs, tag) return byte(len(b.abbrevs)) }
[ "func", "(", "b", "*", "Builder", ")", "abbrevFor", "(", "tag", "tagDescr", ")", "byte", "{", "for", "abbrev", ",", "descr", ":=", "range", "b", ".", "abbrevs", "{", "if", "sameTagDescr", "(", "descr", ",", "tag", ")", "{", "return", "byte", "(", "...
// abbrevFor returns an abbrev for the given entry description. If no abbrev // for tag already exist a new one is created.
[ "abbrevFor", "returns", "an", "abbrev", "for", "the", "given", "entry", "description", ".", "If", "no", "abbrev", "for", "tag", "already", "exist", "a", "new", "one", "is", "created", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L202-L211
127,816
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddSubprogram
func (b *Builder) AddSubprogram(fnname string, lowpc, highpc uint64) dwarf.Offset { r := b.TagOpen(dwarf.TagSubprogram, fnname) b.Attr(dwarf.AttrLowpc, Address(lowpc)) b.Attr(dwarf.AttrHighpc, Address(highpc)) return r }
go
func (b *Builder) AddSubprogram(fnname string, lowpc, highpc uint64) dwarf.Offset { r := b.TagOpen(dwarf.TagSubprogram, fnname) b.Attr(dwarf.AttrLowpc, Address(lowpc)) b.Attr(dwarf.AttrHighpc, Address(highpc)) return r }
[ "func", "(", "b", "*", "Builder", ")", "AddSubprogram", "(", "fnname", "string", ",", "lowpc", ",", "highpc", "uint64", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagSubprogram", ",", "fnname", ")", "\n", "b...
// AddSubprogram adds a subprogram declaration to debug_info, must call // TagClose after adding all local variables and parameters. // Will write an abbrev corresponding to a DW_TAG_subprogram, followed by a // DW_AT_lowpc and a DW_AT_highpc.
[ "AddSubprogram", "adds", "a", "subprogram", "declaration", "to", "debug_info", "must", "call", "TagClose", "after", "adding", "all", "local", "variables", "and", "parameters", ".", "Will", "write", "an", "abbrev", "corresponding", "to", "a", "DW_TAG_subprogram", "...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L239-L244
127,817
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddVariable
func (b *Builder) AddVariable(varname string, typ dwarf.Offset, loc interface{}) dwarf.Offset { r := b.TagOpen(dwarf.TagVariable, varname) b.Attr(dwarf.AttrType, typ) b.Attr(dwarf.AttrLocation, loc) b.TagClose() return r }
go
func (b *Builder) AddVariable(varname string, typ dwarf.Offset, loc interface{}) dwarf.Offset { r := b.TagOpen(dwarf.TagVariable, varname) b.Attr(dwarf.AttrType, typ) b.Attr(dwarf.AttrLocation, loc) b.TagClose() return r }
[ "func", "(", "b", "*", "Builder", ")", "AddVariable", "(", "varname", "string", ",", "typ", "dwarf", ".", "Offset", ",", "loc", "interface", "{", "}", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagVariable",...
// AddVariable adds a new variable entry to debug_info. // Will write a DW_TAG_variable, followed by a DW_AT_type and a // DW_AT_location.
[ "AddVariable", "adds", "a", "new", "variable", "entry", "to", "debug_info", ".", "Will", "write", "a", "DW_TAG_variable", "followed", "by", "a", "DW_AT_type", "and", "a", "DW_AT_location", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L249-L255
127,818
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddBaseType
func (b *Builder) AddBaseType(typename string, encoding Encoding, byteSz uint16) dwarf.Offset { r := b.TagOpen(dwarf.TagBaseType, typename) b.Attr(dwarf.AttrEncoding, uint16(encoding)) b.Attr(dwarf.AttrByteSize, byteSz) b.TagClose() return r }
go
func (b *Builder) AddBaseType(typename string, encoding Encoding, byteSz uint16) dwarf.Offset { r := b.TagOpen(dwarf.TagBaseType, typename) b.Attr(dwarf.AttrEncoding, uint16(encoding)) b.Attr(dwarf.AttrByteSize, byteSz) b.TagClose() return r }
[ "func", "(", "b", "*", "Builder", ")", "AddBaseType", "(", "typename", "string", ",", "encoding", "Encoding", ",", "byteSz", "uint16", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagBaseType", ",", "typename", ...
// AddBaseType adds a new base type entry to debug_info. // Will write a DW_TAG_base_type, followed by a DW_AT_encoding and a // DW_AT_byte_size.
[ "AddBaseType", "adds", "a", "new", "base", "type", "entry", "to", "debug_info", ".", "Will", "write", "a", "DW_TAG_base_type", "followed", "by", "a", "DW_AT_encoding", "and", "a", "DW_AT_byte_size", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L260-L266
127,819
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddStructType
func (b *Builder) AddStructType(typename string, byteSz uint16) dwarf.Offset { r := b.TagOpen(dwarf.TagStructType, typename) b.Attr(dwarf.AttrByteSize, byteSz) return r }
go
func (b *Builder) AddStructType(typename string, byteSz uint16) dwarf.Offset { r := b.TagOpen(dwarf.TagStructType, typename) b.Attr(dwarf.AttrByteSize, byteSz) return r }
[ "func", "(", "b", "*", "Builder", ")", "AddStructType", "(", "typename", "string", ",", "byteSz", "uint16", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagStructType", ",", "typename", ")", "\n", "b", ".", "A...
// AddStructType adds a new structure type to debug_info. Call TagClose to // finish adding fields. // Will write a DW_TAG_struct_type, followed by a DW_AT_byte_size.
[ "AddStructType", "adds", "a", "new", "structure", "type", "to", "debug_info", ".", "Call", "TagClose", "to", "finish", "adding", "fields", ".", "Will", "write", "a", "DW_TAG_struct_type", "followed", "by", "a", "DW_AT_byte_size", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L271-L275
127,820
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddMember
func (b *Builder) AddMember(fieldname string, typ dwarf.Offset, memberLoc []byte) dwarf.Offset { r := b.TagOpen(dwarf.TagMember, fieldname) b.Attr(dwarf.AttrType, typ) b.Attr(dwarf.AttrDataMemberLoc, memberLoc) b.TagClose() return r }
go
func (b *Builder) AddMember(fieldname string, typ dwarf.Offset, memberLoc []byte) dwarf.Offset { r := b.TagOpen(dwarf.TagMember, fieldname) b.Attr(dwarf.AttrType, typ) b.Attr(dwarf.AttrDataMemberLoc, memberLoc) b.TagClose() return r }
[ "func", "(", "b", "*", "Builder", ")", "AddMember", "(", "fieldname", "string", ",", "typ", "dwarf", ".", "Offset", ",", "memberLoc", "[", "]", "byte", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagMember", ...
// AddMember adds a new member entry to debug_info. // Writes a DW_TAG_member followed by DW_AT_type and DW_AT_data_member_loc.
[ "AddMember", "adds", "a", "new", "member", "entry", "to", "debug_info", ".", "Writes", "a", "DW_TAG_member", "followed", "by", "DW_AT_type", "and", "DW_AT_data_member_loc", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L279-L285
127,821
go-delve/delve
pkg/dwarf/dwarfbuilder/info.go
AddPointerType
func (b *Builder) AddPointerType(typename string, typ dwarf.Offset) dwarf.Offset { r := b.TagOpen(dwarf.TagPointerType, typename) b.Attr(dwarf.AttrType, typ) b.Attr(godwarf.AttrGoKind, uint8(22)) b.TagClose() return r }
go
func (b *Builder) AddPointerType(typename string, typ dwarf.Offset) dwarf.Offset { r := b.TagOpen(dwarf.TagPointerType, typename) b.Attr(dwarf.AttrType, typ) b.Attr(godwarf.AttrGoKind, uint8(22)) b.TagClose() return r }
[ "func", "(", "b", "*", "Builder", ")", "AddPointerType", "(", "typename", "string", ",", "typ", "dwarf", ".", "Offset", ")", "dwarf", ".", "Offset", "{", "r", ":=", "b", ".", "TagOpen", "(", "dwarf", ".", "TagPointerType", ",", "typename", ")", "\n", ...
// AddPointerType adds a new pointer type to debug_info.
[ "AddPointerType", "adds", "a", "new", "pointer", "type", "to", "debug_info", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/info.go#L288-L294
127,822
go-delve/delve
pkg/proc/native/proc_darwin.go
kill
func (dbp *Process) kill() (err error) { if dbp.exited { return nil } err = sys.Kill(-dbp.pid, sys.SIGKILL) if err != nil { return errors.New("could not deliver signal: " + err.Error()) } for port := range dbp.threads { if C.thread_resume(C.thread_act_t(port)) != C.KERN_SUCCESS { return errors.New("could...
go
func (dbp *Process) kill() (err error) { if dbp.exited { return nil } err = sys.Kill(-dbp.pid, sys.SIGKILL) if err != nil { return errors.New("could not deliver signal: " + err.Error()) } for port := range dbp.threads { if C.thread_resume(C.thread_act_t(port)) != C.KERN_SUCCESS { return errors.New("could...
[ "func", "(", "dbp", "*", "Process", ")", "kill", "(", ")", "(", "err", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "nil", "\n", "}", "\n", "err", "=", "sys", ".", "Kill", "(", "-", "dbp", ".", "pid", ",", "sys", ".", "SIGKIL...
// Kill kills the process.
[ "Kill", "kills", "the", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_darwin.go#L166-L188
127,823
go-delve/delve
pkg/proc/native/proc_darwin.go
stop
func (dbp *Process) stop(trapthread *Thread) (err error) { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } for _, th := range dbp.threads { if !th.Stopped() { if err := th.stop(); err != nil { return dbp.exitGuard(err) } } } ports, err := dbp.waitForStop() if err != nil { return...
go
func (dbp *Process) stop(trapthread *Thread) (err error) { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } for _, th := range dbp.threads { if !th.Stopped() { if err := th.stop(); err != nil { return dbp.exitGuard(err) } } } ports, err := dbp.waitForStop() if err != nil { return...
[ "func", "(", "dbp", "*", "Process", ")", "stop", "(", "trapthread", "*", "Thread", ")", "(", "err", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "&", "proc", ".", "ErrProcessExited", "{", "Pid", ":", "dbp", ".", "Pid", "(", ")", ...
// stop stops all running threads and sets breakpoints
[ "stop", "stops", "all", "running", "threads", "and", "sets", "breakpoints" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc_darwin.go#L427-L456
127,824
go-delve/delve
pkg/dwarf/util/buf.go
Varint
func (b *buf) Varint() (c uint64, bits uint) { for i := 0; i < len(b.data); i++ { byte := b.data[i] c |= uint64(byte&0x7F) << bits bits += 7 if byte&0x80 == 0 { b.off += dwarf.Offset(i + 1) b.data = b.data[i+1:] return c, bits } } return 0, 0 }
go
func (b *buf) Varint() (c uint64, bits uint) { for i := 0; i < len(b.data); i++ { byte := b.data[i] c |= uint64(byte&0x7F) << bits bits += 7 if byte&0x80 == 0 { b.off += dwarf.Offset(i + 1) b.data = b.data[i+1:] return c, bits } } return 0, 0 }
[ "func", "(", "b", "*", "buf", ")", "Varint", "(", ")", "(", "c", "uint64", ",", "bits", "uint", ")", "{", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "b", ".", "data", ")", ";", "i", "++", "{", "byte", ":=", "b", ".", "data", "[", ...
// Read a varint, which is 7 bits per byte, little endian. // the 0x80 bit means read another byte.
[ "Read", "a", "varint", "which", "is", "7", "bits", "per", "byte", "little", "endian", ".", "the", "0x80", "bit", "means", "read", "another", "byte", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/buf.go#L105-L117
127,825
go-delve/delve
pkg/dwarf/util/buf.go
Int
func (b *buf) Int() int64 { ux, bits := b.Varint() x := int64(ux) if x&(1<<(bits-1)) != 0 { x |= -1 << bits } return x }
go
func (b *buf) Int() int64 { ux, bits := b.Varint() x := int64(ux) if x&(1<<(bits-1)) != 0 { x |= -1 << bits } return x }
[ "func", "(", "b", "*", "buf", ")", "Int", "(", ")", "int64", "{", "ux", ",", "bits", ":=", "b", ".", "Varint", "(", ")", "\n", "x", ":=", "int64", "(", "ux", ")", "\n", "if", "x", "&", "(", "1", "<<", "(", "bits", "-", "1", ")", ")", "!...
// Signed int is a sign-extended varint.
[ "Signed", "int", "is", "a", "sign", "-", "extended", "varint", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/buf.go#L126-L133
127,826
go-delve/delve
pkg/dwarf/util/buf.go
AssertEmpty
func (b *buf) AssertEmpty() { if len(b.data) == 0 { return } if len(b.data) > 5 { b.error(fmt.Sprintf("unexpected extra data: %x...", b.data[0:5])) } b.error(fmt.Sprintf("unexpected extra data: %x", b.data)) }
go
func (b *buf) AssertEmpty() { if len(b.data) == 0 { return } if len(b.data) > 5 { b.error(fmt.Sprintf("unexpected extra data: %x...", b.data[0:5])) } b.error(fmt.Sprintf("unexpected extra data: %x", b.data)) }
[ "func", "(", "b", "*", "buf", ")", "AssertEmpty", "(", ")", "{", "if", "len", "(", "b", ".", "data", ")", "==", "0", "{", "return", "\n", "}", "\n", "if", "len", "(", "b", ".", "data", ")", ">", "5", "{", "b", ".", "error", "(", "fmt", "....
// AssertEmpty checks that everything has been read from b.
[ "AssertEmpty", "checks", "that", "everything", "has", "been", "read", "from", "b", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/util/buf.go#L136-L144
127,827
go-delve/delve
service/api/conversions.go
ConvertBreakpoint
func ConvertBreakpoint(bp *proc.Breakpoint) *Breakpoint { b := &Breakpoint{ Name: bp.Name, ID: bp.ID, FunctionName: bp.FunctionName, File: bp.File, Line: bp.Line, Addr: bp.Addr, Tracepoint: bp.Tracepoint, TraceReturn: bp.TraceReturn, Stacktrace: ...
go
func ConvertBreakpoint(bp *proc.Breakpoint) *Breakpoint { b := &Breakpoint{ Name: bp.Name, ID: bp.ID, FunctionName: bp.FunctionName, File: bp.File, Line: bp.Line, Addr: bp.Addr, Tracepoint: bp.Tracepoint, TraceReturn: bp.TraceReturn, Stacktrace: ...
[ "func", "ConvertBreakpoint", "(", "bp", "*", "proc", ".", "Breakpoint", ")", "*", "Breakpoint", "{", "b", ":=", "&", "Breakpoint", "{", "Name", ":", "bp", ".", "Name", ",", "ID", ":", "bp", ".", "ID", ",", "FunctionName", ":", "bp", ".", "FunctionNam...
// ConvertBreakpoint converts from a proc.Breakpoint to // an api.Breakpoint.
[ "ConvertBreakpoint", "converts", "from", "a", "proc", ".", "Breakpoint", "to", "an", "api", ".", "Breakpoint", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L18-L46
127,828
go-delve/delve
service/api/conversions.go
ConvertThread
func ConvertThread(th proc.Thread) *Thread { var ( function *Function file string line int pc uint64 gid int ) loc, err := th.Location() if err == nil { pc = loc.PC file = loc.File line = loc.Line function = ConvertFunction(loc.Fn) } var bp *Breakpoint if b := th.Breakpoin...
go
func ConvertThread(th proc.Thread) *Thread { var ( function *Function file string line int pc uint64 gid int ) loc, err := th.Location() if err == nil { pc = loc.PC file = loc.File line = loc.Line function = ConvertFunction(loc.Fn) } var bp *Breakpoint if b := th.Breakpoin...
[ "func", "ConvertThread", "(", "th", "proc", ".", "Thread", ")", "*", "Thread", "{", "var", "(", "function", "*", "Function", "\n", "file", "string", "\n", "line", "int", "\n", "pc", "uint64", "\n", "gid", "int", "\n", ")", "\n\n", "loc", ",", "err", ...
// ConvertThread converts a proc.Thread into an // api thread.
[ "ConvertThread", "converts", "a", "proc", ".", "Thread", "into", "an", "api", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L50-L86
127,829
go-delve/delve
service/api/conversions.go
ConvertFunction
func ConvertFunction(fn *proc.Function) *Function { if fn == nil { return nil } // fn here used to be a *gosym.Func, the fields Type and GoType below // corresponded to the homonymous field of gosym.Func. Since the contents of // those fields is not documented their value was replaced with 0 when // gosym.Func...
go
func ConvertFunction(fn *proc.Function) *Function { if fn == nil { return nil } // fn here used to be a *gosym.Func, the fields Type and GoType below // corresponded to the homonymous field of gosym.Func. Since the contents of // those fields is not documented their value was replaced with 0 when // gosym.Func...
[ "func", "ConvertFunction", "(", "fn", "*", "proc", ".", "Function", ")", "*", "Function", "{", "if", "fn", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// fn here used to be a *gosym.Func, the fields Type and GoType below", "// corresponded to the homonymous f...
// ConvertFunction converts from gosym.Func to // api.Function.
[ "ConvertFunction", "converts", "from", "gosym", ".", "Func", "to", "api", ".", "Function", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L211-L227
127,830
go-delve/delve
service/api/conversions.go
ConvertGoroutine
func ConvertGoroutine(g *proc.G) *Goroutine { th := g.Thread tid := 0 if th != nil { tid = th.ThreadID() } r := &Goroutine{ ID: g.ID, CurrentLoc: ConvertLocation(g.CurrentLoc), UserCurrentLoc: ConvertLocation(g.UserCurrent()), GoStatementLoc: ConvertLocation(g.Go()), StartLoc: Con...
go
func ConvertGoroutine(g *proc.G) *Goroutine { th := g.Thread tid := 0 if th != nil { tid = th.ThreadID() } r := &Goroutine{ ID: g.ID, CurrentLoc: ConvertLocation(g.CurrentLoc), UserCurrentLoc: ConvertLocation(g.UserCurrent()), GoStatementLoc: ConvertLocation(g.Go()), StartLoc: Con...
[ "func", "ConvertGoroutine", "(", "g", "*", "proc", ".", "G", ")", "*", "Goroutine", "{", "th", ":=", "g", ".", "Thread", "\n", "tid", ":=", "0", "\n", "if", "th", "!=", "nil", "{", "tid", "=", "th", ".", "ThreadID", "(", ")", "\n", "}", "\n", ...
// ConvertGoroutine converts from proc.G to api.Goroutine.
[ "ConvertGoroutine", "converts", "from", "proc", ".", "G", "to", "api", ".", "Goroutine", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L230-L248
127,831
go-delve/delve
service/api/conversions.go
ConvertLocation
func ConvertLocation(loc proc.Location) Location { return Location{ PC: loc.PC, File: loc.File, Line: loc.Line, Function: ConvertFunction(loc.Fn), } }
go
func ConvertLocation(loc proc.Location) Location { return Location{ PC: loc.PC, File: loc.File, Line: loc.Line, Function: ConvertFunction(loc.Fn), } }
[ "func", "ConvertLocation", "(", "loc", "proc", ".", "Location", ")", "Location", "{", "return", "Location", "{", "PC", ":", "loc", ".", "PC", ",", "File", ":", "loc", ".", "File", ",", "Line", ":", "loc", ".", "Line", ",", "Function", ":", "ConvertFu...
// ConvertLocation converts from proc.Location to api.Location.
[ "ConvertLocation", "converts", "from", "proc", ".", "Location", "to", "api", ".", "Location", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L251-L258
127,832
go-delve/delve
service/api/conversions.go
ConvertAsmInstruction
func ConvertAsmInstruction(inst proc.AsmInstruction, text string) AsmInstruction { var destloc *Location if inst.DestLoc != nil { r := ConvertLocation(*inst.DestLoc) destloc = &r } return AsmInstruction{ Loc: ConvertLocation(inst.Loc), DestLoc: destloc, Text: text, Bytes: inst.Bytes...
go
func ConvertAsmInstruction(inst proc.AsmInstruction, text string) AsmInstruction { var destloc *Location if inst.DestLoc != nil { r := ConvertLocation(*inst.DestLoc) destloc = &r } return AsmInstruction{ Loc: ConvertLocation(inst.Loc), DestLoc: destloc, Text: text, Bytes: inst.Bytes...
[ "func", "ConvertAsmInstruction", "(", "inst", "proc", ".", "AsmInstruction", ",", "text", "string", ")", "AsmInstruction", "{", "var", "destloc", "*", "Location", "\n", "if", "inst", ".", "DestLoc", "!=", "nil", "{", "r", ":=", "ConvertLocation", "(", "*", ...
// ConvertAsmInstruction converts from proc.AsmInstruction to api.AsmInstruction.
[ "ConvertAsmInstruction", "converts", "from", "proc", ".", "AsmInstruction", "to", "api", ".", "AsmInstruction", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L261-L275
127,833
go-delve/delve
service/api/conversions.go
LoadConfigFromProc
func LoadConfigFromProc(cfg *proc.LoadConfig) *LoadConfig { if cfg == nil { return nil } return &LoadConfig{ cfg.FollowPointers, cfg.MaxVariableRecurse, cfg.MaxStringLen, cfg.MaxArrayValues, cfg.MaxStructFields, } }
go
func LoadConfigFromProc(cfg *proc.LoadConfig) *LoadConfig { if cfg == nil { return nil } return &LoadConfig{ cfg.FollowPointers, cfg.MaxVariableRecurse, cfg.MaxStringLen, cfg.MaxArrayValues, cfg.MaxStructFields, } }
[ "func", "LoadConfigFromProc", "(", "cfg", "*", "proc", ".", "LoadConfig", ")", "*", "LoadConfig", "{", "if", "cfg", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "&", "LoadConfig", "{", "cfg", ".", "FollowPointers", ",", "cfg", ".", "Ma...
// LoadConfigFromProc converts a proc.LoadConfig to api.LoadConfig.
[ "LoadConfigFromProc", "converts", "a", "proc", ".", "LoadConfig", "to", "api", ".", "LoadConfig", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L293-L304
127,834
go-delve/delve
service/api/conversions.go
ConvertRegisters
func ConvertRegisters(in []proc.Register) (out []Register) { out = make([]Register, len(in)) for i := range in { out[i] = Register{in[i].Name, in[i].Value} } return }
go
func ConvertRegisters(in []proc.Register) (out []Register) { out = make([]Register, len(in)) for i := range in { out[i] = Register{in[i].Name, in[i].Value} } return }
[ "func", "ConvertRegisters", "(", "in", "[", "]", "proc", ".", "Register", ")", "(", "out", "[", "]", "Register", ")", "{", "out", "=", "make", "(", "[", "]", "Register", ",", "len", "(", "in", ")", ")", "\n", "for", "i", ":=", "range", "in", "{...
// ConvertRegisters converts proc.Register to api.Register for a slice.
[ "ConvertRegisters", "converts", "proc", ".", "Register", "to", "api", ".", "Register", "for", "a", "slice", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/api/conversions.go#L307-L313
127,835
go-delve/delve
_fixtures/issue406.go
String
func (b Blacklist) String() (result string) { // cols, _, _ := terminal.GetSize(int(os.Stdout.Fd())) cols := 20 for pkey := range b { result += fmt.Sprintf("Node: %v\n\tDisabled: %v\n", pkey, b[pkey].Disable) result += fmt.Sprintf("\tRedirect IP: %v\n\tExclude(s):\n", b[pkey].IP) for _, exclude := range b[pkey...
go
func (b Blacklist) String() (result string) { // cols, _, _ := terminal.GetSize(int(os.Stdout.Fd())) cols := 20 for pkey := range b { result += fmt.Sprintf("Node: %v\n\tDisabled: %v\n", pkey, b[pkey].Disable) result += fmt.Sprintf("\tRedirect IP: %v\n\tExclude(s):\n", b[pkey].IP) for _, exclude := range b[pkey...
[ "func", "(", "b", "Blacklist", ")", "String", "(", ")", "(", "result", "string", ")", "{", "//\tcols, _, _ := terminal.GetSize(int(os.Stdout.Fd()))", "cols", ":=", "20", "\n", "for", "pkey", ":=", "range", "b", "{", "result", "+=", "fmt", ".", "Sprintf", "("...
// String returns pretty print for the Blacklist struct
[ "String", "returns", "pretty", "print", "for", "the", "Blacklist", "struct" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/_fixtures/issue406.go#L35-L56
127,836
go-delve/delve
service/rpc2/client.go
NewClient
func NewClient(addr string) *RPCClient { client, err := jsonrpc.Dial("tcp", addr) if err != nil { log.Fatal("dialing:", err) } return newFromRPCClient(client) }
go
func NewClient(addr string) *RPCClient { client, err := jsonrpc.Dial("tcp", addr) if err != nil { log.Fatal("dialing:", err) } return newFromRPCClient(client) }
[ "func", "NewClient", "(", "addr", "string", ")", "*", "RPCClient", "{", "client", ",", "err", ":=", "jsonrpc", ".", "Dial", "(", "\"", "\"", ",", "addr", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Fatal", "(", "\"", "\"", ",", "err", ...
// NewClient creates a new RPCClient.
[ "NewClient", "creates", "a", "new", "RPCClient", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L26-L32
127,837
go-delve/delve
service/rpc2/client.go
Recorded
func (c *RPCClient) Recorded() bool { out := new(RecordedOut) c.call("Recorded", RecordedIn{}, out) return out.Recorded }
go
func (c *RPCClient) Recorded() bool { out := new(RecordedOut) c.call("Recorded", RecordedIn{}, out) return out.Recorded }
[ "func", "(", "c", "*", "RPCClient", ")", "Recorded", "(", ")", "bool", "{", "out", ":=", "new", "(", "RecordedOut", ")", "\n", "c", ".", "call", "(", "\"", "\"", ",", "RecordedIn", "{", "}", ",", "out", ")", "\n", "return", "out", ".", "Recorded"...
// Recorded returns true if the debugger target is a recording.
[ "Recorded", "returns", "true", "if", "the", "debugger", "target", "is", "a", "recording", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L346-L350
127,838
go-delve/delve
service/rpc2/client.go
TraceDirectory
func (c *RPCClient) TraceDirectory() (string, error) { var out RecordedOut err := c.call("Recorded", RecordedIn{}, &out) return out.TraceDirectory, err }
go
func (c *RPCClient) TraceDirectory() (string, error) { var out RecordedOut err := c.call("Recorded", RecordedIn{}, &out) return out.TraceDirectory, err }
[ "func", "(", "c", "*", "RPCClient", ")", "TraceDirectory", "(", ")", "(", "string", ",", "error", ")", "{", "var", "out", "RecordedOut", "\n", "err", ":=", "c", ".", "call", "(", "\"", "\"", ",", "RecordedIn", "{", "}", ",", "&", "out", ")", "\n"...
// TraceDirectory returns the path to the trace directory for a recording.
[ "TraceDirectory", "returns", "the", "path", "to", "the", "trace", "directory", "for", "a", "recording", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L353-L357
127,839
go-delve/delve
service/rpc2/client.go
Checkpoint
func (c *RPCClient) Checkpoint(where string) (checkpointID int, err error) { var out CheckpointOut err = c.call("Checkpoint", CheckpointIn{where}, &out) return out.ID, err }
go
func (c *RPCClient) Checkpoint(where string) (checkpointID int, err error) { var out CheckpointOut err = c.call("Checkpoint", CheckpointIn{where}, &out) return out.ID, err }
[ "func", "(", "c", "*", "RPCClient", ")", "Checkpoint", "(", "where", "string", ")", "(", "checkpointID", "int", ",", "err", "error", ")", "{", "var", "out", "CheckpointOut", "\n", "err", "=", "c", ".", "call", "(", "\"", "\"", ",", "CheckpointIn", "{...
// Checkpoint sets a checkpoint at the current position.
[ "Checkpoint", "sets", "a", "checkpoint", "at", "the", "current", "position", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L360-L364
127,840
go-delve/delve
service/rpc2/client.go
ListCheckpoints
func (c *RPCClient) ListCheckpoints() ([]api.Checkpoint, error) { var out ListCheckpointsOut err := c.call("ListCheckpoints", ListCheckpointsIn{}, &out) return out.Checkpoints, err }
go
func (c *RPCClient) ListCheckpoints() ([]api.Checkpoint, error) { var out ListCheckpointsOut err := c.call("ListCheckpoints", ListCheckpointsIn{}, &out) return out.Checkpoints, err }
[ "func", "(", "c", "*", "RPCClient", ")", "ListCheckpoints", "(", ")", "(", "[", "]", "api", ".", "Checkpoint", ",", "error", ")", "{", "var", "out", "ListCheckpointsOut", "\n", "err", ":=", "c", ".", "call", "(", "\"", "\"", ",", "ListCheckpointsIn", ...
// ListCheckpoints gets all checkpoints.
[ "ListCheckpoints", "gets", "all", "checkpoints", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L367-L371
127,841
go-delve/delve
service/rpc2/client.go
ClearCheckpoint
func (c *RPCClient) ClearCheckpoint(id int) error { var out ClearCheckpointOut err := c.call("ClearCheckpoint", ClearCheckpointIn{id}, &out) return err }
go
func (c *RPCClient) ClearCheckpoint(id int) error { var out ClearCheckpointOut err := c.call("ClearCheckpoint", ClearCheckpointIn{id}, &out) return err }
[ "func", "(", "c", "*", "RPCClient", ")", "ClearCheckpoint", "(", "id", "int", ")", "error", "{", "var", "out", "ClearCheckpointOut", "\n", "err", ":=", "c", ".", "call", "(", "\"", "\"", ",", "ClearCheckpointIn", "{", "id", "}", ",", "&", "out", ")",...
// ClearCheckpoint removes a checkpoint
[ "ClearCheckpoint", "removes", "a", "checkpoint" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/client.go#L374-L378
127,842
go-delve/delve
pkg/proc/fncall.go
writePointer
func writePointer(bi *BinaryInfo, mem MemoryReadWriter, addr, val uint64) error { ptrbuf := make([]byte, bi.Arch.PtrSize()) // TODO: use target architecture endianness instead of LittleEndian switch len(ptrbuf) { case 4: binary.LittleEndian.PutUint32(ptrbuf, uint32(val)) case 8: binary.LittleEndian.PutUint64(...
go
func writePointer(bi *BinaryInfo, mem MemoryReadWriter, addr, val uint64) error { ptrbuf := make([]byte, bi.Arch.PtrSize()) // TODO: use target architecture endianness instead of LittleEndian switch len(ptrbuf) { case 4: binary.LittleEndian.PutUint32(ptrbuf, uint32(val)) case 8: binary.LittleEndian.PutUint64(...
[ "func", "writePointer", "(", "bi", "*", "BinaryInfo", ",", "mem", "MemoryReadWriter", ",", "addr", ",", "val", "uint64", ")", "error", "{", "ptrbuf", ":=", "make", "(", "[", "]", "byte", ",", "bi", ".", "Arch", ".", "PtrSize", "(", ")", ")", "\n\n", ...
// writePointer writes val as an architecture pointer at addr in mem.
[ "writePointer", "writes", "val", "as", "an", "architecture", "pointer", "at", "addr", "in", "mem", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/fncall.go#L159-L173
127,843
go-delve/delve
pkg/proc/fncall.go
funcCallEvalExpr
func funcCallEvalExpr(p Process, expr string) (fn *Function, closureAddr uint64, argvars []*Variable, err error) { bi := p.BinInfo() scope, err := GoroutineScope(p.CurrentThread()) if err != nil { return nil, 0, nil, err } t, err := parser.ParseExpr(expr) if err != nil { return nil, 0, nil, err } callexpr,...
go
func funcCallEvalExpr(p Process, expr string) (fn *Function, closureAddr uint64, argvars []*Variable, err error) { bi := p.BinInfo() scope, err := GoroutineScope(p.CurrentThread()) if err != nil { return nil, 0, nil, err } t, err := parser.ParseExpr(expr) if err != nil { return nil, 0, nil, err } callexpr,...
[ "func", "funcCallEvalExpr", "(", "p", "Process", ",", "expr", "string", ")", "(", "fn", "*", "Function", ",", "closureAddr", "uint64", ",", "argvars", "[", "]", "*", "Variable", ",", "err", "error", ")", "{", "bi", ":=", "p", ".", "BinInfo", "(", ")"...
// funcCallEvalExpr evaluates expr, which must be a function call, returns // the function being called and its arguments.
[ "funcCallEvalExpr", "evaluates", "expr", "which", "must", "be", "a", "function", "call", "returns", "the", "function", "being", "called", "and", "its", "arguments", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/fncall.go#L194-L247
127,844
go-delve/delve
pkg/proc/fncall.go
funcCallArgFrame
func funcCallArgFrame(fn *Function, actualArgs []*Variable, g *G, bi *BinaryInfo, checkEscape bool) (argmem []byte, err error) { argFrameSize, formalArgs, err := funcCallArgs(fn, bi, false) if err != nil { return nil, err } if len(actualArgs) > len(formalArgs) { return nil, errTooManyArguments } if len(actual...
go
func funcCallArgFrame(fn *Function, actualArgs []*Variable, g *G, bi *BinaryInfo, checkEscape bool) (argmem []byte, err error) { argFrameSize, formalArgs, err := funcCallArgs(fn, bi, false) if err != nil { return nil, err } if len(actualArgs) > len(formalArgs) { return nil, errTooManyArguments } if len(actual...
[ "func", "funcCallArgFrame", "(", "fn", "*", "Function", ",", "actualArgs", "[", "]", "*", "Variable", ",", "g", "*", "G", ",", "bi", "*", "BinaryInfo", ",", "checkEscape", "bool", ")", "(", "argmem", "[", "]", "byte", ",", "err", "error", ")", "{", ...
// funcCallArgFrame checks type and pointer escaping for the arguments and // returns the argument frame.
[ "funcCallArgFrame", "checks", "type", "and", "pointer", "escaping", "for", "the", "arguments", "and", "returns", "the", "argument", "frame", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/fncall.go#L258-L294
127,845
go-delve/delve
pkg/proc/fncall.go
fakeFunctionEntryScope
func fakeFunctionEntryScope(scope *EvalScope, fn *Function, cfa int64, sp uint64) error { scope.PC = fn.Entry scope.Fn = fn scope.File, scope.Line, _ = scope.BinInfo.PCToLine(fn.Entry) scope.Regs.CFA = cfa scope.Regs.Regs[scope.Regs.SPRegNum].Uint64Val = sp scope.BinInfo.dwarfReader.Seek(fn.offset) e, err := s...
go
func fakeFunctionEntryScope(scope *EvalScope, fn *Function, cfa int64, sp uint64) error { scope.PC = fn.Entry scope.Fn = fn scope.File, scope.Line, _ = scope.BinInfo.PCToLine(fn.Entry) scope.Regs.CFA = cfa scope.Regs.Regs[scope.Regs.SPRegNum].Uint64Val = sp scope.BinInfo.dwarfReader.Seek(fn.offset) e, err := s...
[ "func", "fakeFunctionEntryScope", "(", "scope", "*", "EvalScope", ",", "fn", "*", "Function", ",", "cfa", "int64", ",", "sp", "uint64", ")", "error", "{", "scope", ".", "PC", "=", "fn", ".", "Entry", "\n", "scope", ".", "Fn", "=", "fn", "\n", "scope"...
// fakeEntryScope alters scope to pretend that we are at the entry point of // fn and CFA and SP are the ones passed as argument. // This function is used to create a scope for a call frame that doesn't // exist anymore, to read the return variables of an injected function call, // or after a stepout command.
[ "fakeEntryScope", "alters", "scope", "to", "pretend", "that", "we", "are", "at", "the", "entry", "point", "of", "fn", "and", "CFA", "and", "SP", "are", "the", "ones", "passed", "as", "argument", ".", "This", "function", "is", "used", "to", "create", "a",...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/fncall.go#L543-L558
127,846
go-delve/delve
pkg/proc/core/core.go
Add
func (r *SplicedMemory) Add(reader proc.MemoryReader, off, length uintptr) { if length == 0 { return } end := off + length - 1 newReaders := make([]readerEntry, 0, len(r.readers)) add := func(e readerEntry) { if e.length == 0 { return } newReaders = append(newReaders, e) } inserted := false // Walk t...
go
func (r *SplicedMemory) Add(reader proc.MemoryReader, off, length uintptr) { if length == 0 { return } end := off + length - 1 newReaders := make([]readerEntry, 0, len(r.readers)) add := func(e readerEntry) { if e.length == 0 { return } newReaders = append(newReaders, e) } inserted := false // Walk t...
[ "func", "(", "r", "*", "SplicedMemory", ")", "Add", "(", "reader", "proc", ".", "MemoryReader", ",", "off", ",", "length", "uintptr", ")", "{", "if", "length", "==", "0", "{", "return", "\n", "}", "\n", "end", ":=", "off", "+", "length", "-", "1", ...
// Add adds a new region to the SplicedMemory, which may override existing regions.
[ "Add", "adds", "a", "new", "region", "to", "the", "SplicedMemory", "which", "may", "override", "existing", "regions", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L36-L93
127,847
go-delve/delve
pkg/proc/core/core.go
ReadMemory
func (r *SplicedMemory) ReadMemory(buf []byte, addr uintptr) (n int, err error) { started := false for _, entry := range r.readers { if entry.offset+entry.length < addr { if !started { continue } return n, fmt.Errorf("hit unmapped area at %v after %v bytes", addr, n) } // Don't go past the region....
go
func (r *SplicedMemory) ReadMemory(buf []byte, addr uintptr) (n int, err error) { started := false for _, entry := range r.readers { if entry.offset+entry.length < addr { if !started { continue } return n, fmt.Errorf("hit unmapped area at %v after %v bytes", addr, n) } // Don't go past the region....
[ "func", "(", "r", "*", "SplicedMemory", ")", "ReadMemory", "(", "buf", "[", "]", "byte", ",", "addr", "uintptr", ")", "(", "n", "int", ",", "err", "error", ")", "{", "started", ":=", "false", "\n", "for", "_", ",", "entry", ":=", "range", "r", "....
// ReadMemory implements MemoryReader.ReadMemory.
[ "ReadMemory", "implements", "MemoryReader", ".", "ReadMemory", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L96-L127
127,848
go-delve/delve
pkg/proc/core/core.go
ReadMemory
func (r *OffsetReaderAt) ReadMemory(buf []byte, addr uintptr) (n int, err error) { return r.reader.ReadAt(buf, int64(addr-r.offset)) }
go
func (r *OffsetReaderAt) ReadMemory(buf []byte, addr uintptr) (n int, err error) { return r.reader.ReadAt(buf, int64(addr-r.offset)) }
[ "func", "(", "r", "*", "OffsetReaderAt", ")", "ReadMemory", "(", "buf", "[", "]", "byte", ",", "addr", "uintptr", ")", "(", "n", "int", ",", "err", "error", ")", "{", "return", "r", ".", "reader", ".", "ReadAt", "(", "buf", ",", "int64", "(", "ad...
// ReadMemory will read the memory at addr-offset.
[ "ReadMemory", "will", "read", "the", "memory", "at", "addr", "-", "offset", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L140-L142
127,849
go-delve/delve
pkg/proc/core/core.go
OpenCore
func OpenCore(corePath, exePath string, debugInfoDirs []string) (*Process, error) { var p *Process var err error for _, openFn := range openFns { p, err = openFn(corePath, exePath) if err != ErrUnrecognizedFormat { break } } if err != nil { return nil, err } if err := p.initialize(exePath, debugInfoD...
go
func OpenCore(corePath, exePath string, debugInfoDirs []string) (*Process, error) { var p *Process var err error for _, openFn := range openFns { p, err = openFn(corePath, exePath) if err != ErrUnrecognizedFormat { break } } if err != nil { return nil, err } if err := p.initialize(exePath, debugInfoD...
[ "func", "OpenCore", "(", "corePath", ",", "exePath", "string", ",", "debugInfoDirs", "[", "]", "string", ")", "(", "*", "Process", ",", "error", ")", "{", "var", "p", "*", "Process", "\n", "var", "err", "error", "\n", "for", "_", ",", "openFn", ":=",...
// OpenCore will open the core file and return a Process struct. // If the DWARF information cannot be found in the binary, Delve will look // for external debug files in the directories passed in.
[ "OpenCore", "will", "open", "the", "core", "file", "and", "return", "a", "Process", "struct", ".", "If", "the", "DWARF", "information", "cannot", "be", "found", "in", "the", "binary", "Delve", "will", "look", "for", "external", "debug", "files", "in", "the...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L197-L215
127,850
go-delve/delve
pkg/proc/core/core.go
initialize
func (p *Process) initialize(path string, debugInfoDirs []string) error { return proc.PostInitializationSetup(p, path, debugInfoDirs, p.writeBreakpoint) }
go
func (p *Process) initialize(path string, debugInfoDirs []string) error { return proc.PostInitializationSetup(p, path, debugInfoDirs, p.writeBreakpoint) }
[ "func", "(", "p", "*", "Process", ")", "initialize", "(", "path", "string", ",", "debugInfoDirs", "[", "]", "string", ")", "error", "{", "return", "proc", ".", "PostInitializationSetup", "(", "p", ",", "path", ",", "debugInfoDirs", ",", "p", ".", "writeB...
// initialize for core files doesn't do much // aside from call the post initialization setup.
[ "initialize", "for", "core", "files", "doesn", "t", "do", "much", "aside", "from", "call", "the", "post", "initialization", "setup", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L219-L221
127,851
go-delve/delve
pkg/proc/core/core.go
writeBreakpoint
func (p *Process) writeBreakpoint(addr uint64) (file string, line int, fn *proc.Function, originalData []byte, err error) { return "", 0, nil, nil, errors.New("cannot write a breakpoint to a core file") }
go
func (p *Process) writeBreakpoint(addr uint64) (file string, line int, fn *proc.Function, originalData []byte, err error) { return "", 0, nil, nil, errors.New("cannot write a breakpoint to a core file") }
[ "func", "(", "p", "*", "Process", ")", "writeBreakpoint", "(", "addr", "uint64", ")", "(", "file", "string", ",", "line", "int", ",", "fn", "*", "proc", ".", "Function", ",", "originalData", "[", "]", "byte", ",", "err", "error", ")", "{", "return", ...
// writeBreakpoint is a noop function since you // cannot write breakpoints into core files.
[ "writeBreakpoint", "is", "a", "noop", "function", "since", "you", "cannot", "write", "breakpoints", "into", "core", "files", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L242-L244
127,852
go-delve/delve
pkg/proc/core/core.go
ReadMemory
func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error) { n, err = t.p.mem.ReadMemory(data, addr) if err == nil && n != len(data) { err = ErrShortRead } return n, err }
go
func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error) { n, err = t.p.mem.ReadMemory(data, addr) if err == nil && n != len(data) { err = ErrShortRead } return n, err }
[ "func", "(", "t", "*", "Thread", ")", "ReadMemory", "(", "data", "[", "]", "byte", ",", "addr", "uintptr", ")", "(", "n", "int", ",", "err", "error", ")", "{", "n", ",", "err", "=", "t", ".", "p", ".", "mem", ".", "ReadMemory", "(", "data", "...
// ReadMemory will return memory from the core file at the specified location and put the // read memory into `data`, returning the length read, and returning an error if // the length read is shorter than the length of the `data` buffer.
[ "ReadMemory", "will", "return", "memory", "from", "the", "core", "file", "at", "the", "specified", "location", "and", "put", "the", "read", "memory", "into", "data", "returning", "the", "length", "read", "and", "returning", "an", "error", "if", "the", "lengt...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L270-L276
127,853
go-delve/delve
pkg/proc/core/core.go
WriteMemory
func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) { return 0, ErrWriteCore }
go
func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) { return 0, ErrWriteCore }
[ "func", "(", "t", "*", "Thread", ")", "WriteMemory", "(", "addr", "uintptr", ",", "data", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "return", "0", ",", "ErrWriteCore", "\n", "}" ]
// WriteMemory will only return an error for core files, you cannot write // to the memory of a core process.
[ "WriteMemory", "will", "only", "return", "an", "error", "for", "core", "files", "you", "cannot", "write", "to", "the", "memory", "of", "a", "core", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L280-L282
127,854
go-delve/delve
pkg/proc/core/core.go
Location
func (t *Thread) Location() (*proc.Location, error) { regs, err := t.th.registers(false) if err != nil { return nil, err } pc := regs.PC() f, l, fn := t.p.bi.PCToLine(pc) return &proc.Location{PC: pc, File: f, Line: l, Fn: fn}, nil }
go
func (t *Thread) Location() (*proc.Location, error) { regs, err := t.th.registers(false) if err != nil { return nil, err } pc := regs.PC() f, l, fn := t.p.bi.PCToLine(pc) return &proc.Location{PC: pc, File: f, Line: l, Fn: fn}, nil }
[ "func", "(", "t", "*", "Thread", ")", "Location", "(", ")", "(", "*", "proc", ".", "Location", ",", "error", ")", "{", "regs", ",", "err", ":=", "t", ".", "th", ".", "registers", "(", "false", ")", "\n", "if", "err", "!=", "nil", "{", "return",...
// Location returns the location of this thread based on // the value of the instruction pointer register.
[ "Location", "returns", "the", "location", "of", "this", "thread", "based", "on", "the", "value", "of", "the", "instruction", "pointer", "register", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L286-L294
127,855
go-delve/delve
pkg/proc/core/core.go
Registers
func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) { return t.th.registers(floatingPoint) }
go
func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) { return t.th.registers(floatingPoint) }
[ "func", "(", "t", "*", "Thread", ")", "Registers", "(", "floatingPoint", "bool", ")", "(", "proc", ".", "Registers", ",", "error", ")", "{", "return", "t", ".", "th", ".", "registers", "(", "floatingPoint", ")", "\n", "}" ]
// Registers returns the current value of the registers for this thread.
[ "Registers", "returns", "the", "current", "value", "of", "the", "registers", "for", "this", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L309-L311
127,856
go-delve/delve
pkg/proc/core/core.go
ClearBreakpoint
func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) { return nil, proc.NoBreakpointError{Addr: addr} }
go
func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) { return nil, proc.NoBreakpointError{Addr: addr} }
[ "func", "(", "p", "*", "Process", ")", "ClearBreakpoint", "(", "addr", "uint64", ")", "(", "*", "proc", ".", "Breakpoint", ",", "error", ")", "{", "return", "nil", ",", "proc", ".", "NoBreakpointError", "{", "Addr", ":", "addr", "}", "\n", "}" ]
// ClearBreakpoint will always return an error as you cannot set or clear // breakpoints on core files.
[ "ClearBreakpoint", "will", "always", "return", "an", "error", "as", "you", "cannot", "set", "or", "clear", "breakpoints", "on", "core", "files", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L378-L380
127,857
go-delve/delve
pkg/proc/core/core.go
SetBreakpoint
func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) { return nil, ErrWriteCore }
go
func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) { return nil, ErrWriteCore }
[ "func", "(", "p", "*", "Process", ")", "SetBreakpoint", "(", "addr", "uint64", ",", "kind", "proc", ".", "BreakpointKind", ",", "cond", "ast", ".", "Expr", ")", "(", "*", "proc", ".", "Breakpoint", ",", "error", ")", "{", "return", "nil", ",", "ErrWr...
// SetBreakpoint will always return an error for core files as you cannot write memory or control execution.
[ "SetBreakpoint", "will", "always", "return", "an", "error", "for", "core", "files", "as", "you", "cannot", "write", "memory", "or", "control", "execution", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L454-L456
127,858
go-delve/delve
pkg/proc/core/core.go
SwitchThread
func (p *Process) SwitchThread(tid int) error { if th, ok := p.Threads[tid]; ok { p.currentThread = th p.selectedGoroutine, _ = proc.GetG(p.CurrentThread()) return nil } return fmt.Errorf("thread %d does not exist", tid) }
go
func (p *Process) SwitchThread(tid int) error { if th, ok := p.Threads[tid]; ok { p.currentThread = th p.selectedGoroutine, _ = proc.GetG(p.CurrentThread()) return nil } return fmt.Errorf("thread %d does not exist", tid) }
[ "func", "(", "p", "*", "Process", ")", "SwitchThread", "(", "tid", "int", ")", "error", "{", "if", "th", ",", "ok", ":=", "p", ".", "Threads", "[", "tid", "]", ";", "ok", "{", "p", ".", "currentThread", "=", "th", "\n", "p", ".", "selectedGorouti...
// SwitchThread will change the selected and active thread.
[ "SwitchThread", "will", "change", "the", "selected", "and", "active", "thread", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L476-L483
127,859
go-delve/delve
pkg/proc/core/core.go
ThreadList
func (p *Process) ThreadList() []proc.Thread { r := make([]proc.Thread, 0, len(p.Threads)) for _, v := range p.Threads { r = append(r, v) } return r }
go
func (p *Process) ThreadList() []proc.Thread { r := make([]proc.Thread, 0, len(p.Threads)) for _, v := range p.Threads { r = append(r, v) } return r }
[ "func", "(", "p", "*", "Process", ")", "ThreadList", "(", ")", "[", "]", "proc", ".", "Thread", "{", "r", ":=", "make", "(", "[", "]", "proc", ".", "Thread", ",", "0", ",", "len", "(", "p", ".", "Threads", ")", ")", "\n", "for", "_", ",", "...
// ThreadList will return a list of all threads currently in the process.
[ "ThreadList", "will", "return", "a", "list", "of", "all", "threads", "currently", "in", "the", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L486-L492
127,860
go-delve/delve
pkg/proc/core/core.go
FindThread
func (p *Process) FindThread(threadID int) (proc.Thread, bool) { t, ok := p.Threads[threadID] return t, ok }
go
func (p *Process) FindThread(threadID int) (proc.Thread, bool) { t, ok := p.Threads[threadID] return t, ok }
[ "func", "(", "p", "*", "Process", ")", "FindThread", "(", "threadID", "int", ")", "(", "proc", ".", "Thread", ",", "bool", ")", "{", "t", ",", "ok", ":=", "p", ".", "Threads", "[", "threadID", "]", "\n", "return", "t", ",", "ok", "\n", "}" ]
// FindThread will return the thread with the corresponding thread ID.
[ "FindThread", "will", "return", "the", "thread", "with", "the", "corresponding", "thread", "ID", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/core/core.go#L495-L498
127,861
go-delve/delve
pkg/proc/disasm_amd64.go
patchPCRel
func patchPCRel(pc uint64, inst *x86asm.Inst) { for i := range inst.Args { rel, isrel := inst.Args[i].(x86asm.Rel) if isrel { inst.Args[i] = x86asm.Imm(int64(pc) + int64(rel) + int64(inst.Len)) } } }
go
func patchPCRel(pc uint64, inst *x86asm.Inst) { for i := range inst.Args { rel, isrel := inst.Args[i].(x86asm.Rel) if isrel { inst.Args[i] = x86asm.Imm(int64(pc) + int64(rel) + int64(inst.Len)) } } }
[ "func", "patchPCRel", "(", "pc", "uint64", ",", "inst", "*", "x86asm", ".", "Inst", ")", "{", "for", "i", ":=", "range", "inst", ".", "Args", "{", "rel", ",", "isrel", ":=", "inst", ".", "Args", "[", "i", "]", ".", "(", "x86asm", ".", "Rel", ")...
// converts PC relative arguments to absolute addresses
[ "converts", "PC", "relative", "arguments", "to", "absolute", "addresses" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm_amd64.go#L28-L35
127,862
go-delve/delve
pkg/proc/disasm_amd64.go
Text
func (inst *AsmInstruction) Text(flavour AssemblyFlavour, bi *BinaryInfo) string { if inst.Inst == nil { return "?" } var text string switch flavour { case GNUFlavour: text = x86asm.GNUSyntax(x86asm.Inst(*inst.Inst), inst.Loc.PC, bi.symLookup) case GoFlavour: text = x86asm.GoSyntax(x86asm.Inst(*inst.Inst)...
go
func (inst *AsmInstruction) Text(flavour AssemblyFlavour, bi *BinaryInfo) string { if inst.Inst == nil { return "?" } var text string switch flavour { case GNUFlavour: text = x86asm.GNUSyntax(x86asm.Inst(*inst.Inst), inst.Loc.PC, bi.symLookup) case GoFlavour: text = x86asm.GoSyntax(x86asm.Inst(*inst.Inst)...
[ "func", "(", "inst", "*", "AsmInstruction", ")", "Text", "(", "flavour", "AssemblyFlavour", ",", "bi", "*", "BinaryInfo", ")", "string", "{", "if", "inst", ".", "Inst", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n\n", "var", "text", "string",...
// Text will return the assembly instructions in human readable format according to // the flavour specified.
[ "Text", "will", "return", "the", "assembly", "instructions", "in", "human", "readable", "format", "according", "to", "the", "flavour", "specified", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm_amd64.go#L39-L58
127,863
go-delve/delve
pkg/proc/disasm_amd64.go
IsCall
func (inst *AsmInstruction) IsCall() bool { if inst.Inst == nil { return false } return inst.Inst.Op == x86asm.CALL || inst.Inst.Op == x86asm.LCALL }
go
func (inst *AsmInstruction) IsCall() bool { if inst.Inst == nil { return false } return inst.Inst.Op == x86asm.CALL || inst.Inst.Op == x86asm.LCALL }
[ "func", "(", "inst", "*", "AsmInstruction", ")", "IsCall", "(", ")", "bool", "{", "if", "inst", ".", "Inst", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "inst", ".", "Inst", ".", "Op", "==", "x86asm", ".", "CALL", "||", "inst", ...
// IsCall returns true if the instruction is a CALL or LCALL instruction.
[ "IsCall", "returns", "true", "if", "the", "instruction", "is", "a", "CALL", "or", "LCALL", "instruction", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm_amd64.go#L61-L66
127,864
go-delve/delve
pkg/proc/disasm_amd64.go
IsRet
func (inst *AsmInstruction) IsRet() bool { if inst.Inst == nil { return false } return inst.Inst.Op == x86asm.RET || inst.Inst.Op == x86asm.LRET }
go
func (inst *AsmInstruction) IsRet() bool { if inst.Inst == nil { return false } return inst.Inst.Op == x86asm.RET || inst.Inst.Op == x86asm.LRET }
[ "func", "(", "inst", "*", "AsmInstruction", ")", "IsRet", "(", ")", "bool", "{", "if", "inst", ".", "Inst", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "inst", ".", "Inst", ".", "Op", "==", "x86asm", ".", "RET", "||", "inst", ...
// IsRet returns true if the instruction is a RET or LRET instruction.
[ "IsRet", "returns", "true", "if", "the", "instruction", "is", "a", "RET", "or", "LRET", "instruction", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm_amd64.go#L69-L74
127,865
go-delve/delve
pkg/proc/disasm_amd64.go
firstPCAfterPrologueDisassembly
func firstPCAfterPrologueDisassembly(p Process, fn *Function, sameline bool) (uint64, error) { var mem MemoryReadWriter = p.CurrentThread() breakpoints := p.Breakpoints() bi := p.BinInfo() text, err := disassemble(mem, nil, breakpoints, bi, fn.Entry, fn.End, false) if err != nil { return fn.Entry, err } if le...
go
func firstPCAfterPrologueDisassembly(p Process, fn *Function, sameline bool) (uint64, error) { var mem MemoryReadWriter = p.CurrentThread() breakpoints := p.Breakpoints() bi := p.BinInfo() text, err := disassemble(mem, nil, breakpoints, bi, fn.Entry, fn.End, false) if err != nil { return fn.Entry, err } if le...
[ "func", "firstPCAfterPrologueDisassembly", "(", "p", "Process", ",", "fn", "*", "Function", ",", "sameline", "bool", ")", "(", "uint64", ",", "error", ")", "{", "var", "mem", "MemoryReadWriter", "=", "p", ".", "CurrentThread", "(", ")", "\n", "breakpoints", ...
// firstPCAfterPrologueDisassembly returns the address of the first // instruction after the prologue for function fn by disassembling fn and // matching the instructions against known split-stack prologue patterns. // If sameline is set firstPCAfterPrologueDisassembly will always return an // address associated with t...
[ "firstPCAfterPrologueDisassembly", "returns", "the", "address", "of", "the", "first", "instruction", "after", "the", "prologue", "for", "function", "fn", "by", "disassembling", "fn", "and", "matching", "the", "instructions", "against", "known", "split", "-", "stack"...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm_amd64.go#L158-L187
127,866
go-delve/delve
service/rpccommon/server.go
NewServer
func NewServer(config *service.Config) *ServerImpl { logger := logflags.RPCLogger() if config.APIVersion < 2 { logger.Info("Using API v1") } if config.Foreground { // Print listener address logflags.WriteAPIListeningMessage(config.Listener.Addr().String()) } return &ServerImpl{ config: config, listene...
go
func NewServer(config *service.Config) *ServerImpl { logger := logflags.RPCLogger() if config.APIVersion < 2 { logger.Info("Using API v1") } if config.Foreground { // Print listener address logflags.WriteAPIListeningMessage(config.Listener.Addr().String()) } return &ServerImpl{ config: config, listene...
[ "func", "NewServer", "(", "config", "*", "service", ".", "Config", ")", "*", "ServerImpl", "{", "logger", ":=", "logflags", ".", "RPCLogger", "(", ")", "\n", "if", "config", ".", "APIVersion", "<", "2", "{", "logger", ".", "Info", "(", "\"", "\"", ")...
// NewServer creates a new RPCServer.
[ "NewServer", "creates", "a", "new", "RPCServer", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L69-L84
127,867
go-delve/delve
service/rpccommon/server.go
Stop
func (s *ServerImpl) Stop() error { if s.config.AcceptMulti { close(s.stopChan) s.listener.Close() } kill := s.config.AttachPid == 0 return s.debugger.Detach(kill) }
go
func (s *ServerImpl) Stop() error { if s.config.AcceptMulti { close(s.stopChan) s.listener.Close() } kill := s.config.AttachPid == 0 return s.debugger.Detach(kill) }
[ "func", "(", "s", "*", "ServerImpl", ")", "Stop", "(", ")", "error", "{", "if", "s", ".", "config", ".", "AcceptMulti", "{", "close", "(", "s", ".", "stopChan", ")", "\n", "s", ".", "listener", ".", "Close", "(", ")", "\n", "}", "\n", "kill", "...
// Stop stops the JSON-RPC server.
[ "Stop", "stops", "the", "JSON", "-", "RPC", "server", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L87-L94
127,868
go-delve/delve
service/rpccommon/server.go
Restart
func (s *ServerImpl) Restart() error { if s.config.AttachPid != 0 { return errors.New("cannot restart process Delve did not create") } return s.s2.Restart(rpc2.RestartIn{}, nil) }
go
func (s *ServerImpl) Restart() error { if s.config.AttachPid != 0 { return errors.New("cannot restart process Delve did not create") } return s.s2.Restart(rpc2.RestartIn{}, nil) }
[ "func", "(", "s", "*", "ServerImpl", ")", "Restart", "(", ")", "error", "{", "if", "s", ".", "config", ".", "AttachPid", "!=", "0", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "s", ".", "s2", ".", "Rest...
// Restart restarts the debugger.
[ "Restart", "restarts", "the", "debugger", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L97-L102
127,869
go-delve/delve
service/rpccommon/server.go
Run
func (s *ServerImpl) Run() error { var err error if s.config.APIVersion < 2 { s.config.APIVersion = 1 } if s.config.APIVersion > 2 { return fmt.Errorf("unknown API version") } // Create and start the debugger if s.debugger, err = debugger.New(&debugger.Config{ AttachPid: s.config.AttachPid, ...
go
func (s *ServerImpl) Run() error { var err error if s.config.APIVersion < 2 { s.config.APIVersion = 1 } if s.config.APIVersion > 2 { return fmt.Errorf("unknown API version") } // Create and start the debugger if s.debugger, err = debugger.New(&debugger.Config{ AttachPid: s.config.AttachPid, ...
[ "func", "(", "s", "*", "ServerImpl", ")", "Run", "(", ")", "error", "{", "var", "err", "error", "\n\n", "if", "s", ".", "config", ".", "APIVersion", "<", "2", "{", "s", ".", "config", ".", "APIVersion", "=", "1", "\n", "}", "\n", "if", "s", "."...
// Run starts a debugger and exposes it with an HTTP server. The debugger // itself can be stopped with the `detach` API. Run blocks until the HTTP // server stops.
[ "Run", "starts", "a", "debugger", "and", "exposes", "it", "with", "an", "HTTP", "server", ".", "The", "debugger", "itself", "can", "be", "stopped", "with", "the", "detach", "API", ".", "Run", "blocks", "until", "the", "HTTP", "server", "stops", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L107-L165
127,870
go-delve/delve
service/rpccommon/server.go
GetVersion
func (s *RPCServer) GetVersion(args api.GetVersionIn, out *api.GetVersionOut) error { out.DelveVersion = version.DelveVersion.String() out.APIVersion = s.s.config.APIVersion return nil }
go
func (s *RPCServer) GetVersion(args api.GetVersionIn, out *api.GetVersionOut) error { out.DelveVersion = version.DelveVersion.String() out.APIVersion = s.s.config.APIVersion return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "GetVersion", "(", "args", "api", ".", "GetVersionIn", ",", "out", "*", "api", ".", "GetVersionOut", ")", "error", "{", "out", ".", "DelveVersion", "=", "version", ".", "DelveVersion", ".", "String", "(", ")", "...
// GetVersion returns the version of delve as well as the API version // currently served.
[ "GetVersion", "returns", "the", "version", "of", "delve", "as", "well", "as", "the", "API", "version", "currently", "served", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L386-L390
127,871
go-delve/delve
service/rpccommon/server.go
SetApiVersion
func (s *RPCServer) SetApiVersion(args api.SetAPIVersionIn, out *api.SetAPIVersionOut) error { if args.APIVersion < 2 { args.APIVersion = 1 } if args.APIVersion > 2 { return fmt.Errorf("unknown API version") } s.s.config.APIVersion = args.APIVersion return nil }
go
func (s *RPCServer) SetApiVersion(args api.SetAPIVersionIn, out *api.SetAPIVersionOut) error { if args.APIVersion < 2 { args.APIVersion = 1 } if args.APIVersion > 2 { return fmt.Errorf("unknown API version") } s.s.config.APIVersion = args.APIVersion return nil }
[ "func", "(", "s", "*", "RPCServer", ")", "SetApiVersion", "(", "args", "api", ".", "SetAPIVersionIn", ",", "out", "*", "api", ".", "SetAPIVersionOut", ")", "error", "{", "if", "args", ".", "APIVersion", "<", "2", "{", "args", ".", "APIVersion", "=", "1...
// Changes version of the API being served.
[ "Changes", "version", "of", "the", "API", "being", "served", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpccommon/server.go#L393-L402
127,872
go-delve/delve
pkg/proc/native/proc.go
Detach
func (dbp *Process) Detach(kill bool) (err error) { if dbp.exited { return nil } if kill && dbp.childProcess { err := dbp.kill() if err != nil { return err } dbp.bi.Close() return nil } if !kill { // Clean up any breakpoints we've set. for _, bp := range dbp.breakpoints.M { if bp != nil { ...
go
func (dbp *Process) Detach(kill bool) (err error) { if dbp.exited { return nil } if kill && dbp.childProcess { err := dbp.kill() if err != nil { return err } dbp.bi.Close() return nil } if !kill { // Clean up any breakpoints we've set. for _, bp := range dbp.breakpoints.M { if bp != nil { ...
[ "func", "(", "dbp", "*", "Process", ")", "Detach", "(", "kill", "bool", ")", "(", "err", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "nil", "\n", "}", "\n", "if", "kill", "&&", "dbp", ".", "childProcess", "{", "err", ":=", "dbp"...
// Detach from the process being debugged, optionally killing it.
[ "Detach", "from", "the", "process", "being", "debugged", "optionally", "killing", "it", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L97-L132
127,873
go-delve/delve
pkg/proc/native/proc.go
Valid
func (dbp *Process) Valid() (bool, error) { if dbp.detached { return false, &proc.ProcessDetachedError{} } if dbp.exited { return false, &proc.ErrProcessExited{Pid: dbp.Pid()} } return true, nil }
go
func (dbp *Process) Valid() (bool, error) { if dbp.detached { return false, &proc.ProcessDetachedError{} } if dbp.exited { return false, &proc.ErrProcessExited{Pid: dbp.Pid()} } return true, nil }
[ "func", "(", "dbp", "*", "Process", ")", "Valid", "(", ")", "(", "bool", ",", "error", ")", "{", "if", "dbp", ".", "detached", "{", "return", "false", ",", "&", "proc", ".", "ProcessDetachedError", "{", "}", "\n", "}", "\n", "if", "dbp", ".", "ex...
// Valid returns whether the process is still attached to and // has not exited.
[ "Valid", "returns", "whether", "the", "process", "is", "still", "attached", "to", "and", "has", "not", "exited", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L136-L144
127,874
go-delve/delve
pkg/proc/native/proc.go
ThreadList
func (dbp *Process) ThreadList() []proc.Thread { r := make([]proc.Thread, 0, len(dbp.threads)) for _, v := range dbp.threads { r = append(r, v) } return r }
go
func (dbp *Process) ThreadList() []proc.Thread { r := make([]proc.Thread, 0, len(dbp.threads)) for _, v := range dbp.threads { r = append(r, v) } return r }
[ "func", "(", "dbp", "*", "Process", ")", "ThreadList", "(", ")", "[", "]", "proc", ".", "Thread", "{", "r", ":=", "make", "(", "[", "]", "proc", ".", "Thread", ",", "0", ",", "len", "(", "dbp", ".", "threads", ")", ")", "\n", "for", "_", ",",...
// ThreadList returns a list of threads in the process.
[ "ThreadList", "returns", "a", "list", "of", "threads", "in", "the", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L164-L170
127,875
go-delve/delve
pkg/proc/native/proc.go
FindThread
func (dbp *Process) FindThread(threadID int) (proc.Thread, bool) { th, ok := dbp.threads[threadID] return th, ok }
go
func (dbp *Process) FindThread(threadID int) (proc.Thread, bool) { th, ok := dbp.threads[threadID] return th, ok }
[ "func", "(", "dbp", "*", "Process", ")", "FindThread", "(", "threadID", "int", ")", "(", "proc", ".", "Thread", ",", "bool", ")", "{", "th", ",", "ok", ":=", "dbp", ".", "threads", "[", "threadID", "]", "\n", "return", "th", ",", "ok", "\n", "}" ...
// FindThread attempts to find the thread with the specified ID.
[ "FindThread", "attempts", "to", "find", "the", "thread", "with", "the", "specified", "ID", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L173-L176
127,876
go-delve/delve
pkg/proc/native/proc.go
RequestManualStop
func (dbp *Process) RequestManualStop() error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } dbp.stopMu.Lock() defer dbp.stopMu.Unlock() dbp.manualStopRequested = true return dbp.requestManualStop() }
go
func (dbp *Process) RequestManualStop() error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } dbp.stopMu.Lock() defer dbp.stopMu.Unlock() dbp.manualStopRequested = true return dbp.requestManualStop() }
[ "func", "(", "dbp", "*", "Process", ")", "RequestManualStop", "(", ")", "error", "{", "if", "dbp", ".", "exited", "{", "return", "&", "proc", ".", "ErrProcessExited", "{", "Pid", ":", "dbp", ".", "Pid", "(", ")", "}", "\n", "}", "\n", "dbp", ".", ...
// RequestManualStop sets the `halt` flag and // sends SIGSTOP to all threads.
[ "RequestManualStop", "sets", "the", "halt", "flag", "and", "sends", "SIGSTOP", "to", "all", "threads", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L190-L198
127,877
go-delve/delve
pkg/proc/native/proc.go
CheckAndClearManualStopRequest
func (dbp *Process) CheckAndClearManualStopRequest() bool { dbp.stopMu.Lock() defer dbp.stopMu.Unlock() msr := dbp.manualStopRequested dbp.manualStopRequested = false return msr }
go
func (dbp *Process) CheckAndClearManualStopRequest() bool { dbp.stopMu.Lock() defer dbp.stopMu.Unlock() msr := dbp.manualStopRequested dbp.manualStopRequested = false return msr }
[ "func", "(", "dbp", "*", "Process", ")", "CheckAndClearManualStopRequest", "(", ")", "bool", "{", "dbp", ".", "stopMu", ".", "Lock", "(", ")", "\n", "defer", "dbp", ".", "stopMu", ".", "Unlock", "(", ")", "\n\n", "msr", ":=", "dbp", ".", "manualStopReq...
// CheckAndClearManualStopRequest checks if a manual stop has // been requested, and then clears that state.
[ "CheckAndClearManualStopRequest", "checks", "if", "a", "manual", "stop", "has", "been", "requested", "and", "then", "clears", "that", "state", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L202-L210
127,878
go-delve/delve
pkg/proc/native/proc.go
SetBreakpoint
func (dbp *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) { return dbp.breakpoints.Set(addr, kind, cond, dbp.writeBreakpoint) }
go
func (dbp *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) { return dbp.breakpoints.Set(addr, kind, cond, dbp.writeBreakpoint) }
[ "func", "(", "dbp", "*", "Process", ")", "SetBreakpoint", "(", "addr", "uint64", ",", "kind", "proc", ".", "BreakpointKind", ",", "cond", "ast", ".", "Expr", ")", "(", "*", "proc", ".", "Breakpoint", ",", "error", ")", "{", "return", "dbp", ".", "bre...
// SetBreakpoint sets a breakpoint at addr, and stores it in the process wide // break point table.
[ "SetBreakpoint", "sets", "a", "breakpoint", "at", "addr", "and", "stores", "it", "in", "the", "process", "wide", "break", "point", "table", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L229-L231
127,879
go-delve/delve
pkg/proc/native/proc.go
ClearBreakpoint
func (dbp *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) { if dbp.exited { return nil, &proc.ErrProcessExited{Pid: dbp.Pid()} } return dbp.breakpoints.Clear(addr, dbp.currentThread.ClearBreakpoint) }
go
func (dbp *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) { if dbp.exited { return nil, &proc.ErrProcessExited{Pid: dbp.Pid()} } return dbp.breakpoints.Clear(addr, dbp.currentThread.ClearBreakpoint) }
[ "func", "(", "dbp", "*", "Process", ")", "ClearBreakpoint", "(", "addr", "uint64", ")", "(", "*", "proc", ".", "Breakpoint", ",", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "nil", ",", "&", "proc", ".", "ErrProcessExited", "{", "Pi...
// ClearBreakpoint clears the breakpoint at addr.
[ "ClearBreakpoint", "clears", "the", "breakpoint", "at", "addr", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L234-L239
127,880
go-delve/delve
pkg/proc/native/proc.go
ContinueOnce
func (dbp *Process) ContinueOnce() (proc.Thread, error) { if dbp.exited { return nil, &proc.ErrProcessExited{Pid: dbp.Pid()} } if err := dbp.resume(); err != nil { return nil, err } dbp.common.ClearAllGCache() for _, th := range dbp.threads { th.CurrentBreakpoint.Clear() } if dbp.resumeChan != nil { ...
go
func (dbp *Process) ContinueOnce() (proc.Thread, error) { if dbp.exited { return nil, &proc.ErrProcessExited{Pid: dbp.Pid()} } if err := dbp.resume(); err != nil { return nil, err } dbp.common.ClearAllGCache() for _, th := range dbp.threads { th.CurrentBreakpoint.Clear() } if dbp.resumeChan != nil { ...
[ "func", "(", "dbp", "*", "Process", ")", "ContinueOnce", "(", ")", "(", "proc", ".", "Thread", ",", "error", ")", "{", "if", "dbp", ".", "exited", "{", "return", "nil", ",", "&", "proc", ".", "ErrProcessExited", "{", "Pid", ":", "dbp", ".", "Pid", ...
// ContinueOnce will continue the target until it stops. // This could be the result of a breakpoint or signal.
[ "ContinueOnce", "will", "continue", "the", "target", "until", "it", "stops", ".", "This", "could", "be", "the", "result", "of", "a", "breakpoint", "or", "signal", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L243-L270
127,881
go-delve/delve
pkg/proc/native/proc.go
StepInstruction
func (dbp *Process) StepInstruction() (err error) { thread := dbp.currentThread if dbp.selectedGoroutine != nil { if dbp.selectedGoroutine.Thread == nil { // Step called on parked goroutine if _, err := dbp.SetBreakpoint(dbp.selectedGoroutine.PC, proc.NextBreakpoint, proc.SameGoroutineCondition(dbp.selectedGo...
go
func (dbp *Process) StepInstruction() (err error) { thread := dbp.currentThread if dbp.selectedGoroutine != nil { if dbp.selectedGoroutine.Thread == nil { // Step called on parked goroutine if _, err := dbp.SetBreakpoint(dbp.selectedGoroutine.PC, proc.NextBreakpoint, proc.SameGoroutineCondition(dbp.selectedGo...
[ "func", "(", "dbp", "*", "Process", ")", "StepInstruction", "(", ")", "(", "err", "error", ")", "{", "thread", ":=", "dbp", ".", "currentThread", "\n", "if", "dbp", ".", "selectedGoroutine", "!=", "nil", "{", "if", "dbp", ".", "selectedGoroutine", ".", ...
// StepInstruction will continue the current thread for exactly // one instruction. This method affects only the thread // associated with the selected goroutine. All other // threads will remain stopped.
[ "StepInstruction", "will", "continue", "the", "current", "thread", "for", "exactly", "one", "instruction", ".", "This", "method", "affects", "only", "the", "thread", "associated", "with", "the", "selected", "goroutine", ".", "All", "other", "threads", "will", "r...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L276-L305
127,882
go-delve/delve
pkg/proc/native/proc.go
SwitchThread
func (dbp *Process) SwitchThread(tid int) error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } if th, ok := dbp.threads[tid]; ok { dbp.currentThread = th dbp.selectedGoroutine, _ = proc.GetG(dbp.currentThread) return nil } return fmt.Errorf("thread %d does not exist", tid) }
go
func (dbp *Process) SwitchThread(tid int) error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } if th, ok := dbp.threads[tid]; ok { dbp.currentThread = th dbp.selectedGoroutine, _ = proc.GetG(dbp.currentThread) return nil } return fmt.Errorf("thread %d does not exist", tid) }
[ "func", "(", "dbp", "*", "Process", ")", "SwitchThread", "(", "tid", "int", ")", "error", "{", "if", "dbp", ".", "exited", "{", "return", "&", "proc", ".", "ErrProcessExited", "{", "Pid", ":", "dbp", ".", "Pid", "(", ")", "}", "\n", "}", "\n", "i...
// SwitchThread changes from current thread to the thread specified by `tid`.
[ "SwitchThread", "changes", "from", "current", "thread", "to", "the", "thread", "specified", "by", "tid", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L308-L318
127,883
go-delve/delve
pkg/proc/native/proc.go
SwitchGoroutine
func (dbp *Process) SwitchGoroutine(gid int) error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } g, err := proc.FindGoroutine(dbp, gid) if err != nil { return err } if g == nil { // user specified -1 and selectedGoroutine is nil return nil } if g.Thread != nil { return dbp.SwitchTh...
go
func (dbp *Process) SwitchGoroutine(gid int) error { if dbp.exited { return &proc.ErrProcessExited{Pid: dbp.Pid()} } g, err := proc.FindGoroutine(dbp, gid) if err != nil { return err } if g == nil { // user specified -1 and selectedGoroutine is nil return nil } if g.Thread != nil { return dbp.SwitchTh...
[ "func", "(", "dbp", "*", "Process", ")", "SwitchGoroutine", "(", "gid", "int", ")", "error", "{", "if", "dbp", ".", "exited", "{", "return", "&", "proc", ".", "ErrProcessExited", "{", "Pid", ":", "dbp", ".", "Pid", "(", ")", "}", "\n", "}", "\n", ...
// SwitchGoroutine changes from current thread to the thread // running the specified goroutine.
[ "SwitchGoroutine", "changes", "from", "current", "thread", "to", "the", "thread", "running", "the", "specified", "goroutine", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L322-L339
127,884
go-delve/delve
pkg/proc/native/proc.go
FindBreakpoint
func (dbp *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool) { // Check to see if address is past the breakpoint, (i.e. breakpoint was hit). if bp, ok := dbp.breakpoints.M[pc-uint64(dbp.bi.Arch.BreakpointSize())]; ok { return bp, true } // Directly use addr to lookup breakpoint. if bp, ok := dbp.breakp...
go
func (dbp *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool) { // Check to see if address is past the breakpoint, (i.e. breakpoint was hit). if bp, ok := dbp.breakpoints.M[pc-uint64(dbp.bi.Arch.BreakpointSize())]; ok { return bp, true } // Directly use addr to lookup breakpoint. if bp, ok := dbp.breakp...
[ "func", "(", "dbp", "*", "Process", ")", "FindBreakpoint", "(", "pc", "uint64", ")", "(", "*", "proc", ".", "Breakpoint", ",", "bool", ")", "{", "// Check to see if address is past the breakpoint, (i.e. breakpoint was hit).", "if", "bp", ",", "ok", ":=", "dbp", ...
// FindBreakpoint finds the breakpoint for the given pc.
[ "FindBreakpoint", "finds", "the", "breakpoint", "for", "the", "given", "pc", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L342-L352
127,885
go-delve/delve
pkg/proc/native/proc.go
initialize
func (dbp *Process) initialize(path string, debugInfoDirs []string) error { if err := initialize(dbp); err != nil { return err } if err := dbp.updateThreadList(); err != nil { return err } return proc.PostInitializationSetup(dbp, path, debugInfoDirs, dbp.writeBreakpoint) }
go
func (dbp *Process) initialize(path string, debugInfoDirs []string) error { if err := initialize(dbp); err != nil { return err } if err := dbp.updateThreadList(); err != nil { return err } return proc.PostInitializationSetup(dbp, path, debugInfoDirs, dbp.writeBreakpoint) }
[ "func", "(", "dbp", "*", "Process", ")", "initialize", "(", "path", "string", ",", "debugInfoDirs", "[", "]", "string", ")", "error", "{", "if", "err", ":=", "initialize", "(", "dbp", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "...
// initialize will ensure that all relevant information is loaded // so the process is ready to be debugged.
[ "initialize", "will", "ensure", "that", "all", "relevant", "information", "is", "loaded", "so", "the", "process", "is", "ready", "to", "be", "debugged", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L356-L364
127,886
go-delve/delve
pkg/proc/native/proc.go
ClearInternalBreakpoints
func (dbp *Process) ClearInternalBreakpoints() error { return dbp.breakpoints.ClearInternalBreakpoints(func(bp *proc.Breakpoint) error { if err := dbp.currentThread.ClearBreakpoint(bp); err != nil { return err } for _, thread := range dbp.threads { if thread.CurrentBreakpoint.Breakpoint == bp { thread....
go
func (dbp *Process) ClearInternalBreakpoints() error { return dbp.breakpoints.ClearInternalBreakpoints(func(bp *proc.Breakpoint) error { if err := dbp.currentThread.ClearBreakpoint(bp); err != nil { return err } for _, thread := range dbp.threads { if thread.CurrentBreakpoint.Breakpoint == bp { thread....
[ "func", "(", "dbp", "*", "Process", ")", "ClearInternalBreakpoints", "(", ")", "error", "{", "return", "dbp", ".", "breakpoints", ".", "ClearInternalBreakpoints", "(", "func", "(", "bp", "*", "proc", ".", "Breakpoint", ")", "error", "{", "if", "err", ":=",...
// ClearInternalBreakpoints will clear all non-user set breakpoints. These // breakpoints are set for internal operations such as 'next'.
[ "ClearInternalBreakpoints", "will", "clear", "all", "non", "-", "user", "set", "breakpoints", ".", "These", "breakpoints", "are", "set", "for", "internal", "operations", "such", "as", "next", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/proc.go#L375-L387
127,887
go-delve/delve
pkg/proc/types.go
findType
func (bi *BinaryInfo) findType(name string) (godwarf.Type, error) { off, found := bi.types[name] if !found { return nil, reader.TypeNotFoundErr } return godwarf.ReadType(bi.dwarf, off, bi.typeCache) }
go
func (bi *BinaryInfo) findType(name string) (godwarf.Type, error) { off, found := bi.types[name] if !found { return nil, reader.TypeNotFoundErr } return godwarf.ReadType(bi.dwarf, off, bi.typeCache) }
[ "func", "(", "bi", "*", "BinaryInfo", ")", "findType", "(", "name", "string", ")", "(", "godwarf", ".", "Type", ",", "error", ")", "{", "off", ",", "found", ":=", "bi", ".", "types", "[", "name", "]", "\n", "if", "!", "found", "{", "return", "nil...
// Do not call this function directly it isn't able to deal correctly with package paths
[ "Do", "not", "call", "this", "function", "directly", "it", "isn", "t", "able", "to", "deal", "correctly", "with", "package", "paths" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/types.go#L58-L64
127,888
go-delve/delve
pkg/proc/types.go
nameOfRuntimeType
func nameOfRuntimeType(_type *Variable) (typename string, kind int64, err error) { if e, ok := _type.bi.nameOfRuntimeType[_type.Addr]; ok { return e.typename, e.kind, nil } var tflag int64 if tflagField := _type.loadFieldNamed("tflag"); tflagField != nil && tflagField.Value != nil { tflag, _ = constant.Int64V...
go
func nameOfRuntimeType(_type *Variable) (typename string, kind int64, err error) { if e, ok := _type.bi.nameOfRuntimeType[_type.Addr]; ok { return e.typename, e.kind, nil } var tflag int64 if tflagField := _type.loadFieldNamed("tflag"); tflagField != nil && tflagField.Value != nil { tflag, _ = constant.Int64V...
[ "func", "nameOfRuntimeType", "(", "_type", "*", "Variable", ")", "(", "typename", "string", ",", "kind", "int64", ",", "err", "error", ")", "{", "if", "e", ",", "ok", ":=", "_type", ".", "bi", ".", "nameOfRuntimeType", "[", "_type", ".", "Addr", "]", ...
// Returns the type name of the type described in _type. // _type is a non-loaded Variable pointing to runtime._type struct in the target. // The returned string is in the format that's used in DWARF data
[ "Returns", "the", "type", "name", "of", "the", "type", "described", "in", "_type", ".", "_type", "is", "a", "non", "-", "loaded", "Variable", "pointing", "to", "runtime", ".", "_type", "struct", "in", "the", "target", ".", "The", "returned", "string", "i...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/types.go#L616-L639
127,889
go-delve/delve
pkg/dwarf/dwarfbuilder/builder.go
New
func New() *Builder { b := &Builder{} b.info.Write([]byte{ 0x0, 0x0, 0x0, 0x0, // length 0x4, 0x0, // version 0x0, 0x0, 0x0, 0x0, // debug_abbrev_offset 0x8, // address_size }) b.TagOpen(dwarf.TagCompileUnit, "go") b.Attr(dwarf.AttrLanguage, uint8(22)) return b }
go
func New() *Builder { b := &Builder{} b.info.Write([]byte{ 0x0, 0x0, 0x0, 0x0, // length 0x4, 0x0, // version 0x0, 0x0, 0x0, 0x0, // debug_abbrev_offset 0x8, // address_size }) b.TagOpen(dwarf.TagCompileUnit, "go") b.Attr(dwarf.AttrLanguage, uint8(22)) return b }
[ "func", "New", "(", ")", "*", "Builder", "{", "b", ":=", "&", "Builder", "{", "}", "\n\n", "b", ".", "info", ".", "Write", "(", "[", "]", "byte", "{", "0x0", ",", "0x0", ",", "0x0", ",", "0x0", ",", "// length", "0x4", ",", "0x0", ",", "// ve...
// New creates a new DWARF builder.
[ "New", "creates", "a", "new", "DWARF", "builder", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/builder.go#L20-L34
127,890
go-delve/delve
pkg/dwarf/dwarfbuilder/builder.go
Build
func (b *Builder) Build() (abbrev, aranges, frame, info, line, pubnames, ranges, str, loc []byte, err error) { b.TagClose() if len(b.tagStack) > 0 { err = fmt.Errorf("unbalanced TagOpen/TagClose %d", len(b.tagStack)) return } abbrev = b.makeAbbrevTable() info = b.info.Bytes() binary.LittleEndian.PutUint32(i...
go
func (b *Builder) Build() (abbrev, aranges, frame, info, line, pubnames, ranges, str, loc []byte, err error) { b.TagClose() if len(b.tagStack) > 0 { err = fmt.Errorf("unbalanced TagOpen/TagClose %d", len(b.tagStack)) return } abbrev = b.makeAbbrevTable() info = b.info.Bytes() binary.LittleEndian.PutUint32(i...
[ "func", "(", "b", "*", "Builder", ")", "Build", "(", ")", "(", "abbrev", ",", "aranges", ",", "frame", ",", "info", ",", "line", ",", "pubnames", ",", "ranges", ",", "str", ",", "loc", "[", "]", "byte", ",", "err", "error", ")", "{", "b", ".", ...
// Build closes b and returns all the dwarf sections.
[ "Build", "closes", "b", "and", "returns", "all", "the", "dwarf", "sections", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/dwarfbuilder/builder.go#L37-L51
127,891
go-delve/delve
pkg/proc/disasm.go
Disassemble
func Disassemble(dbp Process, g *G, startPC, endPC uint64) ([]AsmInstruction, error) { if _, err := dbp.Valid(); err != nil { return nil, err } if g == nil { ct := dbp.CurrentThread() regs, _ := ct.Registers(false) return disassemble(ct, regs, dbp.Breakpoints(), dbp.BinInfo(), startPC, endPC, false) } var...
go
func Disassemble(dbp Process, g *G, startPC, endPC uint64) ([]AsmInstruction, error) { if _, err := dbp.Valid(); err != nil { return nil, err } if g == nil { ct := dbp.CurrentThread() regs, _ := ct.Registers(false) return disassemble(ct, regs, dbp.Breakpoints(), dbp.BinInfo(), startPC, endPC, false) } var...
[ "func", "Disassemble", "(", "dbp", "Process", ",", "g", "*", "G", ",", "startPC", ",", "endPC", "uint64", ")", "(", "[", "]", "AsmInstruction", ",", "error", ")", "{", "if", "_", ",", "err", ":=", "dbp", ".", "Valid", "(", ")", ";", "err", "!=", ...
// Disassemble disassembles target memory between startPC and endPC, marking // the current instruction being executed in goroutine g. // If currentGoroutine is set and thread is stopped at a CALL instruction Disassemble will evaluate the argument of the CALL instruction using the thread's registers // Be aware that th...
[ "Disassemble", "disassembles", "target", "memory", "between", "startPC", "and", "endPC", "marking", "the", "current", "instruction", "being", "executed", "in", "goroutine", "g", ".", "If", "currentGoroutine", "is", "set", "and", "thread", "is", "stopped", "at", ...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/disasm.go#L31-L49
127,892
go-delve/delve
pkg/proc/native/registers_windows_amd64.go
SetSP
func (thread *Thread) SetSP(sp uint64) error { context := winutil.NewCONTEXT() context.ContextFlags = _CONTEXT_ALL err := _GetThreadContext(thread.os.hThread, context) if err != nil { return err } context.Rsp = sp return _SetThreadContext(thread.os.hThread, context) }
go
func (thread *Thread) SetSP(sp uint64) error { context := winutil.NewCONTEXT() context.ContextFlags = _CONTEXT_ALL err := _GetThreadContext(thread.os.hThread, context) if err != nil { return err } context.Rsp = sp return _SetThreadContext(thread.os.hThread, context) }
[ "func", "(", "thread", "*", "Thread", ")", "SetSP", "(", "sp", "uint64", ")", "error", "{", "context", ":=", "winutil", ".", "NewCONTEXT", "(", ")", "\n", "context", ".", "ContextFlags", "=", "_CONTEXT_ALL", "\n\n", "err", ":=", "_GetThreadContext", "(", ...
// SetSP sets the RSP register to the value specified by `sp`.
[ "SetSP", "sets", "the", "RSP", "register", "to", "the", "value", "specified", "by", "sp", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/registers_windows_amd64.go#L27-L39
127,893
go-delve/delve
pkg/proc/native/registers_linux_amd64.go
SetPC
func (thread *Thread) SetPC(pc uint64) error { ir, err := registers(thread, false) if err != nil { return err } r := ir.(*linutil.AMD64Registers) r.Regs.Rip = pc thread.dbp.execPtraceFunc(func() { err = sys.PtraceSetRegs(thread.ID, (*sys.PtraceRegs)(r.Regs)) }) return err }
go
func (thread *Thread) SetPC(pc uint64) error { ir, err := registers(thread, false) if err != nil { return err } r := ir.(*linutil.AMD64Registers) r.Regs.Rip = pc thread.dbp.execPtraceFunc(func() { err = sys.PtraceSetRegs(thread.ID, (*sys.PtraceRegs)(r.Regs)) }) return err }
[ "func", "(", "thread", "*", "Thread", ")", "SetPC", "(", "pc", "uint64", ")", "error", "{", "ir", ",", "err", ":=", "registers", "(", "thread", ",", "false", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "r", ":=", ...
// SetPC sets RIP to the value specified by 'pc'.
[ "SetPC", "sets", "RIP", "to", "the", "value", "specified", "by", "pc", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/registers_linux_amd64.go#L13-L22
127,894
go-delve/delve
pkg/proc/native/registers_linux_amd64.go
SetSP
func (thread *Thread) SetSP(sp uint64) (err error) { var ir proc.Registers ir, err = registers(thread, false) if err != nil { return err } r := ir.(*linutil.AMD64Registers) r.Regs.Rsp = sp thread.dbp.execPtraceFunc(func() { err = sys.PtraceSetRegs(thread.ID, (*sys.PtraceRegs)(r.Regs)) }) return }
go
func (thread *Thread) SetSP(sp uint64) (err error) { var ir proc.Registers ir, err = registers(thread, false) if err != nil { return err } r := ir.(*linutil.AMD64Registers) r.Regs.Rsp = sp thread.dbp.execPtraceFunc(func() { err = sys.PtraceSetRegs(thread.ID, (*sys.PtraceRegs)(r.Regs)) }) return }
[ "func", "(", "thread", "*", "Thread", ")", "SetSP", "(", "sp", "uint64", ")", "(", "err", "error", ")", "{", "var", "ir", "proc", ".", "Registers", "\n", "ir", ",", "err", "=", "registers", "(", "thread", ",", "false", ")", "\n", "if", "err", "!=...
// SetSP sets RSP to the value specified by 'sp'
[ "SetSP", "sets", "RSP", "to", "the", "value", "specified", "by", "sp" ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/registers_linux_amd64.go#L25-L35
127,895
go-delve/delve
pkg/proc/proc.go
PostInitializationSetup
func PostInitializationSetup(p Process, path string, debugInfoDirs []string, writeBreakpoint WriteBreakpointFn) error { entryPoint, err := p.EntryPoint() if err != nil { return err } err = p.BinInfo().LoadBinaryInfo(path, entryPoint, debugInfoDirs) if err == nil { err = p.BinInfo().LoadError() } if err != n...
go
func PostInitializationSetup(p Process, path string, debugInfoDirs []string, writeBreakpoint WriteBreakpointFn) error { entryPoint, err := p.EntryPoint() if err != nil { return err } err = p.BinInfo().LoadBinaryInfo(path, entryPoint, debugInfoDirs) if err == nil { err = p.BinInfo().LoadError() } if err != n...
[ "func", "PostInitializationSetup", "(", "p", "Process", ",", "path", "string", ",", "debugInfoDirs", "[", "]", "string", ",", "writeBreakpoint", "WriteBreakpointFn", ")", "error", "{", "entryPoint", ",", "err", ":=", "p", ".", "EntryPoint", "(", ")", "\n", "...
// PostInitializationSetup handles all of the initialization procedures // that must happen after Delve creates or attaches to a process.
[ "PostInitializationSetup", "handles", "all", "of", "the", "initialization", "procedures", "that", "must", "happen", "after", "Delve", "creates", "or", "attaches", "to", "a", "process", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L54-L75
127,896
go-delve/delve
pkg/proc/proc.go
FunctionReturnLocations
func FunctionReturnLocations(p Process, funcName string) ([]uint64, error) { const deferReturn = "runtime.deferreturn" g := p.SelectedGoroutine() fn, ok := p.BinInfo().LookupFunc[funcName] if !ok { return nil, fmt.Errorf("unable to find function %s", funcName) } instructions, err := Disassemble(p, g, fn.Entry...
go
func FunctionReturnLocations(p Process, funcName string) ([]uint64, error) { const deferReturn = "runtime.deferreturn" g := p.SelectedGoroutine() fn, ok := p.BinInfo().LookupFunc[funcName] if !ok { return nil, fmt.Errorf("unable to find function %s", funcName) } instructions, err := Disassemble(p, g, fn.Entry...
[ "func", "FunctionReturnLocations", "(", "p", "Process", ",", "funcName", "string", ")", "(", "[", "]", "uint64", ",", "error", ")", "{", "const", "deferReturn", "=", "\"", "\"", "\n\n", "g", ":=", "p", ".", "SelectedGoroutine", "(", ")", "\n", "fn", ",...
// FunctionReturnLocations will return a list of addresses corresponding // to 'ret' or 'call runtime.deferreturn'.
[ "FunctionReturnLocations", "will", "return", "a", "list", "of", "addresses", "corresponding", "to", "ret", "or", "call", "runtime", ".", "deferreturn", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L126-L149
127,897
go-delve/delve
pkg/proc/proc.go
Next
func Next(dbp Process) (err error) { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } if err = next(dbp, false, false); err != nil { dbp.ClearInternalBreakpoints() return } return Continue(dbp) }
go
func Next(dbp Process) (err error) { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } if err = next(dbp, false, false); err != nil { dbp.ClearInternalBreakpoints() return } return Continue(dbp) }
[ "func", "Next", "(", "dbp", "Process", ")", "(", "err", "error", ")", "{", "if", "_", ",", "err", ":=", "dbp", ".", "Valid", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "dbp", ".", "Breakpoints", "(", ")", ...
// Next continues execution until the next source line.
[ "Next", "continues", "execution", "until", "the", "next", "source", "line", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L152-L166
127,898
go-delve/delve
pkg/proc/proc.go
stepInstructionOut
func stepInstructionOut(dbp Process, curthread Thread, fnname1, fnname2 string) error { for { if err := curthread.StepInstruction(); err != nil { return err } loc, err := curthread.Location() if err != nil || loc.Fn == nil || (loc.Fn.Name != fnname1 && loc.Fn.Name != fnname2) { if g := dbp.SelectedGorout...
go
func stepInstructionOut(dbp Process, curthread Thread, fnname1, fnname2 string) error { for { if err := curthread.StepInstruction(); err != nil { return err } loc, err := curthread.Location() if err != nil || loc.Fn == nil || (loc.Fn.Name != fnname1 && loc.Fn.Name != fnname2) { if g := dbp.SelectedGorout...
[ "func", "stepInstructionOut", "(", "dbp", "Process", ",", "curthread", "Thread", ",", "fnname1", ",", "fnname2", "string", ")", "error", "{", "for", "{", "if", "err", ":=", "curthread", ".", "StepInstruction", "(", ")", ";", "err", "!=", "nil", "{", "ret...
// stepInstructionOut repeatedly calls StepInstruction until the current // function is neither fnname1 or fnname2. // This function is used to step out of runtime.Breakpoint as well as // runtime.debugCallV1.
[ "stepInstructionOut", "repeatedly", "calls", "StepInstruction", "until", "the", "current", "function", "is", "neither", "fnname1", "or", "fnname2", ".", "This", "function", "is", "used", "to", "step", "out", "of", "runtime", ".", "Breakpoint", "as", "well", "as"...
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L335-L348
127,899
go-delve/delve
pkg/proc/proc.go
Step
func Step(dbp Process) (err error) { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } if err = next(dbp, true, false); err != nil { switch err.(type) { case ErrThreadBlocked: // Noop default: dbp.ClearInterna...
go
func Step(dbp Process) (err error) { if _, err := dbp.Valid(); err != nil { return err } if dbp.Breakpoints().HasInternalBreakpoints() { return fmt.Errorf("next while nexting") } if err = next(dbp, true, false); err != nil { switch err.(type) { case ErrThreadBlocked: // Noop default: dbp.ClearInterna...
[ "func", "Step", "(", "dbp", "Process", ")", "(", "err", "error", ")", "{", "if", "_", ",", "err", ":=", "dbp", ".", "Valid", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "dbp", ".", "Breakpoints", "(", ")", ...
// Step will continue until another source line is reached. // Will step into functions.
[ "Step", "will", "continue", "until", "another", "source", "line", "is", "reached", ".", "Will", "step", "into", "functions", "." ]
71a7fe04d9a7f7292146988f0e737aea47543dd0
https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/proc.go#L352-L370