Keep the first and last snapshot of variables.
So we can compare our reconstruction of the variable state.
Test: treehugger
Change-Id: I9c1995f8969dcf95256aa7c05a01d0431e36caa2
diff --git a/core/dumpconfig.mk b/core/dumpconfig.mk
index cb7fbcb..dd3ef43 100644
--- a/core/dumpconfig.mk
+++ b/core/dumpconfig.mk
@@ -79,11 +79,19 @@
# $(2): Root nodes to import
# $(3): All variable names
# $(4): Single-value variables
-define dump-product-var-names
+# $(5): Makefile being processed
+define dump-phase-start
$(eval $(file >> $(DUMPCONFIG_FILE),phase,$(strip $(1)),$(strip $(2)))) \
$(foreach var,$(3), \
$(eval $(file >> $(DUMPCONFIG_FILE),var,$(if $(filter $(4),$(var)),single,list),$(var))) \
-)
+) \
+$(call dump-config-vals,$(strip $(5)),initial)
+endef
+
+# Args:
+# $(1): Makefile being processed
+define dump-phase-end
+$(call dump-config-vals,$(strip $(1)),final)
endef
define dump-debug
@@ -110,7 +118,7 @@
# Args:
# $(1): Makefile that was included
-# $(2): block (before,import,after)
+# $(2): block (before,import,after,initial,final)
define dump-config-vals
$(foreach var,$(filter-out $(DUMPCONFIG_SKIP_VARS),$(.KATI_SYMBOLS)),\
$(eval $(file >> $(DUMPCONFIG_FILE),val,$(call escape-for-csv,$(1)),$(2),$(call escape-for-csv,$(var)),$(call escape-for-csv,$($(var))),$(call escape-for-csv,$(KATI_variable_location $(var))))) \