Using VSCode with RTKlib

Makefile modifications

Adding -gdwarf-4 -g3 enables gdb debugger to be triggered within VSCode

Before

CFLAGS  = -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I$(SRC) $(OPTS)

After

CFLAGS  = -gdwarf-4 -g3 -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I$(SRC) $(OPTS)

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "rnx2rtkp compile",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            
            "options": {
                "cwd": "${workspaceFolder}/app/consapp/rnx2rtkp/gcc",
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "command": "make"
        },
        {
            "label": "pos2kml compile",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            
            "options": {
                "cwd": "${workspaceFolder}/app/consapp/pos2kml/gcc",
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "command": "make"
        },
        {
            "label": "convbin compile",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            
            "options": {
                "cwd": "${workspaceFolder}/app/consapp/convbin/gcc",
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "command": "make"
        },
        {
            "label": "rtkrcv compile",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            
            "options": {
                "cwd": "${workspaceFolder}/app/consapp/rtkrcv/gcc",
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "command": "make"
        },
        {
            "label": "str2str compile",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            
            "options": {
                "cwd": "${workspaceFolder}/app/consapp/str2str/gcc",
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "command": "make"
        },
    ]
  }

launch.json

{
    // 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": "rnx2rtkp",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/app/consapp/rnx2rtkp/gcc/",
            "program": "${workspaceFolder}/app/consapp/rnx2rtkp/gcc/rnx2rtkp",
            "args": [
                "-x", "4",
                "-y", "2",
                "-k", "${workspaceFolder}/app/consapp/rnx2rtkp/gcc/proc.conf",
                "-o", "${workspaceFolder}/data/logfile/validations/output_file.out",
                "${workspaceFolder}/data/logfile/validations/rover_logfile.rnx",
                "${workspaceFolder}/data/logfile/validations/base_logfile.rnx",
                "${workspaceFolder}/data/logfile/validations/eph_logfile.nav"
            ],
            "stopAtEntry": true,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "rnx2rtkp compile",
            "miDebuggerPath": "/usr/bin/gdb"
        },
        {
            "name": "pos2kml",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/app/consapp/pos2kml/gcc/",
            "program": "${workspaceFolder}/app/consapp/pos2kml/gcc/pos2kml",
            // "args": ["-o", "../rtk_pb.conf"],
            "stopAtEntry": true,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "pos2kml compile",
            "miDebuggerPath": "/usr/bin/gdb"
        },
        {
            "name": "rtkrcv",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/app/consapp/rtkrcv/gcc/",
            "program": "${workspaceFolder}/app/consapp/rtkrcv/gcc/rtkrcv",
            "args": [
                "-s",
                "-p","3000",
                "-m","4000",
                "-o", "${workspaceFolder}/app/consapp/rtkrcv/conf/rtk.conf",
                "-r","3"],
            "stopAtEntry": true,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "rtkrcv compile",
            "miDebuggerPath": "/usr/bin/gdb"
        },
        {
            "name": "str2str",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/app/consapp/str2str/gcc/",
            "program": "${workspaceFolder}/app/consapp/str2str/gcc/str2str",
            // "args": ["-o", "../rtk_pb.conf"],
            "stopAtEntry": true,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "str2str compile",
            "miDebuggerPath": "/usr/bin/gdb"
        },
        {
            "name": "convbin",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/app/consapp/convbin/gcc/",
            "program": "${workspaceFolder}/app/consapp/convbin/gcc/convbin",
            // "args": ["-o", "../rtk_pb.conf"],
            "stopAtEntry": true,
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "convbin compile",
            "miDebuggerPath": "/usr/bin/gdb"
        },
    ]
}
Previous
Next