aconfig: improve flag value tracing
Improve how the flag values (state, permission) are tracked when parsing
config and override files: migrate from a raw string to a proper struct,
as this will make it easier when aconfig will output this data in some
structured format for other tools to consume.
Also, rename Cache.debug to Cache.trace.
Bug: 279485059
Test: atest aconfig.test
Change-Id: Idad57c969515f697e9065429d8a44c38d8a512d2
diff --git a/tools/aconfig/src/commands.rs b/tools/aconfig/src/commands.rs
index dc3e6bc..73d3357 100644
--- a/tools/aconfig/src/commands.rs
+++ b/tools/aconfig/src/commands.rs
@@ -16,13 +16,14 @@
use anyhow::{Context, Result};
use clap::ValueEnum;
+use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::Read;
use crate::aconfig::{Flag, Override};
use crate::cache::Cache;
-#[derive(Clone)]
+#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum Source {
#[allow(dead_code)] // only used in unit tests
Memory,