summaryrefslogtreecommitdiff
path: root/dev/etherdump.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-01-30 16:01:26 -0500
committerNathan Binkert <binkertn@umich.edu>2004-01-30 16:01:26 -0500
commit4ae64216c3c27e9f1e35ce93114f932f3d2c3361 (patch)
treefe3ca24667628af7c2e5a94a3bcae585fb492855 /dev/etherdump.cc
parenta0c3e61d320e72bbdddf4cea1413f6638e0faf45 (diff)
parent2f4f7aacf77dea16795a4052613da6092f6efc31 (diff)
downloadgem5-4ae64216c3c27e9f1e35ce93114f932f3d2c3361.tar.xz
Merge
--HG-- extra : convert_revision : 8690e31b64235874d74ea4a1123a408610fb115b
Diffstat (limited to 'dev/etherdump.cc')
-rw-r--r--dev/etherdump.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/dev/etherdump.cc b/dev/etherdump.cc
index 60dc1559d..89f1ce382 100644
--- a/dev/etherdump.cc
+++ b/dev/etherdump.cc
@@ -126,13 +126,27 @@ END_DECLARE_SIM_OBJECT_PARAMS(EtherDump)
BEGIN_INIT_SIM_OBJECT_PARAMS(EtherDump)
- INIT_PARAM_DFLT(file, "file to dump packets to", "")
+ INIT_PARAM(file, "file to dump packets to")
END_INIT_SIM_OBJECT_PARAMS(EtherDump)
CREATE_SIM_OBJECT(EtherDump)
{
- return new EtherDump(getInstanceName(), file);
+ string filename;
+ if (file.isValid()) {
+ filename = file;
+
+ if (filename[0] != '/' && !outputDirectory.empty())
+ filename = outputDirectory + filename;
+ } else {
+ if (outputDirectory.empty()) {
+ filename = "etherdump";
+ } else {
+ filename = outputDirectory + "etherdump";
+ }
+ }
+
+ return new EtherDump(getInstanceName(), filename);
}
REGISTER_SIM_OBJECT("EtherDump", EtherDump)