Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions qt-core/src/project-config-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ function qmlAttachLaunchConfig(): LaunchConfiguration {
name: 'Attach to QML debugger',
type: 'qml',
request: 'attach',
host: 'localhost',
host: '127.0.0.1',
port: '${command:qt-qml.debugPort}'
};
}

// The QML debug server only accepts an IP address literal as the host, so
// "localhost" would make it listen on all interfaces (VSCODEEXT-219).
const qmlDebuggerArgs =
'-qmljsdebugger=host:localhost,port:${command:qt-qml.debugPort},' +
'-qmljsdebugger=host:127.0.0.1,port:${command:qt-qml.debugPort},' +
'block,services:DebugMessages,QmlDebugger,V8Debugger';

function cppQmlCppdbgLaunchConfig(): LaunchConfiguration {
Expand Down
10 changes: 5 additions & 5 deletions qt-qml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"host": {
"type": "string",
"description": "Hostname (or IP address) of the target program's debug service",
"default": "localhost"
"default": "127.0.0.1"
},
"port": {
"type": [
Expand Down Expand Up @@ -418,7 +418,7 @@
"type": "qml",
"request": "attach",
"name": "Attach to QML debugger",
"host": "localhost",
"host": "127.0.0.1",
"port": "^\"Custom port or \\${command:qt-qml.debugPort} for compound usage\""
}
],
Expand All @@ -440,7 +440,7 @@
"name": "%qt-qml.debug.qmlDebuggingAttach.label%",
"type": "qml",
"request": "attach",
"host": "localhost",
"host": "127.0.0.1",
"port": "^\"Custom port or \\${command:qt-qml.debugPort} for compound usage\""
}
},
Expand All @@ -457,7 +457,7 @@
"visualizerFile": "^\"\\${command:qt-cpp.natvis}\"",
"showDisplayString": true,
"args": [
"^\"-qmljsdebugger=host:localhost,port:\\${command:qt-qml.debugPort},block,services:DebugMessages,QmlDebugger,V8Debugger\""
"^\"-qmljsdebugger=host:127.0.0.1,port:\\${command:qt-qml.debugPort},block,services:DebugMessages,QmlDebugger,V8Debugger\""
],
"linux": {
"MIMode": "gdb",
Expand Down Expand Up @@ -511,7 +511,7 @@
"cwd": "^\"\\${workspaceFolder}\"",
"visualizerFile": "^\"\\${command:qt-cpp.natvis}\"",
"args": [
"^\"-qmljsdebugger=host:localhost,port:\\${command:qt-qml.debugPort},block,services:DebugMessages,QmlDebugger,V8Debugger\""
"^\"-qmljsdebugger=host:127.0.0.1,port:\\${command:qt-qml.debugPort},block,services:DebugMessages,QmlDebugger,V8Debugger\""
],
"windows": {
"sourceFileMap": {
Expand Down
5 changes: 4 additions & 1 deletion qt-qml/src/debug/debug-adapter.mts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ export class QmlDebugSession extends LoggingDebugSession {
let port: number | undefined;
let host: string | undefined;
if (args.debuggerArgs === undefined) {
host = 'localhost';
// The QML debug server parses the host as an IP address literal, so
// hostnames like "localhost" are rejected and the server would fall
// back to listening on all interfaces (VSCODEEXT-219).
host = '127.0.0.1';
port = await getPort();
debuggerArgs = `-qmljsdebugger=host:${host},port:${port.toString()},block,services:DebugMessages,QmlDebugger,V8Debugger`;
} else {
Expand Down
Loading