A remote program debugger

CN122985127APending Publication Date: 2026-10-27SHENYANG INST OF AUTOMATION - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510535872.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

用户无法将这些编译器、调试器集成到自己的软件产品中

Benefits of technology

[0036]1.该远程程序调试器通过使用标准TCP通信,用户自己的软件只需创建TCP客户端与该远程调试器即可建立连接。通过简单的控制指令即可实现下位机的程序调试。这使得该远程程序调试器更容易向用户自己的软件集成。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985127A_ABST
    Figure CN122985127A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of remote program debuggers, the instruction supported by the remote debugger includes: help (help), start (start), getinfo (get current state), process continue (continue running), process stop (stop), step over (single step jump over execution), step out (single step return execution), step into (single step enter execution), break line (add line breakpoint), break name (add function name breakpoint), get breakpoints (query breakpoint information), del break (delete breakpoint), set break enable (enable / disable breakpoint), watch (add variable observation point), get watchpoints (view observation point), set watch enable (enable / disable observation point), get watch values (get observation point variable value), set watch value (set observation point variable value), del watch (delete observation point).Through the remote program debugger, other software of host computer can be called simple instruction by simple standard communication mode, realizes remote program debugging function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of program debugging, specifically a remote program debugger. Background Technology

[0002] Highly efficient and rapid industrial simulation can reduce labor and material costs and eliminate real trial-and-error costs. However, achieving efficient industrial simulation requires a significant amount of repetitive programming, downloading, debugging, and simulation functionality.

[0003] While many manufacturers currently offer compilation, download, and debugging capabilities, these features are typically provided in a closed technological manner. Compilers and debuggers from different manufacturers can only be used with their own products. Users cannot integrate these compilers and debuggers into their own software products. Open-source compilers and debuggers, due to their incomplete functionality, cannot be directly integrated into users' self-developed software products.

[0004] In response to the increasing demand for real-time industrial simulation and the limitations of existing compilers and debuggers, there is an urgent need to develop a remote debugger that can be quickly integrated into users' own software products. This remote debugger uses standard TCP communication; users only need to create a TCP client to establish a connection with the remote debugger. Program debugging on the lower-level machine can be achieved through simple control commands. Summary of the Invention

[0005] This invention designs a remote program debugger. This remote program debugger uses standard TCP communication, facilitating rapid integration into user-defined software to achieve remote debugging of lower-level machine programs. Furthermore, in addition to controlling single-step execution, jump-in execution, and jump-out execution, this remote program debugger also supports breakpoints and watchpoints, making it powerful enough to support the functional requirements of real-time software simulation.

[0006] The technical solution adopted by the present invention to achieve the above objectives is as follows:

[0007] A remote program debugger, comprising:

[0008] A TCP server, used to be invoked by remote TCP clients;

[0009] The program debugging function component is used to implement debugging functions for the program being debugged based on the call commands of the remote TCP client.

[0010] A method for implementing a remote program debugger includes the following steps:

[0011] 1) Start the TCP server and wait for the TCP client's access command;

[0012] 2) Once the client connects, create a separate thread for implementing program debugging components;

[0013] 3) In the detached thread, the program debugging component creates a control socket and sets a breakpoint at the "main" function of the program being debugged;

[0014] 4) After receiving the control command from the TCP client, the TCP server calls the program debugging function component to implement different program debugging functions.

[0015] The debugging functions include:

[0016] help: to assist;

[0017] start: to begin;

[0018] getinfo: Gets the current status;

[0019] process continue: Continue running;

[0020] process stop: to stop;

[0021] Step over: Skip the execution step by step;

[0022] Step out: Step back to the previous execution;

[0023] Step into: Enter the execution step by step;

[0024] break line: Add a line breakpoint;

[0025] break name: Adds a breakpoint by the function name;

[0026] get breakpoints: Query breakpoint information;

[0027] del break: Deletes the breakpoint;

[0028] `set break enable`: Enables / disables breakpoints;

[0029] watch: Add a variable observation point;

[0030] get watchpoints: View watchpoints;

[0031] `set watch enable`: Enables / disables watchpoints;

[0032] get watch values: retrieves the values ​​of the observed variables;

[0033] Set watch value: Sets the value of the watchpoint variable;

[0034] del watch: Delete the watchpoint.

[0035] The present invention has the following beneficial effects and advantages:

[0036] 1. This remote program debugger uses standard TCP communication, allowing users' own software to establish a connection simply by creating a TCP client. Program debugging on the lower-level machine can be achieved through simple control commands. This makes the remote program debugger easier to integrate into users' own software.

[0037] 2. This remote program debugger has powerful program debugging capabilities, which enables users' software to fully support functions such as online simulation. Attached Figure Description

[0038] Figure 1 This is a system architecture diagram of the present invention;

[0039] Figure 2 This is the working logic diagram of the present invention. Detailed Implementation

[0040] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0041] A remote program debugger is provided, through which other software on the host computer can call simple instructions through simple standard communication methods to achieve remote program debugging function.

[0042] This remote debugger includes functions such as help, start, get current status, continue running, stop, step skip execution, step back execution, step into execution, add line breakpoint, add function name breakpoint, query breakpoint information, delete breakpoint, enable / disable breakpoint, add variable watchpoint, view watchpoint, enable / disable watchpoint, get watchpoint variable value, set watchpoint variable value, and delete watchpoint.

