summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2020-03-31 12:58:00 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-01 19:31:46 +0000
commit84998e09565a858382a6101c06686e0340743c81 (patch)
tree62774a3a2f75e328cefe2bec9b701a688f126958 /util
parent28ee6ffb30819b6c29c5f1223a3cc35b0778b0a5 (diff)
downloadchrome-ec-84998e09565a858382a6101c06686e0340743c81.tar.gz
When a string parameter __func__ ie encountered in the source code, the function name is saved in the format strings dictionary, and then packet is prepared, instead of sending the string, a byte of 0xff is sent and then the four byte value which is the string index. But two bytes is enough to send the string index, as it is a 16 bit value by design. This patch modifies both transmit and receive sides to start using 2 byte indices for __func__. BUG=b:149964350 TEST=built the new image, tried running it, observed correct function names in the console output. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I682dd18cb4dd434e6982d33f1918ef398d5caa20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2131046 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/acroterm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/acroterm.py b/util/acroterm.py
index 471e861dfd..a2510244d4 100755
--- a/util/acroterm.py
+++ b/util/acroterm.py
@@ -1089,9 +1089,9 @@ class Cr50Packet(Packet):
if str_param.search(token):
if data[0] == 0xff:
# This is a function name.
- index = uint_struct.unpack_from(data[1:])[0]
+ index = short_struct.unpack_from(data[1:])[0]
st = self.strings[index]
- data = data[5:]
+ data = data[3:]
else:
eos = data.find(0)
param = data[:eos].decode('ascii')