| OLD | NEW |
| 1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 class BasicCodeModule : public CodeModule { | 51 class BasicCodeModule : public CodeModule { |
| 52 public: | 52 public: |
| 53 // Creates a new BasicCodeModule given any existing CodeModule | 53 // Creates a new BasicCodeModule given any existing CodeModule |
| 54 // implementation. This is useful to make a copy of the data relevant to | 54 // implementation. This is useful to make a copy of the data relevant to |
| 55 // the CodeModule interface without requiring all of the resources that | 55 // the CodeModule interface without requiring all of the resources that |
| 56 // other CodeModule implementations may require. | 56 // other CodeModule implementations may require. |
| 57 explicit BasicCodeModule(const CodeModule *that) | 57 explicit BasicCodeModule(const CodeModule *that) |
| 58 : base_address_(that->base_address()), | 58 : base_address_(that->base_address()), |
| 59 size_(that->size()), | 59 size_(that->size()), |
| 60 shrink_down_delta_(that->shrink_down_delta()), |
| 60 code_file_(that->code_file()), | 61 code_file_(that->code_file()), |
| 61 code_identifier_(that->code_identifier()), | 62 code_identifier_(that->code_identifier()), |
| 62 debug_file_(that->debug_file()), | 63 debug_file_(that->debug_file()), |
| 63 debug_identifier_(that->debug_identifier()), | 64 debug_identifier_(that->debug_identifier()), |
| 64 version_(that->version()) {} | 65 version_(that->version()) {} |
| 65 | 66 |
| 66 BasicCodeModule(uint64_t base_address, uint64_t size, | 67 BasicCodeModule(uint64_t base_address, uint64_t size, |
| 67 » » const string &code_file, | 68 const string &code_file, |
| 68 » » const string &code_identifier, | 69 const string &code_identifier, |
| 69 » » const string &debug_file, | 70 const string &debug_file, |
| 70 » » const string &debug_identifier, | 71 const string &debug_identifier, |
| 71 » » const string &version) | 72 const string &version) |
| 72 : base_address_(base_address), | 73 : base_address_(base_address), |
| 73 size_(size), | 74 size_(size), |
| 74 code_file_(code_file), | 75 shrink_down_delta_(0), |
| 75 code_identifier_(code_identifier), | 76 code_file_(code_file), |
| 76 debug_file_(debug_file), | 77 code_identifier_(code_identifier), |
| 77 debug_identifier_(debug_identifier), | 78 debug_file_(debug_file), |
| 78 version_(version) | 79 debug_identifier_(debug_identifier), |
| 80 version_(version) |
| 79 {} | 81 {} |
| 80 virtual ~BasicCodeModule() {} | 82 virtual ~BasicCodeModule() {} |
| 81 | 83 |
| 82 // See code_module.h for descriptions of these methods and the associated | 84 // See code_module.h for descriptions of these methods and the associated |
| 83 // members. | 85 // members. |
| 84 virtual uint64_t base_address() const { return base_address_; } | 86 virtual uint64_t base_address() const { return base_address_; } |
| 85 virtual uint64_t size() const { return size_; } | 87 virtual uint64_t size() const { return size_; } |
| 88 virtual uint64_t shrink_down_delta() const { return shrink_down_delta_; } |
| 89 virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) { |
| 90 shrink_down_delta_ = shrink_down_delta; |
| 91 } |
| 86 virtual string code_file() const { return code_file_; } | 92 virtual string code_file() const { return code_file_; } |
| 87 virtual string code_identifier() const { return code_identifier_; } | 93 virtual string code_identifier() const { return code_identifier_; } |
| 88 virtual string debug_file() const { return debug_file_; } | 94 virtual string debug_file() const { return debug_file_; } |
| 89 virtual string debug_identifier() const { return debug_identifier_; } | 95 virtual string debug_identifier() const { return debug_identifier_; } |
| 90 virtual string version() const { return version_; } | 96 virtual string version() const { return version_; } |
| 91 virtual const CodeModule* Copy() const { return new BasicCodeModule(this); } | 97 virtual CodeModule* Copy() const { return new BasicCodeModule(this); } |
| 92 | 98 |
| 93 private: | 99 private: |
| 94 uint64_t base_address_; | 100 uint64_t base_address_; |
| 95 uint64_t size_; | 101 uint64_t size_; |
| 102 uint64_t shrink_down_delta_; |
| 96 string code_file_; | 103 string code_file_; |
| 97 string code_identifier_; | 104 string code_identifier_; |
| 98 string debug_file_; | 105 string debug_file_; |
| 99 string debug_identifier_; | 106 string debug_identifier_; |
| 100 string version_; | 107 string version_; |
| 101 | 108 |
| 102 // Disallow copy constructor and assignment operator. | 109 // Disallow copy constructor and assignment operator. |
| 103 BasicCodeModule(const BasicCodeModule &that); | 110 BasicCodeModule(const BasicCodeModule &that); |
| 104 void operator=(const BasicCodeModule &that); | 111 void operator=(const BasicCodeModule &that); |
| 105 }; | 112 }; |
| 106 | 113 |
| 107 } // namespace google_breakpad | 114 } // namespace google_breakpad |
| 108 | 115 |
| 109 #endif // PROCESSOR_BASIC_CODE_MODULE_H__ | 116 #endif // PROCESSOR_BASIC_CODE_MODULE_H__ |
| OLD | NEW |