Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: src/processor/basic_code_modules.h

Issue 2060663002: Server-side workaround to handle overlapping modules. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Fixing whitespace Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 25 matching lines...) Expand all
36 // implementation a place to store information when the life of the original 36 // implementation a place to store information when the life of the original
37 // object (such as a MinidumpModuleList) cannot be guaranteed. 37 // object (such as a MinidumpModuleList) cannot be guaranteed.
38 // 38 //
39 // Author: Mark Mentovai 39 // Author: Mark Mentovai
40 40
41 #ifndef PROCESSOR_BASIC_CODE_MODULES_H__ 41 #ifndef PROCESSOR_BASIC_CODE_MODULES_H__
42 #define PROCESSOR_BASIC_CODE_MODULES_H__ 42 #define PROCESSOR_BASIC_CODE_MODULES_H__
43 43
44 #include <stddef.h> 44 #include <stddef.h>
45 45
46 #include <vector>
47
46 #include "google_breakpad/processor/code_modules.h" 48 #include "google_breakpad/processor/code_modules.h"
47 #include "processor/linked_ptr.h" 49 #include "processor/linked_ptr.h"
48 #include "processor/range_map.h" 50 #include "processor/range_map.h"
49 51
50 namespace google_breakpad { 52 namespace google_breakpad {
51 53
52 class BasicCodeModules : public CodeModules { 54 class BasicCodeModules : public CodeModules {
53 public: 55 public:
54 // Creates a new BasicCodeModules object given any existing CodeModules 56 // Creates a new BasicCodeModules object given any existing CodeModules
55 // implementation. This is useful to make a copy of the data relevant to 57 // implementation. This is useful to make a copy of the data relevant to
56 // the CodeModules and CodeModule interfaces without requiring all of the 58 // the CodeModules and CodeModule interfaces without requiring all of the
57 // resources that other implementations may require. A copy will be 59 // resources that other implementations may require. A copy will be
58 // made of each contained CodeModule using CodeModule::Copy. 60 // made of each contained CodeModule using CodeModule::Copy.
59 explicit BasicCodeModules(const CodeModules *that); 61 explicit BasicCodeModules(const CodeModules *that);
60 62
61 virtual ~BasicCodeModules(); 63 virtual ~BasicCodeModules();
62 64
63 // See code_modules.h for descriptions of these methods. 65 // See code_modules.h for descriptions of these methods.
64 virtual unsigned int module_count() const; 66 virtual unsigned int module_count() const;
65 virtual const CodeModule* GetModuleForAddress(uint64_t address) const; 67 virtual const CodeModule* GetModuleForAddress(uint64_t address) const;
66 virtual const CodeModule* GetMainModule() const; 68 virtual const CodeModule* GetMainModule() const;
67 virtual const CodeModule* GetModuleAtSequence(unsigned int sequence) const; 69 virtual const CodeModule* GetModuleAtSequence(unsigned int sequence) const;
68 virtual const CodeModule* GetModuleAtIndex(unsigned int index) const; 70 virtual const CodeModule* GetModuleAtIndex(unsigned int index) const;
69 virtual const CodeModules* Copy() const; 71 virtual const CodeModules* Copy() const;
72 virtual std::vector<linked_ptr<const CodeModule> >
73 GetShrunkRangeModules() const;
70 74
71 protected: 75 protected:
72 BasicCodeModules(); 76 BasicCodeModules();
73 77
74 // The base address of the main module. 78 // The base address of the main module.
75 uint64_t main_address_; 79 uint64_t main_address_;
76 80
77 // The map used to contain each CodeModule, keyed by each CodeModule's 81 // The map used to contain each CodeModule, keyed by each CodeModule's
78 // address range. 82 // address range.
79 RangeMap<uint64_t, linked_ptr<const CodeModule> > map_; 83 RangeMap<uint64_t, linked_ptr<const CodeModule> > map_;
80 84
85 // A vector of all CodeModules that were shrunk downs due to
86 // address range conflicts.
87 std::vector<linked_ptr<const CodeModule> > shrunk_range_modules_;
88
81 private: 89 private:
82 // Disallow copy constructor and assignment operator. 90 // Disallow copy constructor and assignment operator.
83 BasicCodeModules(const BasicCodeModules &that); 91 BasicCodeModules(const BasicCodeModules &that);
84 void operator=(const BasicCodeModules &that); 92 void operator=(const BasicCodeModules &that);
85 }; 93 };
86 94
87 } // namespace google_breakpad 95 } // namespace google_breakpad
88 96
89 #endif // PROCESSOR_BASIC_CODE_MODULES_H__ 97 #endif // PROCESSOR_BASIC_CODE_MODULES_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698