diff options
author | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-10-07 15:57:23 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-10-07 15:57:23 +0000 |
commit | 9525fcd6338ac1697f26306216f579fa60cba657 (patch) | |
tree | 43b69333262270f3b4373c0e562206cb8c807430 /src/client/mac/handler/dynamic_images.cc | |
parent | 10.4 SDK fix (diff) | |
download | breakpad-9525fcd6338ac1697f26306216f579fa60cba657.tar.xz |
#ifdef cpu specific code.
Review URL: http://breakpad.appspot.com/307002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@848 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/handler/dynamic_images.cc')
-rw-r--r-- | src/client/mac/handler/dynamic_images.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/client/mac/handler/dynamic_images.cc b/src/client/mac/handler/dynamic_images.cc index c6499e68..11f4e95d 100644 --- a/src/client/mac/handler/dynamic_images.cc +++ b/src/client/mac/handler/dynamic_images.cc @@ -35,19 +35,23 @@ extern "C" { // needed to compile on Leopard #include <stdio.h> } -#include "breakpad_nlist_64.h" -#include <AvailabilityMacros.h> #include <assert.h> -#include <CoreServices/CoreServices.h> +#include <AvailabilityMacros.h> #include <dlfcn.h> #include <mach/mach_vm.h> #include <mach/task_info.h> #include <sys/sysctl.h> +#include <TargetConditionals.h> #include <algorithm> #include <string> #include <vector> +#include "breakpad_nlist_64.h" + +#if !TARGET_OS_IPHONE +#include <CoreServices/CoreServices.h> + #ifndef MAC_OS_X_VERSION_10_6 #define MAC_OS_X_VERSION_10_6 1060 #endif @@ -67,6 +71,8 @@ typedef struct task_dyld_info *task_dyld_info_t; #endif +#endif // !TARGET_OS_IPHONE + namespace google_breakpad { using std::string; @@ -358,6 +364,11 @@ static uint64_t LookupSymbol(const char* symbol_name, return list.n_value; } +#if TARGET_OS_IPHONE +static bool HasTaskDyldInfo() { + return true; +} +#else static SInt32 GetOSVersionInternal() { SInt32 os_version = 0; Gestalt(gestaltSystemVersion, &os_version); @@ -369,16 +380,17 @@ static SInt32 GetOSVersion() { return os_version; } -static bool IsSnowLeopardOrLater() { +static bool HasTaskDyldInfo() { #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 return true; #else return GetOSVersion() >= 0x1060; #endif } +#endif // TARGET_OS_IPHONE uint64_t DynamicImages::GetDyldAllImageInfosPointer() { - if (IsSnowLeopardOrLater()) { + if (HasTaskDyldInfo()) { task_dyld_info_data_t task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; if (task_info(task_, TASK_DYLD_INFO, (task_info_t)&task_dyld_info, |