/thirdparty/breakpad/google_breakpad/processor/code_module.h

http://github.com/tomahawk-player/tomahawk · C Header · 94 lines · 20 code · 16 blank · 58 comment · 0 complexity · c3545e4de54371faaa841833cfc13cfb MD5 · raw file

  1. // Copyright (c) 2006, Google Inc.
  2. // All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. // code_module.h: Carries information about code modules that are loaded
  30. // into a process.
  31. //
  32. // Author: Mark Mentovai
  33. #ifndef GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__
  34. #define GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__
  35. #include <string>
  36. #include "google_breakpad/common/breakpad_types.h"
  37. namespace google_breakpad {
  38. using std::string;
  39. class CodeModule {
  40. public:
  41. virtual ~CodeModule() {}
  42. // The base address of this code module as it was loaded by the process.
  43. // (u_int64_t)-1 on error.
  44. virtual u_int64_t base_address() const = 0;
  45. // The size of the code module. 0 on error.
  46. virtual u_int64_t size() const = 0;
  47. // The path or file name that the code module was loaded from. Empty on
  48. // error.
  49. virtual string code_file() const = 0;
  50. // An identifying string used to discriminate between multiple versions and
  51. // builds of the same code module. This may contain a uuid, timestamp,
  52. // version number, or any combination of this or other information, in an
  53. // implementation-defined format. Empty on error.
  54. virtual string code_identifier() const = 0;
  55. // The filename containing debugging information associated with the code
  56. // module. If debugging information is stored in a file separate from the
  57. // code module itself (as is the case when .pdb or .dSYM files are used),
  58. // this will be different from code_file. If debugging information is
  59. // stored in the code module itself (possibly prior to stripping), this
  60. // will be the same as code_file. Empty on error.
  61. virtual string debug_file() const = 0;
  62. // An identifying string similar to code_identifier, but identifies a
  63. // specific version and build of the associated debug file. This may be
  64. // the same as code_identifier when the debug_file and code_file are
  65. // identical or when the same identifier is used to identify distinct
  66. // debug and code files.
  67. virtual string debug_identifier() const = 0;
  68. // A human-readable representation of the code module's version. Empty on
  69. // error.
  70. virtual string version() const = 0;
  71. // Creates a new copy of this CodeModule object, which the caller takes
  72. // ownership of. The new CodeModule may be of a different concrete class
  73. // than the CodeModule being copied, but will behave identically to the
  74. // copied CodeModule as far as the CodeModule interface is concerned.
  75. virtual const CodeModule* Copy() const = 0;
  76. };
  77. } // namespace google_breakpad
  78. #endif // GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__