Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.17 KB

File metadata and controls

55 lines (41 loc) · 1.17 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 {

	/// Attach a debugger to pid and return the a debug server object
	Attach(pid int) (DebugServer, error)
}

Where DebugServer consists of the following:

type DebugServer interface {
	/// Detach from the process we are debugging (allowing it to resume normal execution).
	Detach() error
	///  Return the port that the debug server listens on.
	Port() int
}

To add debugger support to squash, implement the functions above 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":
		return &g
	default:
		return nil
	}
}