cdelve

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortType

func ShortType(typ string) string

Types

type GiDelve

type GiDelve struct {
	// contains filtered or unexported fields
}

GiDelve is the Delve implementation of the GiDebug interface

func NewGiDelve

func NewGiDelve(path, rootPath string, outbuf *texteditor.Buffer, pars *cdebug.Params) (*GiDelve, error)

NewGiDelve creates a new debugger exe and client for given path, and project root path test = run in test mode, and args are optional additional args to pass to the debugger.

func (*GiDelve) AmendBreak

func (gd *GiDelve) AmendBreak(id int, fname string, line int, cond string, trace bool) error

AmmendBreak allows user to update an existing breakpoint for example to change the information retrieved when the breakpoint is hit or to change, add or remove the break condition

func (*GiDelve) AttachedToExistingProcess

func (gd *GiDelve) AttachedToExistingProcess() bool

Returns whether we attached to a running process or not

func (*GiDelve) Call

func (gd *GiDelve) Call(goroutineID int, expr string, unsafe bool) (*cdebug.State, error)

Call resumes process execution while making a function call.

func (*GiDelve) CancelNext

func (gd *GiDelve) CancelNext() error

Cancels a Next or Step call that was interrupted by a manual stop or by another breakpoint

func (*GiDelve) ClearBreak

func (gd *GiDelve) ClearBreak(id int) error

ClearBreak deletes a breakpoint by ID.

func (*GiDelve) ClearBreakByName

func (gd *GiDelve) ClearBreakByName(name string) (*cdebug.Break, error)

ClearBreakByName deletes a breakpoint by name

func (*GiDelve) Continue

func (gd *GiDelve) Continue(all *cdebug.AllState) <-chan *cdebug.State

Continue resumes process execution.

func (*GiDelve) CurThreadID

func (gd *GiDelve) CurThreadID(all *cdebug.AllState) int

CurThreadID returns the proper current threadID (task or thread) based on debugger, from given state.

func (*GiDelve) Detach

func (gd *GiDelve) Detach(killProcess bool) error

Detach detaches the debugger, optionally killing the process.

func (*GiDelve) Disconnect

func (gd *GiDelve) Disconnect(cont bool) error

Disconnect closes the connection to the server without sending a Detach request first. If cont is true a continue command will be sent instead.

func (*GiDelve) FindFrames

func (gd *GiDelve) FindFrames(all *cdebug.AllState, fname string, line int) ([]*cdebug.Frame, error)

FindFrames looks through the Stacks of all Tasks / Threads for the closest Stack Frame to given file and line number. Results are sorted by line number proximity to given line.

func (*GiDelve) FollowPtr

func (gd *GiDelve) FollowPtr(vr *cdebug.Variable) error

FollowPtr fills in the Child of given Variable with retrieved value.

func (*GiDelve) GetBreak

func (gd *GiDelve) GetBreak(id int) (*cdebug.Break, error)

GetBreak gets a breakpoint by ID.

func (*GiDelve) GetBreakByName

func (gd *GiDelve) GetBreakByName(name string) (*cdebug.Break, error)

GetBreakByName gets a breakpoint by name.

func (*GiDelve) GetState

func (gd *GiDelve) GetState() (*cdebug.State, error)

GetState returns the current debugger state. This will return immediately -- if the target is running then the Running flag will be set and a Stop bus be called to get any further information about the target.

func (*GiDelve) GetThread

func (gd *GiDelve) GetThread(id int) (*cdebug.Thread, error)

GetThread gets a thread by its ID.

func (*GiDelve) GetVar

func (gd *GiDelve) GetVar(expr string, threadID int, frame int) (*cdebug.Variable, error)

GetVariable returns a variable based on expression in the context of the current thread.

func (*GiDelve) HasTasks

func (gd *GiDelve) HasTasks() bool

func (*GiDelve) InitAllState

func (gd *GiDelve) InitAllState(all *cdebug.AllState) error

InitAllState initializes the given AllState with relevant info for current state of things. Does Not get AllVars

func (*GiDelve) IsActive

func (gd *GiDelve) IsActive() bool

IsActive returns whether debugger is active and ready for commands

func (*GiDelve) LastModified

func (gd *GiDelve) LastModified() time.Time

LastModified returns the time that the process' executable was modified.

func (*GiDelve) ListBreaks

func (gd *GiDelve) ListBreaks() ([]*cdebug.Break, error)

