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

Side by Side Diff: snapshot/mac/process_types.h

Issue 666483002: Create snapshot/mac and move some files from snapshot and util to there (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad/+/master
Patch Set: Move process_reader, process_types, and mach_o_image*_reader from util/mac to snapshot/mac Created 6 years, 2 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
« no previous file with comments | « snapshot/mac/process_reader_test.cc ('k') | snapshot/mac/process_types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_UTIL_MAC_PROCESS_TYPES_H_ 15 #ifndef CRASHPAD_SNAPSHOT_MAC_PROCESS_TYPES_H_
16 #define CRASHPAD_UTIL_MAC_PROCESS_TYPES_H_ 16 #define CRASHPAD_SNAPSHOT_MAC_PROCESS_TYPES_H_
17 17
18 #include <mach/mach.h> 18 #include <mach/mach.h>
19 #include <mach-o/dyld_images.h> 19 #include <mach-o/dyld_images.h>
20 #include <mach-o/loader.h> 20 #include <mach-o/loader.h>
21 #include <stdint.h> 21 #include <stdint.h>
22 #include <sys/types.h> 22 #include <sys/types.h>
23 23
24 #include "util/mac/process_reader.h" 24 #include "snapshot/mac/process_reader.h"
25 25
26 namespace crashpad { 26 namespace crashpad {
27 namespace process_types { 27 namespace process_types {
28 namespace internal { 28 namespace internal {
29 29
30 // Some structure definitions differ in 32-bit and 64-bit environments by having 30 // Some structure definitions differ in 32-bit and 64-bit environments by having
31 // additional “reserved” padding fields present only in the 64-bit environment. 31 // additional “reserved” padding fields present only in the 64-bit environment.
32 // These Reserved64Only* types allow the process_types system to replicate these 32 // These Reserved64Only* types allow the process_types system to replicate these
33 // structures more precisely. 33 // structures more precisely.
34 typedef char Reserved64Only32[0]; 34 typedef char Reserved64Only32[0];
35 typedef uint32_t Reserved64Only64; 35 typedef uint32_t Reserved64Only64;
36 36
37 } // namespace internal 37 } // namespace internal
38 } // namespace process_types 38 } // namespace process_types
39 } // namespace crashpad 39 } // namespace crashpad
40 40
41 #include "util/mac/process_types/traits.h" 41 #include "snapshot/mac/process_types/traits.h"
42 42
43 // Creates the traits type crashpad::process_types::internal::TraitsGeneric. 43 // Creates the traits type crashpad::process_types::internal::TraitsGeneric.
44 DECLARE_PROCESS_TYPE_TRAITS_CLASS(Generic, 64) 44 DECLARE_PROCESS_TYPE_TRAITS_CLASS(Generic, 64)
45 45
46 #undef DECLARE_PROCESS_TYPE_TRAITS_CLASS 46 #undef DECLARE_PROCESS_TYPE_TRAITS_CLASS
47 47
48 // Declare the crashpad::process_types::struct_name structs. These are the 48 // Declare the crashpad::process_types::struct_name structs. These are the
49 // user-visible generic structs that callers will interact with. They read data 49 // user-visible generic structs that callers will interact with. They read data
50 // from 32-bit or 64-bit processes by using the specific internal templatized 50 // from 32-bit or 64-bit processes by using the specific internal templatized
51 // structs below. 51 // structs below.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 template <typename T> \ 104 template <typename T> \
105 static bool ReadArrayIntoInternal(ProcessReader* process_reader, \ 105 static bool ReadArrayIntoInternal(ProcessReader* process_reader, \
106 mach_vm_address_t address, \ 106 mach_vm_address_t address, \
107 size_t count, \ 107 size_t count, \
108 struct_name* generic); \ 108 struct_name* generic); \
109 size_t size_; \ 109 size_t size_; \
110 }; \ 110 }; \
111 } /* namespace process_types */ \ 111 } /* namespace process_types */ \
112 } /* namespace crashpad */ 112 } /* namespace crashpad */
113 113
114 #include "util/mac/process_types/all.proctype" 114 #include "snapshot/mac/process_types/all.proctype"
115 115
116 #undef PROCESS_TYPE_STRUCT_BEGIN 116 #undef PROCESS_TYPE_STRUCT_BEGIN
117 #undef PROCESS_TYPE_STRUCT_MEMBER 117 #undef PROCESS_TYPE_STRUCT_MEMBER
118 #undef PROCESS_TYPE_STRUCT_END 118 #undef PROCESS_TYPE_STRUCT_END
119 #undef PROCESS_TYPE_STRUCT_DECLARE 119 #undef PROCESS_TYPE_STRUCT_DECLARE
120 120
121 // Declare the templatized crashpad::process_types::internal::struct_name<> 121 // Declare the templatized crashpad::process_types::internal::struct_name<>
122 // structs. These are the 32-bit and 64-bit specific structs that describe the 122 // structs. These are the 32-bit and 64-bit specific structs that describe the
123 // layout of objects in another process. This is repeated instead of being 123 // layout of objects in another process. This is repeated instead of being
124 // shared with the generic declaration above because both the generic and 124 // shared with the generic declaration above because both the generic and
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 private: \ 166 private: \
167 /* ReadInto() is as in the generic user-visible struct above. */ \ 167 /* ReadInto() is as in the generic user-visible struct above. */ \
168 static bool ReadInto(ProcessReader* process_reader, \ 168 static bool ReadInto(ProcessReader* process_reader, \
169 mach_vm_address_t address, \ 169 mach_vm_address_t address, \
170 struct_name<Traits>* specific); \ 170 struct_name<Traits>* specific); \
171 }; \ 171 }; \
172 } /* namespace internal */ \ 172 } /* namespace internal */ \
173 } /* namespace process_types */ \ 173 } /* namespace process_types */ \
174 } /* namespace crashpad */ 174 } /* namespace crashpad */
175 175
176 #include "util/mac/process_types/all.proctype" 176 #include "snapshot/mac/process_types/all.proctype"
177 177
178 #undef PROCESS_TYPE_STRUCT_BEGIN 178 #undef PROCESS_TYPE_STRUCT_BEGIN
179 #undef PROCESS_TYPE_STRUCT_MEMBER 179 #undef PROCESS_TYPE_STRUCT_MEMBER
180 #undef PROCESS_TYPE_STRUCT_END 180 #undef PROCESS_TYPE_STRUCT_END
181 #undef PROCESS_TYPE_STRUCT_DECLARE_INTERNAL 181 #undef PROCESS_TYPE_STRUCT_DECLARE_INTERNAL
182 182
183 #endif // CRASHPAD_UTIL_MAC_PROCESS_TYPES_H_ 183 #endif // CRASHPAD_SNAPSHOT_MAC_PROCESS_TYPES_H_
OLDNEW
« no previous file with comments | « snapshot/mac/process_reader_test.cc ('k') | snapshot/mac/process_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698