Other
- It is easy to add support for additional languages and debuggers.
- Squash features an extendable debugger interface. Just implement the required methods for your preferred debugger.
- We have several additional debuggers on our roadmap and we welcome community contributions.
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.
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
}
}