Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/16542

Change subject: mem-cache: Add size to array unserialization error message
......................................................................

mem-cache: Add size to array unserialization error message

Add both acquired and expected size information to array
unserialization error message.

Change-Id: Ic0a493c5a7860066eb992e9e91e7a4746b197579
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/sim/serialize.hh
1 file changed, 12 insertions(+), 4 deletions(-)



diff --git a/src/sim/serialize.hh b/src/sim/serialize.hh
index a45d1bb..83c1d0f 100644
--- a/src/sim/serialize.hh
+++ b/src/sim/serialize.hh
@@ -474,7 +474,15 @@
     os << "\n";
 }

-
+/**
+ * Extract values stored in the checkpoint, and assign them to the provided
+ * array container.
+ *
+ * @param cp The checkpoint to be parsed.
+ * @param name Name of the container.
+ * @param param The array container.
+ * @param size The expected number of entries to be extracted.
+ */
 template <class T>
 void
 arrayParamIn(CheckpointIn &cp, const std::string &name,
@@ -496,9 +504,9 @@
     // Need this if we were doing a vector
     // value.resize(tokens.size());

-    if (tokens.size() != size) {
-        fatal("Array size mismatch on %s:%s'\n", section, name);
-    }
+    fatal_if(tokens.size() != size,
+             "Array size mismatch on %s:%s (Got %zu, expected %u)'\n",
+             section, name, tokens.size(), size);

for (std::vector<std::string>::size_type i = 0; i < tokens.size(); i++) {
         // need to parse into local variable to handle vector<bool>,

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16542
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ic0a493c5a7860066eb992e9e91e7a4746b197579
Gerrit-Change-Number: 16542
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to