minidump.h.svn-base

来自「SumatraPDF是一款小型开源的pdf阅读工具。虽然玲珑小巧(只有800多K」· SVN-BASE 代码 · 共 885 行 · 第 1/3 页

SVN-BASE
885
字号
  // Print a human-readable representation of the object to stdout.  void Print(); private:  // These objects are managed by MinidumpThreadList.  friend class MinidumpThreadList;  explicit MinidumpThread(Minidump* minidump);  // This works like MinidumpStream::Read, but is driven by  // MinidumpThreadList.  No size checking is done, because  // MinidumpThreadList handles that directly.  bool Read();  MDRawThread           thread_;  MinidumpMemoryRegion* memory_;  MinidumpContext*      context_;};// MinidumpThreadList contains all of the threads (as MinidumpThreads) in// a process.class MinidumpThreadList : public MinidumpStream { public:  virtual ~MinidumpThreadList();  static void set_max_threads(u_int32_t max_threads) {    max_threads_ = max_threads;  }  static u_int32_t max_threads() { return max_threads_; }  unsigned int thread_count() const { return valid_ ? thread_count_ : 0; }  // Sequential access to threads.  MinidumpThread* GetThreadAtIndex(unsigned int index) const;  // Random access to threads.  MinidumpThread* GetThreadByID(u_int32_t thread_id);  // Print a human-readable representation of the object to stdout.  void Print(); private:  friend class Minidump;  typedef map<u_int32_t, MinidumpThread*> IDToThreadMap;  typedef vector<MinidumpThread> MinidumpThreads;  static const u_int32_t kStreamType = MD_THREAD_LIST_STREAM;  explicit MinidumpThreadList(Minidump* aMinidump);  bool Read(u_int32_t aExpectedSize);  // The largest number of threads that will be read from a minidump.  The  // default is 256.  static u_int32_t max_threads_;  // Access to threads using the thread ID as the key.  IDToThreadMap    id_to_thread_map_;  // The list of threads.  MinidumpThreads* threads_;  u_int32_t        thread_count_;};// MinidumpModule wraps MDRawModule, which contains information about loaded// code modules.  Access is provided to various data referenced indirectly// by MDRawModule, such as the module's name and a specification for where// to locate debugging information for the module.class MinidumpModule : public MinidumpObject,                       public CodeModule { public:  virtual ~MinidumpModule();  static void set_max_cv_bytes(u_int32_t max_cv_bytes) {    max_cv_bytes_ = max_cv_bytes;  }  static u_int32_t max_cv_bytes() { return max_cv_bytes_; }  static void set_max_misc_bytes(u_int32_t max_misc_bytes) {    max_misc_bytes_ = max_misc_bytes;  }  static u_int32_t max_misc_bytes() { return max_misc_bytes_; }  const MDRawModule* module() const { return valid_ ? &module_ : NULL; }  // CodeModule implementation  virtual u_int64_t base_address() const {    return valid_ ? module_.base_of_image : static_cast<u_int64_t>(-1);  }  virtual u_int64_t size() const { return valid_ ? module_.size_of_image : 0; }  virtual string code_file() const;  virtual string code_identifier() const;  virtual string debug_file() const;  virtual string debug_identifier() const;  virtual string version() const;  virtual const CodeModule* Copy() const;  // The CodeView record, which contains information to locate the module's  // debugging information (pdb).  This is returned as u_int8_t* because  // the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be  // of a type unknown to Breakpad, in which case the raw data will still be  // returned but no byte-swapping will have been performed.  Check the  // record's signature in the first four bytes to differentiate between  // the various types.  Current toolchains generate modules which carry  // MDCVInfoPDB70 by default.  Returns a pointer to the CodeView record on  // success, and NULL on failure.  On success, the optional |size| argument  // is set to the size of the CodeView record.  const u_int8_t* GetCVRecord(u_int32_t* size);  // The miscellaneous debug record, which is obsolete.  Current toolchains  // do not generate this type of debugging information (dbg), and this  // field is not expected to be present.  Returns a pointer to the debugging  // record on success, and NULL on failure.  On success, the optional |size|  // argument is set to the size of the debugging record.  const MDImageDebugMisc* GetMiscRecord(u_int32_t* size);  // Print a human-readable representation of the object to stdout.  void Print(); private:  // These objects are managed by MinidumpModuleList.  friend class MinidumpModuleList;  explicit MinidumpModule(Minidump* minidump);  // This works like MinidumpStream::Read, but is driven by  // MinidumpModuleList.  No size checking is done, because  // MinidumpModuleList handles that directly.  bool Read();  // Reads indirectly-referenced data, including the module name, CodeView  // record, and miscellaneous debugging record.  This is necessary to allow  // MinidumpModuleList to fully construct MinidumpModule objects without  // requiring seeks to read a contiguous set of MinidumpModule objects.  // All auxiliary data should be available when Read is called, in order to  // allow the CodeModule getters to be const methods.  bool ReadAuxiliaryData();  // The largest number of bytes that will be read from a minidump for a  // CodeView record or miscellaneous debugging record, respectively.  The  // default for each is 1024.  static u_int32_t max_cv_bytes_;  static u_int32_t max_misc_bytes_;  // True after a successful Read.  This is different from valid_, which is  // not set true until ReadAuxiliaryData also completes successfully.  // module_valid_ is only used by ReadAuxiliaryData and the functions it  // calls to determine whether the object is ready for auxiliary data to   // be read.  bool              module_valid_;  MDRawModule       module_;  // Cached module name.  const string*     name_;  // Cached CodeView record - this is MDCVInfoPDB20 or (likely)  // MDCVInfoPDB70, or possibly something else entirely.  Stored as a u_int8_t  // because the structure contains a variable-sized string and its exact  // size cannot be known until it is processed.  vector<u_int8_t>* cv_record_;  // If cv_record_ is present, cv_record_signature_ contains a copy of the  // CodeView record's first four bytes, for ease of determinining the  // type of structure that cv_record_ contains.  u_int32_t cv_record_signature_;  // Cached MDImageDebugMisc (usually not present), stored as u_int8_t  // because the structure contains a variable-sized string and its exact  // size cannot be known until it is processed.  vector<u_int8_t>* misc_record_;};// MinidumpModuleList contains all of the loaded code modules for a process// in the form of MinidumpModules.  It maintains a map of these modules// so that it may easily provide a code module corresponding to a specific// address.class MinidumpModuleList : public MinidumpStream,                           public CodeModules { public:  virtual ~MinidumpModuleList();  static void set_max_modules(u_int32_t max_modules) {    max_modules_ = max_modules;  }  static u_int32_t max_modules() { return max_modules_; }  // CodeModules implementation.  virtual unsigned int module_count() const {    return valid_ ? module_count_ : 0;  }  virtual const MinidumpModule* GetModuleForAddress(u_int64_t address) const;  virtual const MinidumpModule* GetMainModule() const;  virtual const MinidumpModule* GetModuleAtSequence(      unsigned int sequence) const;  virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const;  virtual const CodeModules* Copy() const;  // Print a human-readable representation of the object to stdout.  void Print(); private:  friend class Minidump;  typedef vector<MinidumpModule> MinidumpModules;  static const u_int32_t kStreamType = MD_MODULE_LIST_STREAM;  explicit MinidumpModuleList(Minidump* minidump);  bool Read(u_int32_t expected_size);  // The largest number of modules that will be read from a minidump.  The  // default is 1024.  static u_int32_t max_modules_;  // Access to modules using addresses as the key.  RangeMap<u_int64_t, unsigned int> *range_map_;  MinidumpModules *modules_;  u_int32_t module_count_;};// MinidumpMemoryList corresponds to a minidump's MEMORY_LIST_STREAM stream,// which references the snapshots of all of the memory regions contained// within the minidump.  For a normal minidump, this includes stack memory// (also referenced by each MinidumpThread, in fact, the MDMemoryDescriptors// here and in MDRawThread both point to exactly the same data in a// minidump file, conserving space), as well as a 256-byte snapshot of memory// surrounding the instruction pointer in the case of an exception.  Other// types of minidumps may contain significantly more memory regions.  Full-// memory minidumps contain all of a process' mapped memory.class MinidumpMemoryList : public MinidumpStream { public:  virtual ~MinidumpMemoryList();  static void set_max_regions(u_int32_t max_regions) {    max_regions_ = max_regions;  }  static u_int32_t max_regions() { return max_regions_; }  unsigned int region_count() const { return valid_ ? region_count_ : 0; }  // Sequential access to memory regions.  MinidumpMemoryRegion* GetMemoryRegionAtIndex(unsigned int index);  // Random access to memory regions.  Returns the region encompassing  // the address identified by address.  MinidumpMemoryRegion* GetMemoryRegionForAddress(u_int64_t address);  // Print a human-readable representation of the object to stdout.  void Print(); private:  friend class Minidump;  typedef vector<MDMemoryDescriptor>   MemoryDescriptors;  typedef vector<MinidumpMemoryRegion> MemoryRegions;  static const u_int32_t kStreamType = MD_MEMORY_LIST_STREAM;  explicit MinidumpMemoryList(Minidump* minidump);  bool Read(u_int32_t expected_size);  // The largest number of memory regions that will be read from a minidump.  // The default is 256.  static u_int32_t max_regions_;  // Access to memory regions using addresses as the key.  RangeMap<u_int64_t, unsigned int> *range_map_;  // The list of descriptors.  This is maintained separately from the list  // of regions, because MemoryRegion doesn't own its MemoryDescriptor, it  // maintains a pointer to it.  descriptors_ provides the storage for this  // purpose.  MemoryDescriptors *descriptors_;  // The list of regions.  MemoryRegions *regions_;  u_int32_t region_count_;};// MinidumpException wraps MDRawExceptionStream, which contains information// about the exception that caused the minidump to be generated, if the// minidump was generated in an exception handler called as a result of// an exception.  It also provides access to a MinidumpContext object,// which contains the CPU context for the exception thread at the time// the exception occurred.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?