summaryrefslogtreecommitdiff
path: root/src/inspector_io.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2017-11-20 23:37:50 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2017-11-20 23:37:50 +0100
commitf526deb0407412e089382900e3fc4560eea3a938 (patch)
tree3900be9dae9cfc4f4920edaaa0ea9f54471c3cf4 /src/inspector_io.cc
parent7dc35e937d6b3cf57e6184dfc3d54633e5b69082 (diff)
downloadandroid-node-v8-f526deb0407412e089382900e3fc4560eea3a938.tar.gz
android-node-v8-f526deb0407412e089382900e3fc4560eea3a938.tar.bz2
android-node-v8-f526deb0407412e089382900e3fc4560eea3a938.zip
src: inspector context name = program title + pid
Report (for example) "node[1337]" as the human-readable name rather than the more generic and less helpful "Node.js Main Context." While not perfect yet, it should be an improvement to people that debug multiple processes from DevTools, VS Code, etc. PR-URL: https://github.com/nodejs/node/pull/17087 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/inspector_io.cc')
-rw-r--r--src/inspector_io.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/inspector_io.cc b/src/inspector_io.cc
index a870c0a263..538cbab3c9 100644
--- a/src/inspector_io.cc
+++ b/src/inspector_io.cc
@@ -26,17 +26,6 @@ using v8_inspector::StringView;
template<typename Transport>
using TransportAndIo = std::pair<Transport*, InspectorIo*>;
-std::string GetProcessTitle() {
- char title[2048];
- int err = uv_get_process_title(title, sizeof(title));
- if (err == 0) {
- return title;
- } else {
- // Title is too long, or could not be retrieved.
- return "Node.js";
- }
-}
-
std::string ScriptPath(uv_loop_t* loop, const std::string& script_name) {
std::string script_path;
@@ -484,7 +473,7 @@ std::vector<std::string> InspectorIoDelegate::GetTargetIds() {
}
std::string InspectorIoDelegate::GetTargetTitle(const std::string& id) {
- return script_name_.empty() ? GetProcessTitle() : script_name_;
+ return script_name_.empty() ? GetHumanReadableProcessName() : script_name_;
}
std::string InspectorIoDelegate::GetTargetUrl(const std::string& id) {