| OLD | NEW |
| 1 // Copyright (c) 2010 Google Inc. All Rights Reserved. | 1 // Copyright (c) 2010 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following disclaimer | 10 // copyright notice, this list of conditions and the following disclaimer |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 // Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> | 29 // Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> |
| 30 | 30 |
| 31 // dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class. | 31 // dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class. |
| 32 // See dwarf2diehandler.h for details. | 32 // See dwarf2diehandler.h for details. |
| 33 | 33 |
| 34 #include <assert.h> | 34 #include <assert.h> |
| 35 #include <stdint.h> |
| 35 | 36 |
| 36 #include <string> | 37 #include <string> |
| 37 | 38 |
| 38 #include "common/dwarf/dwarf2diehandler.h" | 39 #include "common/dwarf/dwarf2diehandler.h" |
| 39 #include "common/using_std_string.h" | 40 #include "common/using_std_string.h" |
| 40 | 41 |
| 41 namespace dwarf2reader { | 42 namespace dwarf2reader { |
| 42 | 43 |
| 43 DIEDispatcher::~DIEDispatcher() { | 44 DIEDispatcher::~DIEDispatcher() { |
| 44 while (!die_handlers_.empty()) { | 45 while (!die_handlers_.empty()) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 uint64 data) { | 161 uint64 data) { |
| 161 HandlerStack ¤t = die_handlers_.top(); | 162 HandlerStack ¤t = die_handlers_.top(); |
| 162 // This had better be an attribute of the DIE we were meant to handle. | 163 // This had better be an attribute of the DIE we were meant to handle. |
| 163 assert(offset == current.offset_); | 164 assert(offset == current.offset_); |
| 164 current.handler_->ProcessAttributeReference(attr, form, data); | 165 current.handler_->ProcessAttributeReference(attr, form, data); |
| 165 } | 166 } |
| 166 | 167 |
| 167 void DIEDispatcher::ProcessAttributeBuffer(uint64 offset, | 168 void DIEDispatcher::ProcessAttributeBuffer(uint64 offset, |
| 168 enum DwarfAttribute attr, | 169 enum DwarfAttribute attr, |
| 169 enum DwarfForm form, | 170 enum DwarfForm form, |
| 170 const char* data, | 171 const uint8_t *data, |
| 171 uint64 len) { | 172 uint64 len) { |
| 172 HandlerStack ¤t = die_handlers_.top(); | 173 HandlerStack ¤t = die_handlers_.top(); |
| 173 // This had better be an attribute of the DIE we were meant to handle. | 174 // This had better be an attribute of the DIE we were meant to handle. |
| 174 assert(offset == current.offset_); | 175 assert(offset == current.offset_); |
| 175 current.handler_->ProcessAttributeBuffer(attr, form, data, len); | 176 current.handler_->ProcessAttributeBuffer(attr, form, data, len); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void DIEDispatcher::ProcessAttributeString(uint64 offset, | 179 void DIEDispatcher::ProcessAttributeString(uint64 offset, |
| 179 enum DwarfAttribute attr, | 180 enum DwarfAttribute attr, |
| 180 enum DwarfForm form, | 181 enum DwarfForm form, |
| 181 const string& data) { | 182 const string& data) { |
| 182 HandlerStack ¤t = die_handlers_.top(); | 183 HandlerStack ¤t = die_handlers_.top(); |
| 183 // This had better be an attribute of the DIE we were meant to handle. | 184 // This had better be an attribute of the DIE we were meant to handle. |
| 184 assert(offset == current.offset_); | 185 assert(offset == current.offset_); |
| 185 current.handler_->ProcessAttributeString(attr, form, data); | 186 current.handler_->ProcessAttributeString(attr, form, data); |
| 186 } | 187 } |
| 187 | 188 |
| 188 void DIEDispatcher::ProcessAttributeSignature(uint64 offset, | 189 void DIEDispatcher::ProcessAttributeSignature(uint64 offset, |
| 189 enum DwarfAttribute attr, | 190 enum DwarfAttribute attr, |
| 190 enum DwarfForm form, | 191 enum DwarfForm form, |
| 191 uint64 signature) { | 192 uint64 signature) { |
| 192 HandlerStack ¤t = die_handlers_.top(); | 193 HandlerStack ¤t = die_handlers_.top(); |
| 193 // This had better be an attribute of the DIE we were meant to handle. | 194 // This had better be an attribute of the DIE we were meant to handle. |
| 194 assert(offset == current.offset_); | 195 assert(offset == current.offset_); |
| 195 current.handler_->ProcessAttributeSignature(attr, form, signature); | 196 current.handler_->ProcessAttributeSignature(attr, form, signature); |
| 196 } | 197 } |
| 197 | 198 |
| 198 } // namespace dwarf2reader | 199 } // namespace dwarf2reader |
| OLD | NEW |