mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
add debug file generation for swap
This commit is contained in:
parent
58ce8a2923
commit
400088fb42
1 changed files with 19 additions and 0 deletions
|
|
@ -174,6 +174,13 @@ fn main() {
|
||||||
.value_name("OUTPUT")
|
.value_name("OUTPUT")
|
||||||
.help("Output file to store swap image data")
|
.help("Output file to store swap image data")
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("swap-debug-name")
|
||||||
|
.long("swap-debug-name")
|
||||||
|
.takes_value(true)
|
||||||
|
.value_name("OUTPUT")
|
||||||
|
.help("Output file to store swap debug data")
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("debug")
|
Arg::with_name("debug")
|
||||||
.short("d")
|
.short("d")
|
||||||
|
|
@ -479,6 +486,18 @@ fn main() {
|
||||||
|
|
||||||
println!("Swap arguments: {}", sargs);
|
println!("Swap arguments: {}", sargs);
|
||||||
println!("Swap data created in file {}", swap_filename);
|
println!("Swap data created in file {}", swap_filename);
|
||||||
|
|
||||||
|
match matches.value_of("swap-debug-name") {
|
||||||
|
Some(sf_dbg) => {
|
||||||
|
let sf =
|
||||||
|
File::create(sf_dbg).unwrap_or_else(|_| panic!("Couldn't create debug file {}", sf_dbg));
|
||||||
|
sargs.write(&sf).expect("Couldn't write debug swap image");
|
||||||
|
println!("Swap debug created in file {}", sf_dbg);
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
// Argument wasn't specified, do nothing.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
println!("Runtime will require {} bytes to track memory allocations", ram_config.memory_required);
|
println!("Runtime will require {} bytes to track memory allocations", ram_config.memory_required);
|
||||||
if let Some(s) = swap {
|
if let Some(s) = swap {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue