vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.42k stars 237 forks source link

Target creation should not be required before gdb-remote #1064

Open ilyapoz opened 5 months ago

ilyapoz commented 5 months ago

Using plain console lldb

$ lldb
(lldb) gdb-remote localhost:12345

Just works. I want to be able to do basically the same in CodeLLDB, but this

    {
      "name": "Attach to lldb server",
      "type": "lldb",
      "request": "custom",
      "sourceMap": { "/proc/self/cwd": "${workspaceFolder}" },
      "targetCreateCommands": [""],
      "processCreateCommands": ["gdb-remote localhost:12345"]
    },

Fails with Stop reason (sic!) in Debug console.

If I put target create /bin/true, everything works ok.

This is a strange workaround that I would like to better understand consequences of and ideally get rid of. What is wrong with it and what could/should break? I did not encounter any problem.

My launch.json:

    {
      "name": "Attach to lldb server",
      "type": "lldb",
      "request": "custom",
      "sourceMap": { "/proc/self/cwd": "${workspaceFolder}" },
      "targetCreateCommands": ["target create /bin/true"],
      "processCreateCommands": ["gdb-remote localhost:12345"]
    },