Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 1.33 KB

debuggers.md

File metadata and controls

75 lines (54 loc) · 1.33 KB

Debuggers

Currently Squash support the following debuggers:

Future planes:


=> We are looking for community help to add support for more debuggers.

Debuggers conform to the interface:

type Debugger interface {

	AttachTo(pid int) (LiveDebugSession, error)
	StartDebugServer(pid int) (DebugServer, error)
}

Where DebugServer consists of the following:

type DebugServer interface {

	Detachable
	Port() int
}

and Detachable consists of the following:

type Detachable interface {

	Detach() error
}

and LiveDebugSession consists of the following:

type LiveDebugSession interface {

	SetBreakpoint(bp string) error
  	Continue() (<-chan Event, error)
  	IntoDebugServer() (DebugServer, error)
  	Detachable
}

To add debugger support to squash, implement the functions and add it to the squash client main file.

func getDebugger(dbgtype string) debuggers.Debugger {
	
	var g gdb.GdbInterface
	var d dlv.DLV
	
	switch dbgtype {
	case "dlv":
		return &d
	case "gdb":
		fallthrough
	default:
		return &g
	}
}