Skip to content

Instantly share code, notes, and snippets.

@Scott31393
Last active March 2, 2022 11:56
Show Gist options
  • Save Scott31393/99e2ff21082c624c5382e8b5e3894c87 to your computer and use it in GitHub Desktop.
Save Scott31393/99e2ff21082c624c5382e8b5e3894c87 to your computer and use it in GitHub Desktop.

VSCode Custom Debug Shortcuts

In order to setup custom keybindings shortcuts in vscode you need to edit keybindings.json:

Open vscode and press:

ctrl + shift + p

Then search for the following strings, anmd open it:

Open Keyboard Keyboard Shortcuts (JSON)

Inside this file you can put your custom shortcuts, below you can see an example:

keybindings.json
// Place your key bindings in this file to override the defaults
[

/*Print Kernel Debug*/
    {
        "key": "F5",
        "command": "type",
        "args": { 
          "text": "printk(\"KERN_ERR, DEBUG FUNC = %s, LINE = %d, \\n\", __func__, __LINE__);" 
        },
        "when": "editorTextFocus"
     },

/*Print Debug*/
{
    "key": "F6",
    "command": "type",
    "args": { 
      "text": "printf(\"DEBUG FUNC = %s, LINE = %d, \\n\", __func__, __LINE__);" 
    },
    "when": "editorTextFocus"
 },

/*Print Debug*/
    {
        "key": "F7",
        "command": "type",
        "args": { 
          "text": "puts(\"DEBUG\");" 
        },
        "when": "editorTextFocus"
     },
/* Dump stack */
    {
        "key": "F8",
        "command": "type",
        "args": { 
          "text": "dump_stack();" 
        },
        "when": "editorTextFocus"
     },

]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment