QNX® Toolkit for Visual Studio Code provides users with access to the world-class, POSIX-based QNX® Software Development Platform (SDP) 8.0. The QNX Toolkit enables shorter debug times and faster time to market, while multi-core specific tools help developers migrate code cleanly from single-core to multi-core systems, and safely optimize performance.
This toolkit provides users of QNX SDP 8.0 with capabilities such as:
- remote running and debugging
- generation and visualization of kernel traces
- easy creation of QNX projects and associated tasks
Read the online documentation.
IMPORTANT: You must have QNX SDP 8.0 or later installed and a development seat license to use the QNX Toolkit.
QNX SDP 8.0 is the foundational development platform for the next generation of Systems-on-Chip (SoCs) — merging unprecedented performance with unparalleled safety and security. QNX SDP 8.0 features the next-generation QNX® Operating System 8.0, built on a future-ready architecture designed to scale seamlessly with multicore hardware and maximize silicon advancements.
Prerequisites
Verify you have the right prerequisites for using the QNX Toolkit:
- A supported development host OS
- Microsoft Windows 10 Professional 64 bit, or 11 Professional 64 bit
- Ubuntu 20.04, Ubuntu 22.04, or Red Hat Enterprise Linux 9
- QNX Software Development Platform 8 or later installed
- Installation of Microsoft Visual Studio Code
- VS Code Extension: Microsoft C/C++ (required for C/C++ Development)
- VS Code Extension: Trace Viewer for VSCode (required for the System Profiler)
- Java Runtime 17 (required for the System Profiler)
- System running QNX connected over IP or local virtualized environment (QEMU, VMware, or VirtualBox)
- CMake (for CMake project types)
For information on QNX SDP, including the QNX Operating System and the QNX Tool Suite (which includes the QNX Toolkit for Microsoft Visual Studio Code, QNX Momentics IDE, and QNX Command Line Tools), or to request a free software evaluation, visit the QNX SDP web page.
WARNING: Make sure you do not have any Makefile support installed, as this conflicts with QNX make support.
Getting Started
The first thing you'll want to do is go through the Getting Started with QNX Toolkit Walkthrough, which will help you configure the extension.
- Open the QNX view in the Activity Bar.
- In the QNX COMMANDS panel on the bottom half, click Configuration > Open QNX Toolkit Walkthrough.
- Complete the walkthrough.
You're now ready to get started with the QNX Toolkit.
NOTE: If you haven't already configured the sdpPath
setting as part of the walkthrough, then a warning message pops up regarding the missing path. You must set a path to access the QNX Toolkit's features.
Targets
You must create a target before using the remote functionality. It can be a connection to an existing target running qconn
over TCP/IP, or a virtual target.
Connect to an existing target
- Open the QNX view in the Activity Bar.
- Click the "+" button to the right of the QNX TARGETS tab or click the Add new QNX Target button under the QNX TARGETS tab.
- Enter the IP or hostname for your existing target connection in the text box at the top of the screen.
An error message pops up if there are any issues with the connection. Otherwise, a message appears saying the connection was successful.
NOTE: If qconn
is not running on port 8000 (default), then you can add :port
to the end of the IP or hostname in step 3: <IP_or_hostname>:port
Create a virtual target
- Open the QNX view in the Activity Bar.
- Click the "+" button to the right of the QNX TARGETS tab or click the Add new QNX Target button under the QNX TARGETS tab.
- Enter
vm
into the pop-up menu at the top of the screen.
- Select the architecture. For example,
x86_64
.
- Enter additional
mkqnximage
options. For more information, go to the mkqnximage
documentation.
Run a virtual target
You can use the command Run VM to boot the virtual target after it is created:
- Open the QNX view in the Activity Bar.
- Select QNX TARGETS.
- Hover over the target you want to boot, and then click the play button next to it.
Alternatively, you can use the context menu for a VM:
- Right-click the target you wish to boot.
- Select Run VM.
The VM should open in the terminal. If you selected qemu
as the VM platform, the target console is displayed.
Monitor a target
With QNX Toolkit, you can monitor your QNX targets. This gives you information about the target's running processes and threads, along with access to its filesystem.
To monitor a target:
- Open the QNX view in the Activity Bar.
- Make sure that the target you wish to monitor is running (see Run a virtual target).
- Right-click the target under QNX TARGETS.
- Select Start monitoring and expand the target's tree. The processes, properties, and filesystem are displayed.
Create a new QNX project
You can use the QNX Toolkit to create a new QNX project or to configure an existing one.
To create a new QNX project:
- Open the QNX view in the Activity Bar.
- Under QNX COMMANDS, expand Projects.
- Select Create new QNX Project.
- Complete the project configuration steps as prompted:
- Enter the project name at top of screen.
- Select the Makefile type.
- Select the language of the project.
- Select the artifact type.
- Select the type of project from the drop-down menu.
QNX Toolkit creates the project in the QNX projects root (created during the walkthrough) and adds it to the current workspace. You can press Ctrl+F5 to run the project.
IntelliSense
Projects are automatically configured for IntelliSense with qcc
(QNX compile command) when you create them. You can modify the Intellisense settings in your project's c_cpp_properties.json file located in the .vscode
folder.
{
"version": 4,
"configurations": [
{
"name": "qnx",
"includePath": [
"${env:QNX_TARGET}/usr/include",
"${workspaceFolder}/**"
],
"compilerPath": "${env:QNX_HOST}/usr/bin/qcc",
"defines": [
"${default}"
],
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "${default}"
}
]
}
Debugger
The debugger tool works with pre-existing QNX projects, or you can manually create a launch configuration (launch.json
).
To use the debugger, you must compile the code in debug mode. If you're using a generated project, then make sure to use the QNX: Debug Build
task to build your project. You can select the default build task in VS Code at the title bar by clicking Terminal > Configure Default Build Task.
Debugger prerequisites
- An SDP path must be configured.
- You must be connected to a target.
- You must build a QNX project in debug mode.
Projects created with QNX Toolkit include launch configurations. Thanks to this, you can quickly launch a binary in the debugger via the context menu in the Explorer.
To start the debugger:
- Right-click on the binary in the
nto
folder of your project.
- Select QNX > Debug as QNX Application to launch the binary and attach the debugger to it.
Generate QNX launch configurations
If you didn't create your project with the QNX Toolkit, then you need to generate launch configurations to use the debugger. To generate a remote launch configuration for each binary:
- Open the QNX view in the Activity Bar.
- Under the QNX COMMANDS tab, expand the Run/Debug section.
- Select Generate QNX Launch Configurations.
- Select a binary or a whole project.
- Start the debugger. You can do this either in the Run/Debug panel, or by pressing F5.
Manually create launch configurations
- Select Run from the top task bar.
- Select Add Configuration....
- Enter QNX: Launch or select it from the drop-down menu.
Example launch configurations:
The following launch.json
file includes both the QNX: Launch and QNX: Attach configurations:
{
"version": "2.0.0",
"configurations": [
{
"type": "qnx-gdb",
"request": "launch",
"name": "qnx launch",
"gdb": "gdb",
"program": "${command:qnx.autodetectBinary}",
"remotePath": "${workspaceFolderBasename}",
"qnxtarget": "default",
"upload": true,
"preLaunchTask": "${defaultBuildTask}"
},
{
"type": "qnx-gdb",
"request": "attach",
"name": "qnx attach",
"gdb": "gdb",
"program": "${command:qnx.autodetectBinary}",
"remotePath": "${workspaceFolderBasename}",
"qnxtarget": "default"
}
]
}
Launch.json attributes
You can use IntelliSense (Ctrl+Space) to see the list of available launch.json
attributes. To do this, you need to specify a value of qnx-gdb
for the type
attribute.
A list of standard attributes can be found on the Visual Studio Code website. In addition, qnx-gdb
supports the following attributes:
program
- Executable or file to run when launching the debugger.
args
- Arguments passed to the program to debug.
env
- Environment variables used to launch the program on the remote target. To undefine a variable, use null
.
envFile
- The path to a dotenv
file that contains the environment variables.
cwd
- The current working directory for finding dependencies and other files.
stopOnEntry
- Break immediately when the program starts.
console
- Sets what kind of console to use. Possible values: internalConsole
, integratedTerminal
, or externalTerminal
.
preLaunchTask
- Set this attribute to the label of a task specified in tasks.json
(located in the workspace's .vscode
folder) to launch a task before the start of a debug session, or set it to ${defaultBuildTask}
to use the default build task.
qnxtarget
- The QNX target resolved by the target navigator hostname or IP. The value default
is reserved for the current active target.
processId
- Finds the process ID for an attach request. Can be set to ${command:AskForProcessId}
to prompt.
uploadLocation
- The path of the folder where all binaries are uploaded on the target. Default setting is /tmp
.
upload
- The boolean representing whether the binary should be uploaded to the target.
files
- The set of additional QNX files to be uploaded to the target in binaryLocation
.
Common variables are also supported in the configuration. Here are a few common commands that configure prompts for variable values:
Command |
Description |
${command:AskForProcessId} |
Asks for process ID on the target. |
${command:AskForProgramPath} |
Asks for program path. |
${command:AskForTargetAddress} |
Asks for target address. |
${command:qnx.askForString} |
Asks for any string (e.g., can be used in program args). |
QNX System Profiler
Components of the QNX System Profiler
QNX Trace Server - Provides QNX Kernel Event Trace (.kev) parsing, kernel event processing, and domain-specific logic to the Trace Viewer.
Trace Viewer - Requests data from the QNX Trace Server and visualizes data in various graphs and tables.
Capture a trace on your QNX system
Note: To capture a trace, you must have an open workspace or a folder to save the trace in.
- Make sure that a target is running.
- Open the QNX view in the Activity Bar.
- Ensure that the target you wish to capture a trace on is the default target.
- Make sure the target is running.
- Open the QNX view in the Activity Bar.
- Right-click the target and select Set as Default Target.
- Right-click the target again, and select Capture QNX Kernel Event Trace (with tracelogger).
- The trace file is saved in the open workspace folder as
trace.kev
.
Open a .kev file using the Explorer
- Open the Explorer.
- Navigate to the folder with the desired
.kev
file.
- Select the
.kev
file.
- Select File in the VS Code toolbar.
- Select Open File...
- Navigate to the folder with the desired
.kev
file.
- Select the
.kev
file.
Supported analyses for QNX Kernel Event Trace
- CPU Usage View - CPU usage per CPU per thread.
- Events Table - Show the raw events for a given trace in a table.
- Histogram - Show a histogram of number of events to time for a trace.
- Timeline View - Kernel Event Trace State System.
- Timeline View Colors - Visualization of all the timeline states and CPU colors.
- Trace Properties View - Properties of the Kernel Event Trace.
Questions and feedback
Technical support
To obtain technical support for QNX Toolkit for Visual Studio Code or QNX Software Development Platform 8.0, visit the support area on the QNX website.
Q & A
Visit the Q & A for answers to commonly asked questions.
Known issues
Find solutions to problems you may encounter when you work with the QNX Toolkit on our known issues page. Not all items are bugs.
License
Copyright © 2019–2024, BlackBerry Limited. All rights reserved.
For more information, go to the license agreement.
Third-party compliance
You can find the QNX Toolkit license (LICENSE.txt
) and third-party notices (ThirdPartyNotices.md
) under your VS Code extension installation location folder.
For example, on Linux it's available from the following location: /home/your-user-name/.vscode/extensions/qnx.qnx-vscode-0.3.0/
Trademark
Trademarks, including but not limited to BLACKBERRY, EMBLEM Design, QNX, MOMENTICS, and NEUTRINO are the trademarks or registered trademarks of BlackBerry Limited, and the exclusive rights to such trademarks are expressly reserved. All other trademarks are the property of their respective owners.
Patents per 35 U.S.C. § 287(a) and in other jurisdictions, where allowed: https://www.blackberry.com/patents
Data and telemetry
VS Code collects usage data and sends it to Microsoft to help improve its products and services. Read the privacy statement to learn more. If you don't wish to send usage data to Microsoft, you can set the telemetry.telemetryLevel
setting to "off"
. Learn more in the FAQ.