Skip to content

Instantly share code, notes, and snippets.

@puffybsd
Last active July 7, 2022 11:56
Show Gist options
  • Select an option

  • Save puffybsd/4dbee720b23c542e11eba90adfc0ce96 to your computer and use it in GitHub Desktop.

Select an option

Save puffybsd/4dbee720b23c542e11eba90adfc0ce96 to your computer and use it in GitHub Desktop.

Revisions

  1. puffybsd revised this gist Apr 10, 2018. 2 changed files with 46 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion launch.json
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    @@ -8,7 +11,6 @@
    "program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
    "args": [],
    "cwd": "${workspaceRoot}",
    "sourceLanguages": ["rust"],
    "sourceMap":{
    "/checkout/src/" : "${env:HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    }
    @@ -17,12 +19,25 @@
    "name": "Debug-GDB",
    "type": "gdb",
    "request": "launch",
    "arguments": "",
    "cwd": "${workspaceRoot}",
    "target": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
    "printCalls": true,
    "autorun": [
    "set substitute-path /checkout ${env:HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust"
    ]
    },
    {
    "name": "Debug-LLDB-Lib",
    "type": "lldb",
    "request": "launch",
    "preLaunchTask": "rust lib debug copier",
    "program": "${workspaceRoot}/target/debug/deps/${workspaceRootFolderName}",
    "args": [],
    "cwd": "${workspaceRoot}",
    "sourceMap":{
    "/checkout/src/" : "${env:HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    }
    }
    ]
    }
    30 changes: 30 additions & 0 deletions tasks.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format

    // Based on info from https://github.com/rust-lang/cargo/issues/1924
    // Requires "jq" to be installed
    // Works on Linux (possibly WSL)
    "version": "2.0.0",
    "tasks": [
    {
    "type": "shell",
    "label": "rust lib debug copier",
    "command": "cp",
    "args": [
    {
    "value":
    "$(ls -1t --indicator-style=slash $(cargo test --no-run --message-format=json | jq -r 'select(.profile.test == true) | .filenames[]') | head -n1)",
    "quoting": "weak"
    },
    "${workspaceRoot}/target/debug/deps/${workspaceRootFolderName}",
    ],
    "presentation": {
    "echo": true,
    "reveal": "always",
    "focus": false,
    "panel": "shared"
    }
    }
    ]
    }
  2. puffybsd revised this gist Apr 5, 2018. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions launch.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,4 @@
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    @@ -13,16 +10,19 @@
    "cwd": "${workspaceRoot}",
    "sourceLanguages": ["rust"],
    "sourceMap":{
    "/checkout/src/" : "/home/puffybsd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    "/checkout/src/" : "${env:HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    }
    },
    {
    "name": "Debug-GDB",
    "type": "gdb",
    "request": "launch",
    "arguments": "",
    "cwd": "${workspaceRoot}",
    "target": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
    "printCalls": true,
    "autorun": [
    "set substitute-path /checkout ${env:HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust"
    ]
    }
    ]
    }
  3. puffybsd created this gist Apr 4, 2018.
    28 changes: 28 additions & 0 deletions launch.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Debug-LLDB",
    "type": "lldb",
    "request": "launch",
    "program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
    "args": [],
    "cwd": "${workspaceRoot}",
    "sourceLanguages": ["rust"],
    "sourceMap":{
    "/checkout/src/" : "/home/puffybsd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    }
    },
    {
    "name": "Debug-GDB",
    "type": "gdb",
    "request": "launch",
    "arguments": "",
    "cwd": "${workspaceRoot}",
    "target": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
    }
    ]
    }