Skip to content
Snippets Groups Projects
Commit 539a3595 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lrdpv2: roareadiff: don't print non-printable characters"

parents 2f1614d2 803e9997
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
# Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
......@@ -10,6 +10,7 @@
# GNU General Public License for more details.
import struct
import string
from print_out import print_out_str
from collections import namedtuple
......@@ -126,8 +127,10 @@ class ROData(RamParser):
ddr_str += '{0:0>8x}'.format(ram_value)
vmlinux_str += '{0:0>8x}'.format(vm_value)
for j in range(4):
ddr_ascii += '{0:c}'.format(struct.unpack('B', ram_values[i + j])[0]).rstrip()
vm_ascii += '{0:c}'.format(struct.unpack('B', vm_values[i + j])[0]).rstrip()
c = '{0:c}'.format(struct.unpack('B', ram_values[i + j])[0]).rstrip()
ddr_ascii += c if c in string.printable else '.'
c = '{0:c}'.format(struct.unpack('B', vm_values[i + j])[0]).rstrip()
vm_ascii += c if c in string.printable else '.'
detect += 1
i = i + 4
if detect != 0xFFFFFFFF:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment