summaryrefslogtreecommitdiff
path: root/src/base/loader
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/loader')
-rw-r--r--src/base/loader/symtab.cc17
-rw-r--r--src/base/loader/symtab.hh7
2 files changed, 11 insertions, 13 deletions
diff --git a/src/base/loader/symtab.cc b/src/base/loader/symtab.cc
index 2c868a9b1..439394852 100644
--- a/src/base/loader/symtab.cc
+++ b/src/base/loader/symtab.cc
@@ -108,32 +108,31 @@ SymbolTable::load(const string &filename)
}
void
-SymbolTable::serialize(const string &base, ostream &os)
+SymbolTable::serialize(const string &base, CheckpointOut &cp) const
{
- paramOut(os, base + ".size", addrTable.size());
+ paramOut(cp, base + ".size", addrTable.size());
int i = 0;
ATable::const_iterator p, end = addrTable.end();
for (p = addrTable.begin(); p != end; ++p) {
- paramOut(os, csprintf("%s.addr_%d", base, i), p->first);
- paramOut(os, csprintf("%s.symbol_%d", base, i), p->second);
+ paramOut(cp, csprintf("%s.addr_%d", base, i), p->first);
+ paramOut(cp, csprintf("%s.symbol_%d", base, i), p->second);
++i;
}
}
void
-SymbolTable::unserialize(const string &base, Checkpoint *cp,
- const string &section)
+SymbolTable::unserialize(const string &base, CheckpointIn &cp)
{
clear();
int size;
- paramIn(cp, section, base + ".size", size);
+ paramIn(cp, base + ".size", size);
for (int i = 0; i < size; ++i) {
Addr addr;
std::string symbol;
- paramIn(cp, section, csprintf("%s.addr_%d", base, i), addr);
- paramIn(cp, section, csprintf("%s.symbol_%d", base, i), symbol);
+ paramIn(cp, csprintf("%s.addr_%d", base, i), addr);
+ paramIn(cp, csprintf("%s.symbol_%d", base, i), symbol);
insert(addr, symbol);
}
}
diff --git a/src/base/loader/symtab.hh b/src/base/loader/symtab.hh
index 2a2fd068e..403cb13ac 100644
--- a/src/base/loader/symtab.hh
+++ b/src/base/loader/symtab.hh
@@ -37,8 +37,8 @@
#include <string>
#include "base/types.hh"
+#include "sim/serialize.hh"
-class Checkpoint;
class SymbolTable
{
public:
@@ -76,9 +76,8 @@ class SymbolTable
const STable &getSymbolTable() const { return symbolTable; }
public:
- void serialize(const std::string &base, std::ostream &os);
- void unserialize(const std::string &base, Checkpoint *cp,
- const std::string &section);
+ void serialize(const std::string &base, CheckpointOut &cp) const;
+ void unserialize(const std::string &base, CheckpointIn &cp);
public:
bool