Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bundled/scripts/noConfigScripts/debugjava text eol=lf
bundled/scripts/noConfigScripts/debugjava.fish text eol=lf
2 changes: 1 addition & 1 deletion bundled/scripts/noConfigScripts/debugjava
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set environment variables only for the node process, not the current shell
# This ensures JAVA_TOOL_OPTIONS doesn't affect subsequent commands in the terminal
JDWP_ADAPTER_ENDPOINTS=$VSCODE_JDWP_ADAPTER_ENDPOINTS \
JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=0" \
JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:0" \
exec node "$SCRIPT_DIR/jdwp-wrapper.js" "$@"
2 changes: 1 addition & 1 deletion bundled/scripts/noConfigScripts/debugjava.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set JDWP_ADAPTER_ENDPOINTS=%VSCODE_JDWP_ADAPTER_ENDPOINTS%

REM Set JDWP options only for this debugjava invocation
REM This overrides the global JAVA_TOOL_OPTIONS to avoid affecting other Java processes
set JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=0
set JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:0

REM Use Node.js wrapper to capture JDWP port
node "%~dp0jdwp-wrapper.js" %*
Expand Down
2 changes: 1 addition & 1 deletion bundled/scripts/noConfigScripts/debugjava.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ set script_dir (dirname (status -f))
# Set environment variables only for the node process, not the current shell
# This ensures JAVA_TOOL_OPTIONS doesn't affect subsequent commands in the terminal
env JDWP_ADAPTER_ENDPOINTS=$VSCODE_JDWP_ADAPTER_ENDPOINTS \
JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=0" \
JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:0" \
node "$script_dir/jdwp-wrapper.js" $argv
2 changes: 1 addition & 1 deletion bundled/scripts/noConfigScripts/debugjava.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $oldJdwpAdapterEndpoints = $env:JDWP_ADAPTER_ENDPOINTS
try {
# Set environment variables only for this debugjava invocation
$env:JDWP_ADAPTER_ENDPOINTS = $env:VSCODE_JDWP_ADAPTER_ENDPOINTS
$env:JAVA_TOOL_OPTIONS = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=0"
$env:JAVA_TOOL_OPTIONS = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:0"

# Use Node.js wrapper to capture JDWP port
& node (Join-Path $scriptDir "jdwp-wrapper.js") $args
Expand Down
4 changes: 2 additions & 2 deletions bundled/scripts/noConfigScripts/jdwp-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (!isDebugEnabled) {
setupSignalHandlers(child);

let portCaptured = false;
const jdwpPortRegex = /Listening for transport dt_socket at address:\s*(\d+)/;
const jdwpPortRegex = /Listening for transport dt_socket at address:\s*(?:127\.0\.0\.1:|localhost:|\[::1\]:)?(\d+)/;

// Shared function to capture JDWP port from output
const capturePort = (output) => {
Expand All @@ -106,7 +106,7 @@ if (!isDebugEnabled) {
// Write port to endpoint file
const endpointData = JSON.stringify({
client: {
host: 'localhost',
host: '127.0.0.1',
port: port
}
});
Expand Down
Loading
Loading