v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
stack_trace.cc
Go to the documentation of this file.
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
() =
default
;
25
26
const
void
*
const
*
StackTrace::Addresses
(
size_t
* count)
const
{
27
*count =
count_
;
28
if
(
count_
)
return
trace_
;
29
return
nullptr
;
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
v8::base::debug::StackTrace::count_
size_t count_
Definition
stack_trace.h:90
v8::base::debug::StackTrace::OutputToStream
void OutputToStream(std::ostream *os) const
Definition
stack_trace_android.cc:83
v8::base::debug::StackTrace::ToString
std::string ToString() const
Definition
stack_trace.cc:32
v8::base::debug::StackTrace::Addresses
const void *const * Addresses(size_t *count) const
Definition
stack_trace.cc:26
v8::base::debug::StackTrace::~StackTrace
~StackTrace()
v8::base::debug::StackTrace::trace_
void * trace_[kMaxTraces]
Definition
stack_trace.h:87
v8::base::debug::StackTrace::StackTrace
StackTrace()
Definition
stack_trace_android.cc:72
count
uint32_t count
Definition
debug-coverage.cc:594
base
OpIndex base
Definition
instruction-selector-ia32.cc:65
v8
Definition
api-arguments-inl.h:19
macros.h
arraysize
#define arraysize(array)
Definition
macros.h:67
stack_trace.h
string.h
src
base
debug
stack_trace.cc
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0