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

Side by Side Diff: src/base/debug/stack_trace.cc

Issue 2248393002: Replace DumpBacktrace with Chromium's StackTrace implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Comments Created 4 years, 4 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 | « src/base/debug/stack_trace.h ('k') | src/base/debug/stack_trace_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/base/debug/stack_trace.h"
6
7 #include <string.h>
8
9 #include <algorithm>
10 #include <sstream>
11
12 #include "src/base/macros.h"
13
14 namespace v8 {
15 namespace base {
16 namespace debug {
17
18 StackTrace::StackTrace(const void* const* trace, size_t count) {
19 count = std::min(count, arraysize(trace_));
20 if (count) memcpy(trace_, trace, count * sizeof(trace_[0]));
21 count_ = count;
22 }
23
24 StackTrace::~StackTrace() {}
25
26 const void* const* StackTrace::Addresses(size_t* count) const {
27 *count = count_;
28 if (count_) return trace_;
29 return NULL;
30 }
31
32 std::string StackTrace::ToString() const {
33 std::stringstream stream;
34 OutputToStream(&stream);
35 return stream.str();
36 }
37
38 } // namespace debug
39 } // namespace base
40 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/debug/stack_trace.h ('k') | src/base/debug/stack_trace_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698