Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 27355: Add V8 debugger agent.... (Closed)

Created:
11 years, 9 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add V8 debugger agent. The debugger agent listens on a TCP/IP port for a remote debugger connection. When such a connection is established the debuger JSON protocol is communicated between the agent the the remote debugger. The messages containing the JSON protocol has a RFC-822 like header with a Content-Length field and with the body containing the JSON in UTF-8 encoding. The D8 shell has option --debugger-agent to start the debugger agent. Committed: http://code.google.com/p/v8/source/detail?r=1405

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 22

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2038 lines, -1563 lines) Patch
M include/v8-debug.h View 1 chunk +7 lines, -0 lines 0 comments Download
M src/SConscript View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/api.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/d8.cc View 1 chunk +9 lines, -1 line 0 comments Download
M src/debug.h View 3 chunks +6 lines, -0 lines 0 comments Download
M src/debug.cc View 2 chunks +12 lines, -0 lines 0 comments Download
A src/debug-agent.h View 1 2 1 chunk +109 lines, -0 lines 0 comments Download
A src/debug-agent.cc View 1 2 1 chunk +311 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M tools/v8.xcodeproj/project.pbxproj View 1 chunk +1562 lines, -1556 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-02 22:44:23 UTC) #1
Mads Ager (chromium)
LGTM We need to update the XCode project as well. http://codereview.chromium.org/27355/diff/17/23 File src/SConscript (right): http://codereview.chromium.org/27355/diff/17/23#newcode43 ...
11 years, 9 months ago (2009-03-03 11:04:30 UTC) #2
Søren Thygesen Gjesse
http://codereview.chromium.org/27355/diff/17/23 File src/SConscript (right): http://codereview.chromium.org/27355/diff/17/23#newcode43 Line 43: 'flags.cc', 'frames.cc', 'global-handles.cc', 'handles.cc', 'hashmap.cc', On 2009/03/03 11:04:31, ...
11 years, 9 months ago (2009-03-03 11:56:14 UTC) #3
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-03 12:21:42 UTC) #4
Updated the xcode project using xcodebodge.py from the Chromium project - hope
it works.

On 2009/03/03 11:56:14, Søren Gjesse wrote:
> http://codereview.chromium.org/27355/diff/17/23
> File src/SConscript (right):
> 
> http://codereview.chromium.org/27355/diff/17/23#newcode43
> Line 43: 'flags.cc', 'frames.cc', 'global-handles.cc', 'handles.cc',
> 'hashmap.cc',
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Something is fishy about the indentation here.
> 
> Fixed (some tabs sneaked in).
> 
> http://codereview.chromium.org/27355/diff/17/26
> File src/debug-agent.cc (right):
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode50
> Line 50: // Listen for new connections
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Add periods to the end of these comments?
> 
> Done.
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode72
> Line 72: client->Send("Remote debugging session already active\r\n", 41);
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Create a const char* and use strlen?
> > 
> > Also, why is the string terminated by \r\n instead of just \n?
> 
> Added static const char* message = ... and removed \r.
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode132
> Line 132: v8::Debug::SendCommand((const uint16_t *) temp, len);
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Use C++ style cast.
> 
> Done.
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode174
> Line 174: header_buffer[header_buffer_position] = '\0';
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Don't you need an if here instead?  Can't you end up writing a '\0' right
> after
> > the allocated buffer?
> 
> Added an if and a '- 1' where filling the buffer to always leave room for the
> '\0'. Kept the ASSERT.
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode186
> Line 186: // Check that key is Content-Length.
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Where are you checking that the key is Content-Length?
> 
> I was not - added this check.
> 
> http://codereview.chromium.org/27355/diff/17/26#newcode189
> Line 189: content_length = 10 * content_length + (value[i] - '0');
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Can there be no overflow here?
> 
> Added range checking and bailout for non numeric data.
> 
> http://codereview.chromium.org/27355/diff/17/27
> File src/debug-agent.h (right):
> 
> http://codereview.chromium.org/27355/diff/17/27#newcode41
> Line 41: // Debugger agent which starts a  socket listener on the debugger
port
> and
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > a  socket -> a socket
> > 
> > two spaces instead of one.
> 
> Done.
> 
> http://codereview.chromium.org/27355/diff/17/27#newcode48
> Line 48: virtual ~DebuggerAgent() {}
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > Do you need the virtual destructor?  The DebuggerAgentSession class does not
> > have one.
> 
> No, removed.
> 
> http://codereview.chromium.org/27355/diff/17/27#newcode72
> Line 72: // Debugger agent session. The session received requests from the
> remote
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > received -> receives
> 
> Done.
> 
> http://codereview.chromium.org/27355/diff/17/22
> File src/flag-definitions.h (right):
> 
> http://codereview.chromium.org/27355/diff/17/22#newcode204
> Line 204: DEFINE_bool(regexp_native, true, "use native code regexp
> implementation (IA32"
> On 2009/03/03 11:04:31, Mads Ager wrote:
> > I would break this differently:
> > 
> > DEFINE_bool(regexp_native, true,
> >             "use native ...")
> > 
> > ?
> >         
> 
> So would I - done.

Powered by Google App Engine
This is Rietveld 408576698