GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: node_postmortem_metadata.cc Lines: 9 9 100.0 %
Date: 2022-10-31 03:21:21 Branches: 0 0 - %

Line Branch Exec Source
1
#include "base_object-inl.h"
2
#include "env.h"
3
#include "handle_wrap.h"
4
#include "node_context_data.h"
5
#include "req_wrap.h"
6
#include "util-inl.h"
7
8
#define NODE_OFF_EXTSTR_DATA sizeof(void*)
9
10
#define NODEDBG_SYMBOL(Name)  nodedbg_ ## Name
11
12
// nodedbg_offset_CLASS__MEMBER__TYPE: Describes the offset to a class member.
13
#define NODEDBG_OFFSET(Class, Member, Type) \
14
    NODEDBG_SYMBOL(offset_ ## Class ## __ ## Member ## __ ## Type)
15
16
// These are the constants describing Node internal structures. Every constant
17
// should use the format described above.  These constants are declared as
18
// global integers so that they'll be present in the generated node binary. They
19
// also need to be declared outside any namespace to avoid C++ name-mangling.
20
#define NODE_OFFSET_POSTMORTEM_METADATA(V)                                    \
21
  V(BaseObject, persistent_handle_, v8_Persistent_v8_Object,                  \
22
    BaseObject::persistent_handle_)                                           \
23
  V(Environment, handle_wrap_queue_, Environment_HandleWrapQueue,             \
24
    Environment::handle_wrap_queue_)                                          \
25
  V(Environment, req_wrap_queue_, Environment_ReqWrapQueue,                   \
26
    Environment::req_wrap_queue_)                                             \
27
  V(HandleWrap, handle_wrap_queue_, ListNode_HandleWrap,                      \
28
    HandleWrap::handle_wrap_queue_)                                           \
29
  V(Environment_HandleWrapQueue, head_, ListNode_HandleWrap,                  \
30
    Environment::HandleWrapQueue::head_)                                      \
31
  V(ListNode_HandleWrap, prev_, uintptr_t, ListNode<HandleWrap>::prev_)       \
32
  V(ListNode_HandleWrap, next_, uintptr_t, ListNode<HandleWrap>::next_)       \
33
  V(Environment_ReqWrapQueue, head_, ListNode_ReqWrapQueue,                   \
34
    Environment::ReqWrapQueue::head_)                                         \
35
  V(ListNode_ReqWrap, prev_, uintptr_t, ListNode<ReqWrapBase>::prev_)         \
36
  V(ListNode_ReqWrap, next_, uintptr_t, ListNode<ReqWrapBase>::next_)
37
38
extern "C" {
39
int nodedbg_const_ContextEmbedderIndex__kEnvironment__int;
40
int nodedbg_const_BaseObject__kInternalFieldCount__int;
41
uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
42
uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
43
44
#define V(Class, Member, Type, Accessor)                                      \
45
  NODE_EXTERN uintptr_t NODEDBG_OFFSET(Class, Member, Type);
46
  NODE_OFFSET_POSTMORTEM_METADATA(V)
47
#undef V
48
}
49
50
namespace node {
51
52
5639
int GenDebugSymbols() {
53
5639
  nodedbg_const_ContextEmbedderIndex__kEnvironment__int =
54
      ContextEmbedderIndex::kEnvironment;
55
5639
  nodedbg_const_BaseObject__kInternalFieldCount__int =
56
      BaseObject::kInternalFieldCount;
57
58
5639
  nodedbg_offset_ExternalString__data__uintptr_t = NODE_OFF_EXTSTR_DATA;
59
5639
  nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue =
60
5639
      OffsetOf<ListNode<ReqWrapBase>, ReqWrap<uv_req_t>>(
61
5639
          &ReqWrap<uv_req_t>::req_wrap_queue_);
62
63
  #define V(Class, Member, Type, Accessor)                                    \
64
    NODEDBG_OFFSET(Class, Member, Type) = OffsetOf(&Accessor);
65
5639
    NODE_OFFSET_POSTMORTEM_METADATA(V)
66
  #undef V
67
68
5639
  return 1;
69
}
70
71
const int debug_symbols_generated = GenDebugSymbols();
72
73
}  // namespace node