Skip to content

Commit

Permalink
[MB-30395] Use js_app.html as the landing page for debugger
Browse files Browse the repository at this point in the history
* As per nodejs/node#21385 and
  https://chromium.googlesource.com/chromium/src/+/f7efc442c8dc9108f057144983987e74ddc6a0d4
  we need to use js_app.html instead of inspector.html
* This patch also fixes the inconsistency in symbol mapping
  caused due to adding handler headers.

Change-Id: I23884175d7e8ce9fa798869659b44ba2a0ee0dca
Reviewed-on: http://review.couchbase.org/97722
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Sriram Melkote <siri@couchbase.com>
Tested-by: Gautham B A <gautham.bangalore@gmail.com>
  • Loading branch information
GauthamBanasandra authored and jeelanp2003 committed Aug 3, 2018
1 parent cab2687 commit 0e337ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions third_party/inspector/inspector_socket_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void PrintDebuggerReadyMessage(const std::string& host,
for (const std::string& id : ids) {
std::string frontend_url;
frontend_url = "chrome-devtools://devtools/bundled";
frontend_url += "/inspector.html?experiments=true&v8only=true&ws=";
frontend_url += "/js_app.html?experiments=true&v8only=true&ws=";
frontend_url += FormatWsAddress(host, port, id, false);
fprintf(out, "%s\n", frontend_url.c_str());
fprintf(stderr, "Debugger starting on %s\n", frontend_url.c_str());
Expand Down Expand Up @@ -384,7 +384,7 @@ void InspectorSocketServer::SendListResponse(InspectorSocket* socket) {
GetSocketHost(&socket->tcp, &host);
std::ostringstream frontend_url;
frontend_url << "chrome-devtools://devtools/bundled";
frontend_url << "/inspector.html?experiments=true&v8only=true&ws=";
frontend_url << "/js_app.html?experiments=true&v8only=true&ws=";
frontend_url << FormatWsAddress(host, port, id, false);
target_map["devtoolsFrontendUrl"] += frontend_url.str();
target_map["webSocketDebuggerUrl"] =
Expand Down
6 changes: 4 additions & 2 deletions v8_consumer/src/transpiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ std::string Transpiler::JsFormat(const std::string &handler_code) {
std::string Transpiler::GetSourceMap(const std::string &handler_code,
const std::string &src_filename) {
v8::HandleScope handle_scope(isolate_);
v8::Local<v8::Value> args[2];
v8::Local<v8::Value> args[4];
args[0] = v8Str(isolate_, handler_code);
args[1] = v8Str(isolate_, src_filename);
auto result = ExecTranspiler("getSourceMap", args, 2);
args[2] = v8Array(isolate_, handler_headers_);
args[3] = v8Array(isolate_, handler_footers_);
auto result = ExecTranspiler("getSourceMap", args, 4);
v8::String::Utf8Value utf8result(result);

return *utf8result;
Expand Down
3 changes: 2 additions & 1 deletion v8_consumer/src/transpiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ function jsFormat(code) {
return escodegen.generate(ast);
}

function getSourceMap(code, sourceFileName) {
function getSourceMap(code, sourceFileName, headers, footers) {
code = AddHeadersAndFooters(code, headers, footers);
var ast = getAst(code, sourceFileName);
return escodegen.generate(ast, {
sourceMap: true,
Expand Down

0 comments on commit 0e337ae

Please sign in to comment.