PLC Source Code Compilation With User-Mode Breakpoint Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing solutions for implementing breakpoints in programmable logic controllers (PLCs) executing in user mode are inadequate, particularly due to the need for processor exception mode access, which is restricted for cybersecurity reasons.

Innovation Solution

A method for compiling source code that inserts calls to a breakpoint control function during the first compilation step, allowing breakpoint management through a software solution by using unique identifiers and semaphores to manage execution pauses during debugging.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If hardware breakpoint or software breakpoint solutions are used in kernel mode, then breakpoint functionality is achieved, but system security is compromised due to kernel mode access requirements

Engineering Contradiction:
Improvebreakpoint functionalityVSAvoidcybersecurity risk
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent introduces an intermediary mechanism by inserting calls to a breakpoint control function in the intermediate code, which acts as a mediator between the user-mode executable and the breakpoint management system. This allows breakpoint functionality to be achieved without direct kernel mode access, thus maintaining security while enabling debugging capabilities.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the traditional mechanical approach of using processor exception modes (hardware or software breakpoints requiring kernel access) with a software-based control function call mechanism. This substitution allows breakpoint functionality to be implemented through standard user-mode function calls, eliminating the need for privileged mode access and thereby maintaining system security.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Object-affected harmful factors

If user mode execution is used for firmware, then system security is improved, but breakpoint implementation becomes impossible with traditional methods

Engineering Contradiction:
Improvecybersecurity protectionVSAvoidbreakpoint implementation
Core Design Contradiction:
Object-affected harmful factorsVSEase of operation

Solution Approach 1:

The patent applies preliminary action by inserting calls to the breakpoint control function during the compilation process (in the first compilation step transforming source code to intermediate code). This advance preparation ensures that breakpoint functionality is built into the executable structure before runtime, making breakpoint implementation feasible in user mode without requiring complex runtime modifications or kernel access.

Inventive Principle:
Principle #10Preliminary action

3Ease of operation

If breakpoint control function calls are inserted in intermediate code, then breakpoint management is enabled in user mode, but code complexity increases

Engineering Contradiction:
Improvebreakpoint management capabilityVSAvoidcompilation process complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent implements self-service by having the compilation process automatically insert the necessary breakpoint control function calls during the transformation from source code to intermediate code. The system serves itself by integrating the breakpoint functionality insertion into the existing compilation workflow, eliminating the need for separate manual intervention or complex post-processing steps.

Inventive Principle:
Principle #25Self-service

Data Source

PatentEP4589443A1A method for compiling a source code intended to produce an executable program to be executed on a programmable controller, apparatus, and computer program
Publication Date: 2025.07.23 SCHNEIDER ELECTRIC IND SAS
  • EP4589443A1 patent drawingFigure 1~2
  • EP4589443A1 patent drawingFigure 3
  • EP4589443A1 patent drawingFigure 4

AI summary

The disclosure relates to a method for compiling a source code (CS) intended to produce an executable program (FW) to be executed on a programmable controller (CP), said method being implemented by an electronic device comprising at least one processor and a storage space. The method comprises: - a first compilation step (CS01) in which the lines of code of the source code (CS) are transformed into a plurality of lines of code in an intermediate code (LCI) and in which at least one intermediate line of code of call to a breakpoint control function (FBP) is added, delivering a set of intermediate lines of code called intermediate program (ICP), - a second compilation step (CS02) in which the intermediate program (ICP) is compiled into a language executable by the programmable controller to produce the executable program (FW).