A real-time debugging method based on embedded real-time system

A real-time system and debugging method technology, applied in software testing/debugging, instrumentation, error detection/correction, etc., can solve problems affecting efficiency, difficult to maintain, difficult to analyze, etc., to achieve easy maintenance, easy reason analysis, and high execution efficiency Effect

Inactive Publication Date: 2021-03-09
CHENGDU UNIV
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to provide a real-time debugging method based on an embedded real-time system, which is used to solve the problems in the prior art that the embedded system is difficult to maintain, affects efficiency, and is difficult to analyze when using the log debugging method to debug embedded systems

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
  • A real-time debugging method based on embedded real-time system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0038] combined with figure 1 As shown, a real-time debugging method based on an embedded real-time system, including:

[0039] Step S100: install a GUI program and a GDB debugging program on a PC, install a multi-thread server program and an interrupt service routine ISR on an embedded device, and connect the PC to the embedded device through the TCP / IP protocol;

[0040] Step S200: set a breakpoint to the code line in the original program in the GUI program, analyze the intermediate file produced by the gcc compiler, obtain the instruction address corresponding to the code line where the breakpoint is located, and then send the instruction address to said embedded device;

[0041] Step S300: the multithreaded server program installed on the embedded device receives the instruction address, and replaces the instruction in the instruction address with an interrupt trigger instruction;

[0042] Step S400: run the interrupt service routine ISR;

[0043] Step S500: the interru...

Embodiment 2

[0049] On the basis of Example 1, in conjunction with the attached figure 1 As shown, a real-time debugging method based on an embedded real-time system, the step S200 specifically includes:

[0050] Step S210: set in the GUI program, click with the mouse on the left side of a certain code line of the original program, and then set a breakpoint in this line;

[0051] Step S220: the gcc compiler compiles and links the original program to obtain an executable file containing debugging information, and then uses the nm command to analyze the executable file to obtain the instruction address corresponding to the code line where the breakpoint is located;

[0052] Step S230: the PC sends the instruction address to the embedded device.

[0053] working principle:

[0054] Debug the embedded real-time system with breakpoints by artificially setting breakpoints. After clicking the mouse to set a breakpoint in the original program, when compiling the original program in the compiler,...

Embodiment 3

[0061] On the basis of embodiment 2, in conjunction with the attached figure 1 As shown, the context information in step S500 includes global variables, local variables and function call stacks.

[0062] Context information includes global variables, local variables, and function call stacks. Context information contains as little content as possible, which is enough to meet the needs and reduce the running time of interrupt service routines.

[0063] Further, the context information does not exceed 256 bytes.

[0064] The amount of context information is small, so the running time of the interrupt service program can be ignored relative to the running time of the original program.

[0065] Further, the PC is based on the Linux operating system, and the embedded device is based on the ARM.

[0066] The PC based on the Linux operating system and the embedded device based on ARM form the cross-debugging of the embedded system, and the debugging is carried out online and intera...

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 real-time debugging method based on an embedded real-time system, comprising: installing a GUI program and a GDB debugging program on a PC, installing a multi-thread server program and an interrupt service program on an embedded device, connecting the PC and Device connection; set a breakpoint on the code line in the original program in the GUI program, get the instruction address, and send the instruction address to the embedded device; the multi-threaded server program replaces the instruction in the instruction address with an interrupt trigger instruction and runs the interrupt service program ; The interrupt service routine grabs the context information and sends it to the GDB debugger; the GDB debugger parses the context information and outputs it. The invention combines the log debugging method and the breakpoint debugging method at the same time, so that when debugging the real-time system, the information of the specified code context can be viewed arbitrarily, the program execution flow is not suspended, the execution sequence of the program is not affected, the execution efficiency is high, and the context information GDB debugging The output in the program is easy to analyze the cause and easy to maintain.

Description

technical field [0001] The invention relates to the technical field of timing control of an embedded real-time system, specifically, a real-time debugging method based on an embedded real-time system. Background technique [0002] Today, with the rapid development of digital information technology and network technology, embedded systems have widely penetrated into people's daily life and other aspects. As the complexity of real-time embedded systems continues to increase, the cost of inefficient debugging methods increases. Given that the complexity of today's embedded applications continues to rise, debugging these systems will be a key factor in speeding time to market and providing a robust end product. With applications' use of multi-threading and interrupt nesting, most of a developer's time is currently spent debugging. The real-time nature of applications makes it more difficult to isolate failure problems with multiple events occurring simultaneously. Embedded re...

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 Patents(China)
IPC IPC(8): G06F11/36
CPCG06F11/3636
Inventor 李平勇
Owner CHENGDU UNIV
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