Program tracking method and system based on linux shared memory data mirror image

A technology of shared memory and data mirroring, which is applied in inter-program communication, multi-program device, program control design, etc., can solve problems such as increased overhead, and achieve the effect of flexible debugging, real-time viewing and tracking

Pending Publication Date: 2020-03-27
SHENZHEN SINEXCEL ELECTRIC
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, most of the routine debugging of linux programs has methods such as gdb and printf to output logs to print some fixed information that developers or maintenance personnel need to pay attention to. These methods are indeed very practical and efficient, and are common debugging methods for programmers under the linux platform, but These methods will add additional overhead to the application, so in the official version, the debugging code may be turned off

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Program tracking method and system based on linux shared memory data mirror image
  • Program tracking method and system based on linux shared memory data mirror image

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] refer to figure 1 , 2 , Embodiment 1 of the present invention provides a program tracking method based on linux shared memory data mirroring, the method comprising:

[0032] S101. After the tracked program creates an original internal variable space of a program in the system, a shared memory space is created through the shmget and shmat system functions of linux, and the shared memory space is used as a copy of the original internal variable space;

[0033] S102. When the tracked program modifies the data content of the variable during operation, synchronously modifies the data content of the variable copy in the shared memory space;

[0034] S103. The debugging tool finds and connects to the shared memory space through the shmget and shmat system functions, and reads the data content of the variable copy in the shared memory space when receiving the debugging trace instruction.

[0035] Wherein, creating the shared memory space through the shmget and shmat system fu...

Embodiment 2

[0042] This embodiment discloses a program tracking system based on linux shared memory data mirroring, including a tracked program and a debugging tool running on the system,

[0043] The tracked program includes: a shared memory space creation module, which is used to create a shared memory space by shmget and shmat system functions of linux after the original internal variable space of a program is created in the system, and the shared memory space is used as the A copy of the original internal variable space; a variable synchronization module, used to synchronously modify the data content of the variable copy in the shared memory space when the tracked program modifies the data content of the variable during operation;

[0044] Described debugging tool comprises: shared memory space connection module, is used for finding and connecting described shared memory space by shmget, shmat system function; Variable tracking module, is used for reading in described shared memory spa...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a program tracking method and system based on a linux shared memory data mirror image. The method comprises the steps that after a tracked program creates an original internalvariable space of the program in a system, a shared memory space is created through shmget and shmat system functions of linux, and the shared memory space serves as a copy of the original internal variable space; when the tracked program modifies the data content of the variable in operation, the data content of the variable copy in the shared memory space is synchronously modified; a debugging tool finds out and is connected with the shared memory space through shmget and shmat system functions and reads the data content of the variable copy in the shared memory space when a debugging tracking instruction is received. According to the method and the system, the debugging process does not influence the variable numerical value in the program and the running result of the original program,the debugging is very flexible, and the variable of the tracked program can be checked and tracked in real time.

Description

technical field [0001] The invention relates to the field of data debugging, in particular to a program tracking method and system based on linux shared memory data mirroring. Background technique [0002] At present, most of the routine debugging of linux programs has methods such as gdb and printf to output logs to print some fixed information that developers or maintenance personnel need to pay attention to. These methods are indeed very practical and efficient, and are common debugging methods for programmers under the linux platform, but These methods will add additional overhead to the application, so in the official version, the debugging code may be turned off. Contents of the invention [0003] The technical problem to be solved by the present invention is to provide a new debugging method, which can facilitate the user to view the current value and state change of the internal variable data when the program is running in real time, and the debugging process will ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36G06F9/54
CPCG06F11/3636G06F11/3644G06F9/544
Inventor 郑吉祥
Owner SHENZHEN SINEXCEL ELECTRIC
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products