[0043] like Figure 1 The diagram shown illustrates the system architecture of this invention. The system is divided into a program debugging component and a TCP server. The program debugging component is responsible for implementing the debugging functions of the program being debugged, while the TCP server is interconnected with the TCP client.

[0044] A remote program debugger includes the following functional components: a program debugging function component and a TCP server.

[0045] The program debugging function component is responsible for implementing the debugging function of the program being debugged.

[0046] The TCP server is responsible for being invoked by remote TCP clients to further enable remote debugging functionality.

[0047] A remote program debugger that performs the following steps:

[0048] 1) First, start the TCP server;

[0049] 2) After the client connects, create a separate thread for implementing the program debugging function component;

[0050] 3) In the program debugging function component, first create a control socket, and then set a breakpoint at the "main" function location;

[0051] 4) After receiving control commands from the remote client, the TCP server calls the program debugging function component to implement different program debugging functions.

[0052] A remote program debugger supports the following debugging functions: help, start, getinfo, process continue, process stop, step over, step out, step into, breakline, break name, get breakpoints, del break, set break enable, watch, get watchpoints, set watch enable, get watch values, set watch value, and del watch.

[0053] like Figure 2 The diagram shows the working logic of this invention. After the remote program debugger starts, it first activates the TCP server and enters a listening state. When a TCP client connects, it initializes the program debugging component, creating a debug control socket. At this time, the TCP server is in a command processing state, waiting for control commands from the TCP client. Upon receiving different control commands, it invokes the relevant functions of the program debugging component and provides feedback.

[0054] The following details the supported commands:

[0055] 1. "help": Returns all supported commands and their descriptions;

[0056] 2. "start": Start debugging. This command must be run before debugging. The debugger adds the first breakpoint at the beginning of the main function by default, so after executing the start command, the program will stop at the beginning of the main function. When the program triggers the breakpoint at the main function, debugging can begin normally.

[0057] 3. "getinfo": Used to obtain the current state of the program being debugged. This includes whether it is running. If the program is currently running, it will only display the program state and thread information; if the program is idle, this statement will also display frame information.

[0058] 4. "Process Continue": The program continues running and returns "success" on success.

[0059] 5. "process stop": The program stops; if successful, it returns "success."

[0060] 6. "stepover:<thread_id> ": Step over execution, followed by the thread ID after the colon.

[0061] 7. "stepout:<thread_id> ": Step back to return to the previous step, followed by the thread ID after the colon.

[0062] 8. "stepinto:<thread_id> ": Step into execution, followed by the thread ID after the colon.

[0063] 9. "break line:<program name>,<line number>": Adds a breakpoint to the specified line in the specified file. Upon successful execution, the debugger will return "success" along with the breakpoint information.

[0064] 10. "break name:<function name>,<program name>": Adds a breakpoint at the specified function name.

[0065] 11. "get breakpoints": Retrieves information on all current breakpoints, including breakpoint ID, breakpoint type, location, and whether it is enabled.

[0066] 12. "del break:<breakpoint id>": Deletes the breakpoint with the specified id.

[0067] 13. "set break enable:<breakpoint id>, <true false>”: Sets whether breakpoints are enabled.

[0068] 14. "watch:<variable name>": Adds a watchpoint with the specified variable name. Once the watchpoint is added, the program will stop when the value of that variable changes. You can enable this option to prevent the program from pausing.

[0069] 15. "get watchpoints": Retrieves all watchpoint information, including watchpoint IDs and enable information.

[0070] 16. "set watch enable:<observation point id>, <true false>”: Sets whether the observation point with the specified ID is enabled.

[0071] 17. "get watch values": Gets the variable values ​​of all watch points. The debugger will return the watch point ID, variable name, and variable value for all variables.

[0072] 18. "set watch value:<observation point id>, <value>”: Sets the variable value for the specified observation point ID.

[0073] 19. "del watch:<observation point id>": Deletes the observation point with the specified id.< / value> < / true> < / true>

Claims

1. A remote program debugger, characterized in that, include: A TCP server, used to be invoked by remote TCP clients; The program debugging function component is used to implement debugging functions for the program being debugged based on the call commands of the remote TCP client.

2. The method for implementing a remote program debugger according to claim 1, characterized in that, Includes the following steps: 1) Start the TCP server and wait for the TCP client's access command; 2) Once the client connects, create a separate thread for implementing program debugging components; 3) In the detached thread, the program debugging component creates a control socket and sets a breakpoint at the "main" function of the program being debugged; 4) After receiving the control command from the TCP client, the TCP server calls the program debugging function component to implement different program debugging functions.

3. The method for implementing a remote program debugger according to claim 2, characterized in that, The debugging functions include: help: to assist; start: to begin; getinfo: Gets the current status; process continue: Continue running; process stop: to stop; Step over: Skip the execution step by step; Step out: Step back to the previous execution; Step into: Enter the execution step by step; break line: Add a line breakpoint; break name: Adds a breakpoint by the function name; get breakpoints: Query breakpoint information; del break: Deletes the breakpoint; `set break enable`: Enables / disables breakpoints; watch: Add a variable observation point; get watchpoints: View watchpoints; `set watch enable`: Enables / disables watchpoints; get watch values: retrieves the values ​​of the observed variables; Set watch value: Sets the value of the watchpoint variable; del watch: Delete the watchpoint.