diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2004-10-19 20:00:20 -0400 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2004-10-19 20:00:20 -0400 |
commit | f267dc4a8729179ed99ec591af2ba434cb644755 (patch) | |
tree | 83f1263d80cd74acd8e617b988290239cfdada5a /sim/builder.cc | |
parent | f0aed43b93c133a617a5260911777a9434f6b76c (diff) | |
download | gem5-f267dc4a8729179ed99ec591af2ba434cb644755.tar.xz |
Clean up/standardize handling of various output files.
No more non-intuitive behavior shifts depending on whether
outputDirectory is set (at the expense of backwards compatibility).
outputDirectory is now always valid, defaults to ".".
dev/etherdump.cc:
Use makeOutputStream() to create output file.
New behavior: actually complain if dump file can't
be opened, instead of quietly ignoring the problem.
dev/etherdump.hh:
dev/simconsole.cc:
dev/simconsole.hh:
Use makeOutputStream() to create output file.
sim/builder.cc:
sim/builder.hh:
sim/main.cc:
builderStream() is now *configStream.
sim/serialize.cc:
outputDirectory is now always valid, no need to check.
sim/universe.cc:
Clean up/standardize handling of various output files.
No more non-intuitive behavior shifts depending on whether
outputDirectory is set (at the expense of backwards compatibility).
outputDirectory is now always valid, defaults to ".".
New function makeOutputStream() does "the right thing" to
associate a stream with a filename.
--HG--
extra : convert_revision : a03c58c547221b3906e0d6f55e4a569843f2d646
Diffstat (limited to 'sim/builder.cc')
-rw-r--r-- | sim/builder.cc | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/sim/builder.cc b/sim/builder.cc index 53e5cf3d8..890451ec4 100644 --- a/sim/builder.cc +++ b/sim/builder.cc @@ -39,26 +39,6 @@ using namespace std; - -ostream & -builderStream() -{ - static ofstream file; - static ostream *stream = NULL; - - if (!stream) { - if (!outputDirectory.empty()) { - string filename = outputDirectory + "builder.txt"; - file.open(filename.c_str()); - stream = &file; - } else { - stream = outputStream; - } - } - - return *stream; -} - SimObjectBuilder::SimObjectBuilder(const string &_configClass, const string &_instanceName, ConfigNode *_configNode, @@ -187,10 +167,10 @@ SimObjectClass::createObject(IniFile &configDB, // echo object parameters to stats file (for documenting the // config used to generate the associated stats) - builderStream() << "[" << object->name() << "]" << endl; - builderStream() << "type=" << simObjClassName << endl; - objectBuilder->showParams(builderStream()); - builderStream() << endl; + *configStream << "[" << object->name() << "]" << endl; + *configStream << "type=" << simObjClassName << endl; + objectBuilder->showParams(*configStream); + *configStream << endl; // done with the SimObjectBuilder now delete objectBuilder; |