summaryrefslogtreecommitdiff
path: root/src/sim/pseudo_inst.cc
diff options
context:
space:
mode:
authorSascha Bischoff <sascha.bischoff@ARM.com>2015-11-05 18:26:23 +0000
committerSascha Bischoff <sascha.bischoff@ARM.com>2015-11-05 18:26:23 +0000
commit2d79bf3d4dfd997d352b8399c4c9f3ff9d05de41 (patch)
treef761619cf3fb81cb41c2f6e205c786b0381f675e /src/sim/pseudo_inst.cc
parent47326f54222af99d96ab57508449d1bb62d03842 (diff)
downloadgem5-2d79bf3d4dfd997d352b8399c4c9f3ff9d05de41.tar.xz
sim: Disable gzip compression for writefile pseudo instruction
The writefile pseudo instruction uses OutputDirectory::create and OutputDirectory::openFile to create the output files. However, by default these will check the file extention for .gz, and create a gzip compressed stream if the file ending matches. When writing out files, we want to write them out exactly as they are in the guest simulation, and never want to compress them with gzio. Additionally, this causes m5 writefile to fail when checking the error flags for the output steam. With this patch we add an additional no_gz argument to OutputDirectory::create and OutputDirectory::openFile which allows us to override the gzip compression. Therefore, for m5 writefile we disable the filename check, and always create a standard ostream.
Diffstat (limited to 'src/sim/pseudo_inst.cc')
-rw-r--r--src/sim/pseudo_inst.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc
index d4e2085df..fb19b21b1 100644
--- a/src/sim/pseudo_inst.cc
+++ b/src/sim/pseudo_inst.cc
@@ -565,13 +565,13 @@ writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset,
if (offset == 0) {
// create a new file (truncate)
- os = simout.create(filename, true);
+ os = simout.create(filename, true, true);
} else {
// do not truncate file if offset is non-zero
// (ios::in flag is required as well to keep the existing data
// intact, otherwise existing data will be zeroed out.)
os = simout.openFile(simout.directory() + filename,
- ios::in | ios::out | ios::binary);
+ ios::in | ios::out | ios::binary, true);
}
if (!os)
panic("could not open file %s\n", filename);