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

Unified Diff: base/debug/stack_trace_ios.mm

Issue 136033004: Use posix version of stack_trace on iOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: base/debug/stack_trace_ios.mm
diff --git a/base/debug/stack_trace_ios.mm b/base/debug/stack_trace_ios.mm
deleted file mode 100644
index 998dd0dfc693b0baf73de8c874d999bc3a6a6ea7..0000000000000000000000000000000000000000
--- a/base/debug/stack_trace_ios.mm
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import <Foundation/Foundation.h>
-#include <mach/task.h>
-#include <stdio.h>
-
-#include "base/logging.h"
-
-// This is just enough of a shim to let the support needed by test_support
-// link.
-
-namespace base {
-namespace debug {
-
-namespace {
-
-void StackDumpSignalHandler(int signal) {
- // TODO(phajdan.jr): Fix async-signal unsafety.
- LOG(ERROR) << "Received signal " << signal;
- NSArray *stack_symbols = [NSThread callStackSymbols];
- for (NSString* stack_symbol in stack_symbols) {
- fprintf(stderr, "\t%s\n", [stack_symbol UTF8String]);
- }
- _exit(1);
-}
-
-} // namespace
-
-// TODO(phajdan.jr): Deduplicate, see copy in stack_trace_posix.cc.
-bool EnableInProcessStackDumping() {
- // When running in an application, our code typically expects SIGPIPE
- // to be ignored. Therefore, when testing that same code, it should run
- // with SIGPIPE ignored as well.
- struct sigaction action;
- action.sa_handler = SIG_IGN;
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
- bool success = (sigaction(SIGPIPE, &action, NULL) == 0);
-
- success &= (signal(SIGILL, &StackDumpSignalHandler) != SIG_ERR);
- success &= (signal(SIGABRT, &StackDumpSignalHandler) != SIG_ERR);
- success &= (signal(SIGFPE, &StackDumpSignalHandler) != SIG_ERR);
- success &= (signal(SIGBUS, &StackDumpSignalHandler) != SIG_ERR);
- success &= (signal(SIGSEGV, &StackDumpSignalHandler) != SIG_ERR);
- success &= (signal(SIGSYS, &StackDumpSignalHandler) != SIG_ERR);
-
- return success;
-}
-
-} // namespace debug
-} // namespace base
« no previous file with comments | « base/base.gypi ('k') | base/debug/stack_trace_posix.cc » ('j') | base/debug/stack_trace_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698