xmake-io / xmake-vscode

🍩 A XMake integration in Visual Studio Code
https://xmake.io
Apache License 2.0
227 stars 54 forks source link

debug target select a random one in windows #215

Closed raigorx closed 1 year ago

raigorx commented 1 year ago

Xmake Version

xmake v2.8.1+dev.732d60063

Operating System Version and Architecture

windows 11 home 10.0.22621 Build 22621

Describe Bug

when you debug the target is selected in a random way.

I make a repo that reproduce the bug https://github.com/raigorx/xmake-bug

try to do the run and debug in vscode select xmake and the target you will see in the debug console a random target each time you run and debug

The fix that works for me is edit the auto generate launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "xmake",
      "request": "launch",
      "name": "Debug XMake target",
      "target": "target name",
      "cwd": "${workspaceFolder}",
      "stopAtEntry": true
    },
    {
      "name": "Debug target: target-one\r", 
      "type": "xmake",
      "target": "target-one\r", // remove this /r and it works fine
      "request": "launch"
    }
  ]
}

Expected Behavior

you select a debug target and an random one target is run.

Project Configuration

target("target-one")
  set_kind("binary")
  add_files("./target-one.cpp")

target("target-two")
  set_kind("binary")
  add_files("./target-two.cpp")

Additional Information and Error Logs

No related to build

waruqi commented 1 year ago

you can open a pr to fix it.

waruqi commented 1 year ago

I have fixed it.