Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom IP/Port fixes for xsbug on Windows #1376

Open
wants to merge 7 commits into
base: public
Choose a base branch
from
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
2 changes: 0 additions & 2 deletions tools/mcconfig/nmake.esp32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,6 @@ release: precursor
python %IDF_PATH%\tools\idf.py $(IDF_PY_LOG_FLAG) $(PORT_COMMAND) -b $(UPLOAD_SPEED) monitor

prepare:
$(KILL_SERIAL2XSBUG)
$(START_XSBUG)
if exist $(BLD_DIR)\xs_esp32.elf del $(BLD_DIR)\xs_esp32.elf
if not exist $(BLD_DIR) mkdir $(BLD_DIR)
copy $(BIN_DIR)\xs_$(ESP32_SUBCLASS).a $(BLD_DIR)\.
Expand Down
20 changes: 18 additions & 2 deletions tools/mcconfig/nmake.win.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,36 @@
!CMDSWITCHES +S
!ENDIF


!IF "$(DEBUG)"=="1"
!IF "$(XSBUG_LOG)"=="1"
START_XSBUG =
!ELSE
!IF "$(XSBUG_HOST)"=="localhost"
START_XSBUG = tasklist /nh /fi "imagename eq xsbug.exe" | find /i "xsbug.exe" > nul || (start $(BUILD_DIR)\bin\win\release\xsbug.exe)
!ELSE
START_XSBUG = echo "mcconfig -x" is remote ($(XSBUG_HOST):$(XSBUG_PORT)), not starting xsbug
!ENDIF
!ENDIF
!ELSE
START_XSBUG =
!ENDIF

!IFNDEF XSBUG_PORT
XSBUG_PORT = 5002
!ENDIF
!IFNDEF XSBUG_HOST
XSBUG_HOST = localhost
!ENDIF

!IF "$(XSBUG_LOG)"=="1"
START_COMMAND = cd $(MODDABLE)\tools\xsbug-log && node xsbug-log start /B $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll
!IF "$(XSBUG_HOST)"=="localhost"
START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && cd $(MODDABLE)\tools\xsbug-log && node xsbug-log start /B $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll"
!ELSE
START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll"
!ENDIF
!ELSE
START_COMMAND = start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll
START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll"
!ENDIF
KILL_COMMAND = taskkill /im mcsim.exe /F 2> nul || (call )

Expand Down
2 changes: 1 addition & 1 deletion tools/xsbug-log/xsbug-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ catch (e) {
process.exit();
}

const portIn = 5002;
const portIn = process.env.XSBUG_PORT ?? 5002;
let connections = 0;
let autoexit = false;

Expand Down