1 |
|
|
#ifndef SRC_NODE_REPORT_H_ |
2 |
|
|
#define SRC_NODE_REPORT_H_ |
3 |
|
|
|
4 |
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS |
5 |
|
|
|
6 |
|
|
#include "node.h" |
7 |
|
|
#include "node_buffer.h" |
8 |
|
|
#include "uv.h" |
9 |
|
|
#include "util.h" |
10 |
|
|
|
11 |
|
|
#ifndef _WIN32 |
12 |
|
|
#include <sys/types.h> |
13 |
|
|
#include <unistd.h> |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <iomanip> |
17 |
|
|
|
18 |
|
|
namespace node { |
19 |
|
|
namespace report { |
20 |
|
|
|
21 |
|
|
// Function declarations - functions in src/node_report.cc |
22 |
|
|
std::string TriggerNodeReport(v8::Isolate* isolate, |
23 |
|
|
Environment* env, |
24 |
|
|
const char* message, |
25 |
|
|
const char* trigger, |
26 |
|
|
const std::string& name, |
27 |
|
|
v8::Local<v8::Value> error); |
28 |
|
|
void GetNodeReport(v8::Isolate* isolate, |
29 |
|
|
Environment* env, |
30 |
|
|
const char* message, |
31 |
|
|
const char* trigger, |
32 |
|
|
v8::Local<v8::Value> error, |
33 |
|
|
std::ostream& out); |
34 |
|
|
|
35 |
|
|
// Function declarations - utility functions in src/node_report_utils.cc |
36 |
|
|
void WalkHandle(uv_handle_t* h, void* arg); |
37 |
|
|
|
38 |
|
|
template <typename T> |
39 |
|
448 |
std::string ValueToHexString(T value) { |
40 |
|
896 |
std::stringstream hex; |
41 |
|
|
|
42 |
|
448 |
hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex << |
43 |
|
|
value; |
44 |
|
448 |
return hex.str(); |
45 |
|
|
} |
46 |
|
|
|
47 |
|
|
// Function declarations - export functions in src/node_report_module.cc |
48 |
|
|
void WriteReport(const v8::FunctionCallbackInfo<v8::Value>& info); |
49 |
|
|
void GetReport(const v8::FunctionCallbackInfo<v8::Value>& info); |
50 |
|
|
|
51 |
|
|
} // namespace report |
52 |
|
|
} // namespace node |
53 |
|
|
|
54 |
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS |
55 |
|
|
|
56 |
|
|
#endif // SRC_NODE_REPORT_H_ |