symtab.hh (2665:a124942bacb8) symtab.hh (2982:0ecdb0879b14)
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;

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

99 return false;
100
101 address = (*i).second;
102 return true;
103 }
104
105 /// Find the nearest symbol equal to or less than the supplied
106 /// address (e.g., the label for the enclosing function).
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;

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

99 return false;
100
101 address = (*i).second;
102 return true;
103 }
104
105 /// Find the nearest symbol equal to or less than the supplied
106 /// address (e.g., the label for the enclosing function).
107 /// @param address The address to look up.
108 /// @param symbol Return reference for symbol string.
109 /// @param sym_address Return reference for symbol address.
110 /// @param next_sym_address Address of following symbol (for
111 /// determining valid range of symbol).
107 /// @param addr The address to look up.
108 /// @param symbol Return reference for symbol string.
109 /// @param symaddr Return reference for symbol address.
110 /// @param nextaddr Address of following symbol (for
111 /// determining valid range of symbol).
112 /// @retval True if a symbol was found.
113 bool
114 findNearestSymbol(Addr addr, std::string &symbol, Addr &symaddr,
115 Addr &nextaddr) const
116 {
117 ATable::const_iterator i;
118 if (!upperBound(addr, i))
119 return false;
120
121 nextaddr = i->first;
122 --i;
123 symaddr = i->first;
124 symbol = i->second;
125 return true;
126 }
127
128 /// Overload for findNearestSymbol() for callers who don't care
112 /// @retval True if a symbol was found.
113 bool
114 findNearestSymbol(Addr addr, std::string &symbol, Addr &symaddr,
115 Addr &nextaddr) const
116 {
117 ATable::const_iterator i;
118 if (!upperBound(addr, i))
119 return false;
120
121 nextaddr = i->first;
122 --i;
123 symaddr = i->first;
124 symbol = i->second;
125 return true;
126 }
127
128 /// Overload for findNearestSymbol() for callers who don't care
129 /// about next_sym_address.
129 /// about nextaddr.
130 bool
131 findNearestSymbol(Addr addr, std::string &symbol, Addr &symaddr) const
132 {
133 ATable::const_iterator i;
134 if (!upperBound(addr, i))
135 return false;
136
137 --i;

--- 39 unchanged lines hidden ---
130 bool
131 findNearestSymbol(Addr addr, std::string &symbol, Addr &symaddr) const
132 {
133 ATable::const_iterator i;
134 if (!upperBound(addr, i))
135 return false;
136
137 --i;

--- 39 unchanged lines hidden ---