Move gdb listen address to params
This commit is contained in:
parent
b6dc7e892f
commit
804e0b4879
5
debug.go
5
debug.go
@ -81,7 +81,7 @@ func interactive(q *qemu.QemuSystem) (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
func debugHandler(kcfg config.KernelConfig, workPath string, kernRegex string,
|
||||
func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
|
||||
dockerTimeout time.Duration) (err error) {
|
||||
|
||||
ka, err := config.ReadArtifactConfig(workPath + "/.out-of-tree.toml")
|
||||
@ -103,8 +103,7 @@ func debugHandler(kcfg config.KernelConfig, workPath string, kernRegex string,
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
gdb := "tcp::1234" // TODO param
|
||||
q.Debug(gdb) // TODO param
|
||||
q.Debug(gdb)
|
||||
coloredGdbAddress := aurora.BgGreen(aurora.Black(gdb))
|
||||
fmt.Printf("[*] gdb runned on %s\n", coloredGdbAddress)
|
||||
|
||||
|
5
main.go
5
main.go
@ -67,6 +67,8 @@ func main() {
|
||||
debugCommand := app.Command("debug", "Kernel debug environment")
|
||||
debugCommandFlag := debugCommand.Flag("kernel", "Regex (first match)")
|
||||
debugKernel := debugCommandFlag.Required().String()
|
||||
debugFlagGDB := debugCommand.Flag("gdb", "Set gdb listen address")
|
||||
debugGDB := debugFlagGDB.Default("tcp::1234").String()
|
||||
|
||||
// Check for required commands
|
||||
for _, cmd := range []string{"timeout", "docker", "qemu"} {
|
||||
@ -94,7 +96,8 @@ func main() {
|
||||
case genExploitCommand.FullCommand():
|
||||
err = genConfig(config.KernelExploit)
|
||||
case debugCommand.FullCommand():
|
||||
err = debugHandler(kcfg, *path, *debugKernel, *dockerTimeout)
|
||||
err = debugHandler(kcfg, *path, *debugKernel, *debugGDB,
|
||||
*dockerTimeout)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user