logging: dictionary: workaround non-existing strings
When strings are not in the dictionary, the parser would crash.
This works around the issue by indcating an unknown string
as "string@<addr>".
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
diff --git a/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py b/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py
index 720edc3..c03b1cf 100644
--- a/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py
+++ b/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py
@@ -195,7 +195,10 @@
str_idx = arg_offset + self.data_types.get_sizeof(DataTypes.PTR) * 2
str_idx /= self.data_types.get_sizeof(DataTypes.INT)
- ret = string_tbl[int(str_idx)]
+ if int(str_idx) not in string_tbl:
+ ret = "<string@0x{0:x}>".format(arg)
+ else:
+ ret = string_tbl[int(str_idx)]
return ret