Source path remapping - Manual - Structured Text Debugger - The SIMATIC Debugger. Enables debugging source code on the PLC and is needed to run the debugger extension. - Debugger (sdb),tool

Structured Text Debugger CLI Tool (sdb)

Portfolio
SIMATIC AX
Product
Structured Text Debugger
Software version
1.3.6
Edition
11/2024
Language
English (original)
Package Name
@ax/sdb

Source path remapping is necessary if the SIMATIC AX app has been built (and downloaded) from a location other than the current project location. This can apply when cloning a repository from a git repository while the program is already running on a PLC.

The steps in compiling a SIMATIC AX app include generating debug information as well as building the binaries. This debug information essentially maps symbols in ST to physical locations on the PLC. It also includes paths to the build directory and is downloaded to the PLC with the binaries via the sld.
If the location of the project has changed, the paths contained in the debug information will no longer be valid and the old and new paths will need to be provided to the debugger.

Here is an example:

  1. The project is built and downloaded
    Example location: C:\ax-debugging-example
  2. The project is copied to a different location
    Example location: C:\ax-source-path-remapping
  3. The debugger is started with the new build project and the new debug information
    The parameters --baseFolder and --remappingPath are used to modify the debug information

There are two possibilities for: On-connect and during runtime.

On-connect

Connect the debugger from the new location to a PLC downloaded with the old location:

apax sdb --targetIP 192.168.0.1 --password aSecurePassword --certificate ./cert.cer --baseFolder C:\ax-debugging-example\src --remappingPath C:\ax-source-path-remapping\src

The parameter --baseFolder must contain the old location.
The parameter --remappingPath must contain the new location.

The debugger can now be used in the usual way.

During runtime

In this case the debugger is already connected to the PLC. The following command will effect source path remapping during runtime:

set source-map C:\ax-debugging-example\src C:\ax-source-path-remapping\src