From b0587a4adeae5229386837ba933d76ba6103c04a Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 23 Feb 2023 08:26:54 +0000 Subject: [PATCH] Add --artifact-config parameter to debug command --- debug.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/debug.go b/debug.go index 335942b..b78ccfe 100644 --- a/debug.go +++ b/debug.go @@ -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 }