Skip to content
Snippets Groups Projects
Commit 8362a3f3 authored by Patrick Daly's avatar Patrick Daly
Browse files

lrdp-v2: Use 'rb' mode when opening DDR files

Calling read_byte() on windows may return the empty string '' prior
to the end of the file without opening the file in 'rb' mode.

The 'rb' mode was removed by
commit 5743b613
("lrdp-v2: ramdump: Fix autoparse for some targets.")

Change-Id: Ibea608112400c06a9adc6f1fd3b4842a87717846
parent 9c9a44e7
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ class AutoDumpInfo(object):
for (filename, base_addr) in self._parse():
fullpath = os.path.join(self.autodumpdir, filename)
end = base_addr + os.path.getsize(fullpath) - 1
self.ebi_files.append((open(fullpath), base_addr, end, filename))
self.ebi_files.append((open(fullpath, 'rb'), base_addr, end, filename))
# sort by addr, DDR files first. The goal is for
# self.ebi_files[0] to be the DDR file with the lowest address.
self.ebi_files.sort(key=lambda x: (x[-1] not in DDR_FILE_NAMES,
......
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