1
0

Add --artifact-config parameter to debug command

This commit is contained in:
dump_stack() 2023-02-23 08:26:54 +00:00
parent 4fdcc5d098
commit b0587a4ade
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -23,6 +23,8 @@ type DebugCmd struct {
Kernel string `help:"regexp (first match)" required:""`
Gdb string `help:"gdb listen address" default:"tcp::1234"`
ArtifactConfig string `help:"path to artifact config" type:"path"`
Kaslr bool `help:"Enable KASLR"`
Smep bool `help:"Enable SMEP"`
Smap bool `help:"Enable SMAP"`
@ -40,7 +42,13 @@ func (cmd *DebugCmd) Run(g *Globals) (err error) {
log.Println(err)
}
ka, err := config.ReadArtifactConfig(g.WorkDir + "/.out-of-tree.toml")
var configPath string
if cmd.ArtifactConfig == "" {
configPath = g.WorkDir + "/.out-of-tree.toml"
} else {
configPath = cmd.ArtifactConfig
}
ka, err := config.ReadArtifactConfig(configPath)
if err != nil {
return
}