ListBreaks gets all breakpoints.

func (*GiDelve) ListFuncs

func (gd *GiDelve) ListFuncs(filter string) ([]string, error)

ListFuncs lists all functions in the process matching filter.

func (*GiDelve) ListGlobalVars

func (gd *GiDelve) ListGlobalVars(filter string) ([]*cdebug.Variable, error)

ListGlobalVars lists all package variables in the context of the current thread.

func (*GiDelve) ListSources

func (gd *GiDelve) ListSources(filter string) ([]string, error)

ListSources lists all source files in the process matching filter.

func (*GiDelve) ListTasks

func (gd *GiDelve) ListTasks() ([]*cdebug.Task, error)

ListTasks lists all goroutines.

func (*GiDelve) ListThreads

func (gd *GiDelve) ListThreads() ([]*cdebug.Thread, error)

ListThreads lists all threads.

func (*GiDelve) ListTypes

func (gd *GiDelve) ListTypes(filter string) ([]string, error)

ListTypes lists all types in the process matching filter.

func (*GiDelve) ListVars

func (gd *GiDelve) ListVars(threadID int, frame int) ([]*cdebug.Variable, error)

ListVars lists all local variables in scope, including args

func (*GiDelve) LogErr

func (gd *GiDelve) LogErr(err error) error

func (*GiDelve) ProcessPid

func (gd *GiDelve) ProcessPid() int

Returns the pid of the process we are debugging.

func (*GiDelve) Restart

func (gd *GiDelve) Restart() error

Restarts program.

func (*GiDelve) RestartFrom

func (gd *GiDelve) RestartFrom(pos string, resetArgs bool, newArgs []string) error

Restarts program from the specified position.

func (*GiDelve) SetBreak

func (gd *GiDelve) SetBreak(fname string, line int) (*cdebug.Break, error)

SetBreak sets a new breakpoint at given file and line number

func (*GiDelve) SetParams

func (gd *GiDelve) SetParams(params *cdebug.Params)

func (*GiDelve) SetVar

func (gd *GiDelve) SetVar(name, value string, threadID int, frame int) error

SetVar sets the value of a variable

func (*GiDelve) Stack

func (gd *GiDelve) Stack(goroutineID int, depth int) ([]*cdebug.Frame, error)

Stack returns stacktrace

func (*GiDelve) Start

func (gd *GiDelve) Start(path, rootPath string, outbuf *texteditor.Buffer, pars *cdebug.Params) error

Start starts the debugger for a given exe path

func (*GiDelve) StartedCheck

func (gd *GiDelve) StartedCheck() error

StartedCheck checks that delve client is running properly

func (*GiDelve) StepInto

func (gd *GiDelve) StepInto() (*cdebug.State, error)

StepInto continues to the next source line, entering function calls.

func (*GiDelve) StepOut

func (gd *GiDelve) StepOut() (*cdebug.State, error)

StepOut continues to the return address of the current function

func (*GiDelve) StepOver

func (gd *GiDelve) StepOver() (*cdebug.State, error)

StepOver continues to the next source line, not entering function calls.

func (*GiDelve) StepSingle

func (gd *GiDelve) StepSingle() (*cdebug.State, error)

StepSingle steps a single cpu instruction.

func (*GiDelve) Stop

func (gd *GiDelve) Stop() (*cdebug.State, error)

Stop suspends the process.

func (*GiDelve) SwitchTask

func (gd *GiDelve) SwitchTask(goroutineID int) (*cdebug.State, error)

SwitchTask switches the current goroutine (and the current thread as well)

func (*GiDelve) SwitchThread

func (gd *GiDelve) SwitchThread(threadID int) (*cdebug.State, error)

SwitchThread switches the current thread context.

func (*GiDelve) UpdateAllState

func (gd *GiDelve) UpdateAllState(all *cdebug.AllState, threadID int, frame int) error

UpdateAllState updates the state for given threadId and frame number (only info different from current results is updated). For given thread (lowest-level supported by language, e.g., Task if supported, else Thread), and frame number.

func (*GiDelve) UpdateBreaks

func (gd *GiDelve) UpdateBreaks(brk *[]*cdebug.Break) error

UpdateBreaks updates current breakpoints based on given list of breakpoints. first gets the current list, and does actions to ensure that the list is set.

func (*GiDelve) WriteToConsole

func (gd *GiDelve) WriteToConsole(msg string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL