summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.build1
-rw-r--r--deps/debugger-agent/debugger-agent.gyp24
-rw-r--r--deps/debugger-agent/src/agent.h64
-rw-r--r--lib/_debug_agent.js (renamed from deps/debugger-agent/lib/_debugger_agent.js)0
-rw-r--r--node.gyp5
-rw-r--r--src/debug-agent.cc (renamed from deps/debugger-agent/src/agent.cc)3
-rw-r--r--src/debug-agent.h (renamed from deps/debugger-agent/include/debugger-agent.h)44
-rw-r--r--src/env.h2
-rw-r--r--src/node.js2
9 files changed, 42 insertions, 103 deletions
diff --git a/Makefile.build b/Makefile.build
index 1aa5f56515..dad86cb517 100644
--- a/Makefile.build
+++ b/Makefile.build
@@ -233,7 +233,6 @@ NACL_ARCHES = nacl_ia32 nacl_x64
GYPFILES = \
common.gypi \
deps/cares/cares.gyp \
- deps/debugger-agent/debugger-agent.gyp \
deps/http_parser/http_parser.gyp \
deps/openssl/openssl.gyp \
deps/uv/uv.gyp \
diff --git a/deps/debugger-agent/debugger-agent.gyp b/deps/debugger-agent/debugger-agent.gyp
deleted file mode 100644
index e98206849a..0000000000
--- a/deps/debugger-agent/debugger-agent.gyp
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "targets": [{
- "target_name": "debugger-agent",
- "type": "<(library)",
- "include_dirs": [
- "src",
- "include",
- "../v8/include",
- "../uv/include",
-
- # Private node.js folder and stuff needed to include from it
- "../../src",
- "../cares/include",
- ],
- "direct_dependent_settings": {
- "include_dirs": [
- "include",
- ],
- },
- "sources": [
- "src/agent.cc",
- ],
- }],
-}
diff --git a/deps/debugger-agent/src/agent.h b/deps/debugger-agent/src/agent.h
deleted file mode 100644
index 82db5e5e18..0000000000
--- a/deps/debugger-agent/src/agent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright Fedor Indutny and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
-#define DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
-
-#include "v8.h"
-#include "v8-debug.h"
-#include "queue.h"
-
-#include <assert.h>
-#include <string.h>
-
-namespace node {
-namespace debugger {
-
-class AgentMessage {
- public:
- AgentMessage(uint16_t* val, int length) : length_(length) {
- if (val == NULL) {
- data_ = val;
- } else {
- data_ = new uint16_t[length];
- memcpy(data_, val, length * sizeof(*data_));
- }
- }
-
- ~AgentMessage() {
- delete[] data_;
- data_ = NULL;
- }
-
- inline const uint16_t* data() const { return data_; }
- inline int length() const { return length_; }
-
- QUEUE member;
-
- private:
- uint16_t* data_;
- int length_;
-};
-
-} // namespace debugger
-} // namespace node
-
-#endif // DEPS_DEBUGGER_AGENT_SRC_AGENT_H_
diff --git a/deps/debugger-agent/lib/_debugger_agent.js b/lib/_debug_agent.js
index 680c5e95c4..680c5e95c4 100644
--- a/deps/debugger-agent/lib/_debugger_agent.js
+++ b/lib/_debug_agent.js
diff --git a/node.gyp b/node.gyp
index b1dc5f2eca..21391e0e3b 100644
--- a/node.gyp
+++ b/node.gyp
@@ -16,6 +16,7 @@
'node_v8_options%': '',
'library_files': [
'src/node.js',
+ 'lib/_debug_agent.js',
'lib/_debugger.js',
'lib/_linklist.js',
'lib/assert.js',
@@ -67,7 +68,6 @@
'lib/util.js',
'lib/vm.js',
'lib/zlib.js',
- 'deps/debugger-agent/lib/_debugger_agent.js',
],
},
@@ -78,7 +78,6 @@
'dependencies': [
'node_js2c#host',
- 'deps/debugger-agent/debugger-agent.gyp:debugger-agent',
],
'include_dirs': [
@@ -89,6 +88,7 @@
],
'sources': [
+ 'src/debug-agent.cc',
'src/fs_event_wrap.cc',
'src/cares_wrap.cc',
'src/handle_wrap.cc',
@@ -124,6 +124,7 @@
'src/async-wrap-inl.h',
'src/base-object.h',
'src/base-object-inl.h',
+ 'src/debug-agent.h',
'src/env.h',
'src/env-inl.h',
'src/handle_wrap.h',
diff --git a/deps/debugger-agent/src/agent.cc b/src/debug-agent.cc
index 335737ffe9..78362afe96 100644
--- a/deps/debugger-agent/src/agent.cc
+++ b/src/debug-agent.cc
@@ -19,8 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#include "agent.h"
-#include "debugger-agent.h"
+#include "debug-agent.h"
#include "node.h"
#include "node_internals.h" // ARRAY_SIZE
diff --git a/deps/debugger-agent/include/debugger-agent.h b/src/debug-agent.h
index 762a687a0a..d3c7fcc382 100644
--- a/deps/debugger-agent/include/debugger-agent.h
+++ b/src/debug-agent.h
@@ -19,21 +19,24 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#ifndef DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
-#define DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
+#ifndef SRC_DEBUG_AGENT_H_
+#define SRC_DEBUG_AGENT_H_
#include "uv.h"
#include "v8.h"
#include "v8-debug.h"
+#include "queue.h"
-namespace node {
+#include <string.h>
-// Forward declaration
+// Forward declaration to break recursive dependency chain with src/env.h.
+namespace node {
class Environment;
+} // namespace node
+namespace node {
namespace debugger {
-// Forward declaration
class AgentMessage;
class Agent {
@@ -97,13 +100,38 @@ class Agent {
uv_loop_t child_loop_;
v8::Persistent<v8::Object> api_;
- // QUEUE
- void* messages_[2];
+ QUEUE messages_;
DispatchHandler dispatch_handler_;
};
+class AgentMessage {
+ public:
+ AgentMessage(uint16_t* val, int length) : length_(length) {
+ if (val == NULL) {
+ data_ = val;
+ } else {
+ data_ = new uint16_t[length];
+ memcpy(data_, val, length * sizeof(*data_));
+ }
+ }
+
+ ~AgentMessage() {
+ delete[] data_;
+ data_ = NULL;
+ }
+
+ inline const uint16_t* data() const { return data_; }
+ inline int length() const { return length_; }
+
+ QUEUE member;
+
+ private:
+ uint16_t* data_;
+ int length_;
+};
+
} // namespace debugger
} // namespace node
-#endif // DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
+#endif // SRC_DEBUG_AGENT_H_
diff --git a/src/env.h b/src/env.h
index 77dbf33c86..5eac220ea1 100644
--- a/src/env.h
+++ b/src/env.h
@@ -23,12 +23,12 @@
#define SRC_ENV_H_
#include "ares.h"
+#include "debug-agent.h"
#include "tree.h"
#include "util.h"
#include "uv.h"
#include "v8.h"
#include "queue.h"
-#include "debugger-agent.h"
#include <stdint.h>
diff --git a/src/node.js b/src/node.js
index 19d9506446..0a82088893 100644
--- a/src/node.js
+++ b/src/node.js
@@ -85,7 +85,7 @@
} else if (process.argv[1] == '--debug-agent') {
// Start the debugger agent
- var d = NativeModule.require('_debugger_agent');
+ var d = NativeModule.require('_debug_agent');
d.start();
} else if (process._eval != null) {