Add --artifact-config parameter to debug command
This commit is contained in:
		
							
								
								
									
										10
									
								
								debug.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								debug.go
									
									
									
									
									
								
							| @@ -23,6 +23,8 @@ type DebugCmd struct { | |||||||
| 	Kernel string `help:"regexp (first match)" required:""` | 	Kernel string `help:"regexp (first match)" required:""` | ||||||
| 	Gdb    string `help:"gdb listen address" default:"tcp::1234"` | 	Gdb    string `help:"gdb listen address" default:"tcp::1234"` | ||||||
|  |  | ||||||
|  | 	ArtifactConfig string `help:"path to artifact config" type:"path"` | ||||||
|  |  | ||||||
| 	Kaslr bool `help:"Enable KASLR"` | 	Kaslr bool `help:"Enable KASLR"` | ||||||
| 	Smep  bool `help:"Enable SMEP"` | 	Smep  bool `help:"Enable SMEP"` | ||||||
| 	Smap  bool `help:"Enable SMAP"` | 	Smap  bool `help:"Enable SMAP"` | ||||||
| @@ -40,7 +42,13 @@ func (cmd *DebugCmd) Run(g *Globals) (err error) { | |||||||
| 		log.Println(err) | 		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 { | 	if err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user