aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMStackTrace.h
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@google.com>2016-10-07 12:10:23 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-10-07 12:21:06 -0400
commit42124b3691197c3c4f52f069775fa0390a8ff942 (patch)
treeebd373d398ea64b45bdc1d196fa0a2c5f57cabfd /Foundation/GTMStackTrace.h
parent57eeab4193210df8ab0c81e9d3f1ee1ad3e24492 (diff)
First cut at pruning things/updating things.
Remove a bunch of code that Google stopped using/maintaining rather than trying to update it it. Some would be hard to update, some actually has system provided replacements; others are patterns that just don't seem as common now. Prune out the code related to macOS <= 10.5, start pruning some of the really old iOS support also. Get the projects mostly limping again with modern Xcodes so tests can be run. If someone ends up on this commit via history for something they still find as useful, feel free to do a pull request to bring the snippet of code back to life and update it for current SDKs.
Diffstat (limited to 'Foundation/GTMStackTrace.h')
-rw-r--r--Foundation/GTMStackTrace.h37
1 files changed, 7 insertions, 30 deletions
diff --git a/Foundation/GTMStackTrace.h b/Foundation/GTMStackTrace.h
index eb86a66..61398ab 100644
--- a/Foundation/GTMStackTrace.h
+++ b/Foundation/GTMStackTrace.h
@@ -6,9 +6,9 @@
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -32,10 +32,10 @@ struct GTMAddressDescriptor {
};
// Returns a string containing a nicely formatted stack trace.
-//
+//
// This function gets the stack trace for the current thread. It will
// be from the caller of GTMStackTrace upwards to the top the calling stack.
-// Typically this function will be used along with some logging,
+// Typically this function will be used along with some logging,
// as in the following:
//
// MyAppLogger(@"Should never get here:\n%@", GTMStackTrace());
@@ -53,41 +53,18 @@ struct GTMAddressDescriptor {
NSString *GTMStackTrace(void);
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 || \
- __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_2_0
// Returns a string containing a nicely formatted stack trace from the
-// exception. Only available on 10.5 or later, uses
+// exception. Only available on 10.5 or later, uses
// -[NSException callStackReturnAddresses].
//
NSString *GTMStackTraceFromException(NSException *e);
-#endif
-
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
-// Returns an array of program counters from the current thread's stack.
-// *** You should probably use GTMStackTrace() instead of this function ***
-// However, if you actually want all the PCs in "void *" form, then this
-// funtion is more convenient. This will include PCs of GTMStaceTrace and
-// its inner utility functions that you may want to strip out.
-//
-// You can use +[NSThread callStackReturnAddresses] in 10.5 or later.
-//
-// Args:
-// outPcs - an array of "void *" pointers to the program counters found on the
-// current thread's stack.
-// count - the number of entries in the outPcs array
-//
-// Returns:
-// The number of program counters actually added to outPcs.
-//
-NSUInteger GTMGetStackProgramCounters(void *outPcs[], NSUInteger count);
-#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
// Returns an array of GTMAddressDescriptors from the current thread's stack.
// *** You should probably use GTMStackTrace() instead of this function ***
// However, if you actually want all the PCs with symbols, this is the way
// to get them. There is no memory allocations done, so no clean up is required
// except for the caller to free outDescs if they allocated it themselves.
-// This will include PCs of GTMStaceTrace and its inner utility functions that
+// This will include PCs of GTMStaceTrace and its inner utility functions that
// you may want to strip out.
//
// Args:
@@ -98,7 +75,7 @@ NSUInteger GTMGetStackProgramCounters(void *outPcs[], NSUInteger count);
// Returns:
// The number of program counters actually added to outPcs.
//
-NSUInteger GTMGetStackAddressDescriptors(struct GTMAddressDescriptor outDescs[],
+NSUInteger GTMGetStackAddressDescriptors(struct GTMAddressDescriptor outDescs[],
NSUInteger count);
#ifdef __cplusplus