Browse Source

src: move debug agent from deps/ to src/

There is not much point in keeping it a separate project because it
doesn't build standalone, plus it makes applying changes to core more
difficult because of the implicit dependency on header files in src/.
archived-io.js-v0.12
Ben Noordhuis 10 years ago
parent
commit
29d7fd6bb8
  1. 1
      Makefile.build
  2. 24
      deps/debugger-agent/debugger-agent.gyp
  3. 64
      deps/debugger-agent/src/agent.h
  4. 0
      lib/_debug_agent.js
  5. 5
      node.gyp
  6. 3
      src/debug-agent.cc
  7. 44
      src/debug-agent.h
  8. 2
      src/env.h
  9. 2
      src/node.js

1
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 \

24
deps/debugger-agent/debugger-agent.gyp

@ -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",
],
}],
}

64
deps/debugger-agent/src/agent.h

@ -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_

0
deps/debugger-agent/lib/_debugger_agent.js → lib/_debug_agent.js

5
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',

3
deps/debugger-agent/src/agent.cc → 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

44
deps/debugger-agent/include/debugger-agent.h → 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_

2
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>

2
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) {

Loading…
Cancel
Save