1
0

Implements qemu debug support

This commit is contained in:
2018-11-25 13:12:06 +00:00
parent 44aa01856f
commit 4a247b229a
2 changed files with 56 additions and 0 deletions

View File

@@ -67,6 +67,9 @@ type QemuSystem struct {
Cpus int
Memory int
debug bool
gdb string // tcp::1234
// Timeout works after Start invocation
Timeout time.Duration
KilledByTimeout bool
@@ -184,6 +187,10 @@ func (q *QemuSystem) Start() (err error) {
"-netdev", "user,id=n1," + hostfwd,
}
if q.debug {
qemuArgs = append(qemuArgs, "-gdb", q.gdb)
}
if q.kernel.InitrdPath != "" {
qemuArgs = append(qemuArgs, "-initrd", q.kernel.InitrdPath)
}
@@ -338,3 +345,8 @@ func (q *QemuSystem) CopyAndRun(user, path string) (output string, err error) {
return q.Command(user, "chmod +x "+remotePath+" && "+remotePath)
}
func (q *QemuSystem) Debug(conn string) {
q.debug = true
q.gdb = conn
}