symtab.hh (6214:1ec0ec8933ae) symtab.hh (10905:a6ca6831e775)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#ifndef __SYMTAB_HH__
33#define __SYMTAB_HH__
34
35#include <iosfwd>
36#include <map>
37#include <string>
38
39#include "base/types.hh"
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#ifndef __SYMTAB_HH__
33#define __SYMTAB_HH__
34
35#include <iosfwd>
36#include <map>
37#include <string>
38
39#include "base/types.hh"
40#include "sim/serialize.hh"
40
41
41class Checkpoint;
42class SymbolTable
43{
44 public:
45 typedef std::map<Addr, std::string> ATable;
46 typedef std::map<std::string, Addr> STable;
47
48 private:
49 ATable addrTable;

--- 21 unchanged lines hidden (view full) ---

71 void clear();
72 bool insert(Addr address, std::string symbol);
73 bool load(const std::string &file);
74
75 const ATable &getAddrTable() const { return addrTable; }
76 const STable &getSymbolTable() const { return symbolTable; }
77
78 public:
42class SymbolTable
43{
44 public:
45 typedef std::map<Addr, std::string> ATable;
46 typedef std::map<std::string, Addr> STable;
47
48 private:
49 ATable addrTable;

--- 21 unchanged lines hidden (view full) ---

71 void clear();
72 bool insert(Addr address, std::string symbol);
73 bool load(const std::string &file);
74
75 const ATable &getAddrTable() const { return addrTable; }
76 const STable &getSymbolTable() const { return symbolTable; }
77
78 public:
79 void serialize(const std::string &base, std::ostream &os);
80 void unserialize(const std::string &base, Checkpoint *cp,
81 const std::string &section);
79 void serialize(const std::string &base, CheckpointOut &cp) const;
80 void unserialize(const std::string &base, CheckpointIn &cp);
82
83 public:
84 bool
85 findSymbol(Addr address, std::string &symbol) const
86 {
87 ATable::const_iterator i = addrTable.find(address);
88 if (i == addrTable.end())
89 return false;

--- 88 unchanged lines hidden ---
81
82 public:
83 bool
84 findSymbol(Addr address, std::string &symbol) const
85 {
86 ATable::const_iterator i = addrTable.find(address);
87 if (i == addrTable.end())
88 return false;

--- 88 unchanged lines hidden ---