OLD | NEW |
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, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 kern_return_t kr = task_info(mach_task_self(), | 72 kern_return_t kr = task_info(mach_task_self(), |
73 TASK_DYLD_INFO, | 73 TASK_DYLD_INFO, |
74 reinterpret_cast<task_info_t>(&dyld_info), | 74 reinterpret_cast<task_info_t>(&dyld_info), |
75 &count); | 75 &count); |
76 ASSERT_EQ(KERN_SUCCESS, kr); | 76 ASSERT_EQ(KERN_SUCCESS, kr); |
77 | 77 |
78 EXPECT_EQ(reinterpret_cast<mach_vm_address_t>(self_image_infos), | 78 EXPECT_EQ(reinterpret_cast<mach_vm_address_t>(self_image_infos), |
79 dyld_info.all_image_info_addr); | 79 dyld_info.all_image_info_addr); |
80 EXPECT_GT(dyld_info.all_image_info_size, 1u); | 80 EXPECT_GT(dyld_info.all_image_info_size, 1u); |
81 | 81 |
| 82 // This field is only present in the Mac OS X 10.7 SDK (at build time) and |
| 83 // kernel (at run time). |
82 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 | 84 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 |
| 85 if (MacOSXMinorVersion() >= 7) { |
83 #if !defined(ARCH_CPU_64_BITS) | 86 #if !defined(ARCH_CPU_64_BITS) |
84 EXPECT_EQ(TASK_DYLD_ALL_IMAGE_INFO_32, dyld_info.all_image_info_format); | 87 EXPECT_EQ(TASK_DYLD_ALL_IMAGE_INFO_32, dyld_info.all_image_info_format); |
85 #else | 88 #else |
86 EXPECT_EQ(TASK_DYLD_ALL_IMAGE_INFO_64, dyld_info.all_image_info_format); | 89 EXPECT_EQ(TASK_DYLD_ALL_IMAGE_INFO_64, dyld_info.all_image_info_format); |
87 #endif | 90 #endif |
| 91 } |
88 #endif | 92 #endif |
89 | 93 |
90 ProcessReader process_reader; | 94 ProcessReader process_reader; |
91 ASSERT_TRUE(process_reader.Initialize(mach_task_self())); | 95 ASSERT_TRUE(process_reader.Initialize(mach_task_self())); |
92 | 96 |
93 process_types::dyld_all_image_infos proctype_image_infos; | 97 process_types::dyld_all_image_infos proctype_image_infos; |
94 ASSERT_TRUE(proctype_image_infos.Read(&process_reader, | 98 ASSERT_TRUE(proctype_image_infos.Read(&process_reader, |
95 dyld_info.all_image_info_addr)); | 99 dyld_info.all_image_info_addr)); |
96 | 100 |
97 ASSERT_EQ(self_image_infos->version, proctype_image_infos.version); | 101 ASSERT_EQ(self_image_infos->version, proctype_image_infos.version); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 sizeof(self_uuid_info->imageUUID))) | 259 sizeof(self_uuid_info->imageUUID))) |
256 << "index " << index; | 260 << "index " << index; |
257 } | 261 } |
258 } | 262 } |
259 #endif | 263 #endif |
260 } | 264 } |
261 | 265 |
262 } // namespace | 266 } // namespace |
263 } // namespace test | 267 } // namespace test |
264 } // namespace crashpad | 268 } // namespace crashpad |
OLD | NEW |