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