Breakpoint debugging method, system, electronic device and computer readable storage medium

By receiving client commands and parsing device-side breakpoint information into debugger instruction format, efficient breakpoint debugging of Linux devices is achieved, solving the problem of relying on professional personnel in existing technologies and improving debugging efficiency and flexibility.

CN122111820APending Publication Date: 2026-05-29GUANDONG MEDIA INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANDONG MEDIA INTELLIGENT TECH CO LTD
Filing Date
2024-11-22
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies require professionals to manually input GDB debugger commands when performing breakpoint debugging on Linux devices, which increases debugging costs, is inefficient, and is not suitable for remote or distributed development models.

Method used

This paper provides a breakpoint debugging method that receives client commands, extracts breakpoint information from the device, parses it into debugger instruction format, enables breakpoint debugging of the target device, simplifies the operation process, and reduces reliance on professional personnel.

Benefits of technology

It reduces the cost and time of breakpoint debugging, improves debugging efficiency, supports remote and distributed development, and simplifies the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111820A_ABST
    Figure CN122111820A_ABST
Patent Text Reader

Abstract

The application discloses a breakpoint debugging method and system, an electronic device and a computer readable storage medium, relates to the technical field of device debugging, and is applied to a device end and comprises the following steps: receiving a breakpoint debugging command sent by a client; extracting breakpoint information from a preset breakpoint storage area; based on the instruction format of a debugger of the device end, analyzing and processing the breakpoint information to obtain target breakpoint information; based on the target breakpoint information, debugging a running program of a target device by using the debugger to obtain a debugging result, and sending the debugging result to the client. The application can reduce the cost of debugging and improve the efficiency of debugging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of equipment debugging technology, and in particular to a breakpoint debugging method, system, electronic device, and computer-readable storage medium. Background Technology

[0002] Breakpoint debugging is a crucial tool in software development, enabling developers to quickly locate faults in the code and improve development efficiency.

[0003] However, currently, debugging running programs on Linux devices and other Linux-based operating systems typically requires specialized personnel familiar with the GDB (GNU Debugger) command line. These personnel need to input a series of commands into the GDB debugger to guide it in performing breakpoint debugging on the Linux device's running programs. This approach not only increases the cost of debugging but also results in low efficiency. Summary of the Invention

[0004] The main objective of this application is to provide a breakpoint debugging method, system, electronic device, and computer-readable storage medium, which aims to reduce debugging costs and improve debugging efficiency.

[0005] To achieve the above objectives, this application provides a breakpoint debugging method applied to a device, the method comprising:

[0006] Receive breakpoint debugging commands sent by the client;

[0007] Extract breakpoint information from the preset breakpoint storage area;

[0008] Based on the instruction format of the debugger on the device, the breakpoint information is parsed and processed to obtain the target breakpoint information;

[0009] The debugger debugs the target device's running program based on the target breakpoint information, obtains the debugging results, and sends the debugging results to the client.

[0010] In one embodiment, before the step of extracting breakpoint information from a preset breakpoint storage area, the method further includes:

[0011] Detect whether the target device's program is running;

[0012] If the target device's running program is detected to be in a running state, then the step of extracting breakpoint information from the preset breakpoint storage area is executed.

[0013] In one embodiment, the step of debugging the target device's running program based on the target breakpoint information to obtain debugging results includes:

[0014] Detect whether the target breakpoint information is valid;

[0015] If the target breakpoint information is found to be valid, the target breakpoint information is added to the running program of the target device to debug the running program of the target device and obtain the debugging result.

[0016] In one embodiment, the step of detecting whether the target breakpoint information is valid includes:

[0017] Determine the program location where the target breakpoint information needs to be added;

[0018] If the target device's running program exists at the program location, then the target breakpoint information is determined to be valid.

[0019] In one embodiment, the method further includes:

[0020] When the main thread of the running program is paused, the debugger is controlled to enter non-stop mode so that the remaining threads in the running program can continue to run.

[0021] In one embodiment, after the step of debugging the target device's running program based on the target breakpoint information to obtain the debugging result, the method further includes:

[0022] Decrement the count value of the breakpoint state counter by one to obtain the target count value, and determine whether the target count value is zero;

[0023] If so, then the breakpoint debugging process for the target device will end;

[0024] If not, return to the step of extracting breakpoint information from the preset breakpoint storage area.

[0025] In one embodiment, the step of sending the debugging results to the client includes:

[0026] A communication connection is established between the process of the debugger and the process of the target device to send the debugging results from the debugger to the target device;

[0027] The debugging results are fed back to the client through the target device.

[0028] Furthermore, to achieve the above objectives, this application also provides a breakpoint debugging system, the breakpoint debugging system comprising:

[0029] The client is used to output breakpoint debugging commands to the device.

[0030] On the device side, the device side includes a target device, which is used to receive breakpoint debugging commands sent by the client; extract breakpoint information from a preset breakpoint storage area; and parse the breakpoint information based on the instruction format of the debugger on the device side to obtain target breakpoint information.

[0031] The device also includes a debugger, which is used to debug the running program of the target device based on the target breakpoint information, obtain the debugging results, and send the debugging results to the client.

[0032] In addition, to achieve the above objectives, this application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the breakpoint debugging method described above.

[0033] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the breakpoint debugging method described above.

[0034] In addition, to achieve the above objectives, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the breakpoint debugging method described above.

[0035] This application provides a breakpoint debugging method applied to the device side. First, it receives a breakpoint debugging command sent by the client, and then extracts breakpoint information from a preset breakpoint storage area. Next, based on the debugger's instruction format on the device side, it parses and processes the breakpoint information to convert the breakpoint information format into the debugger's instruction format to obtain the target breakpoint information. Then, based on the target breakpoint information, the debugger debugs the target device's running program to obtain the debugging result, and sends the debugging result to the client, thus completing the breakpoint debugging process for the target device.

[0036] Therefore, the breakpoint debugging method provided in this application allows users to send breakpoint debugging commands to the device via a client when debugging the target device. This allows the user to indirectly provide the debugger with relevant debugging instructions (i.e., target breakpoint information) by utilizing the breakpoint information stored on the device and related parsing processes. Compared to the conventional method that requires professionals to directly input debugging instructions into the debugger, this application does not rely on professionals familiar with debugger instructions. Furthermore, users can remotely set and debug breakpoints on the running program on the device via the client, greatly simplifying the breakpoint debugging process. Therefore, this application not only has low debugging costs but also high debugging efficiency. Attached Figure Description

[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating the implementation of a conventional debugging method provided in the embodiments of this application;

[0040] Figure 2 A flowchart illustrating the breakpoint debugging method provided in the first embodiment of this application;

[0041] Figure 3 A schematic diagram illustrating the implementation principle of multiple independent threads and processes provided in the third embodiment of this application;

[0042] Figure 4 A flowchart illustrating the breakpoint debugging method provided in the fourth embodiment of this application;

[0043] Figure 5 This is a flowchart illustrating the data transfer process provided in the sixth embodiment of this application.

[0044] Figure 6 A flowchart illustrating the implementation of the breakpoint debugging method provided in this application embodiment;

[0045] Figure 7 A flowchart illustrating the implementation of the breakpoint debugging system provided in this application embodiment;

[0046] Figure 8 This is a schematic diagram of the hardware operating environment involved in the embodiments of this application.

[0047] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0048] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0049] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0050] Breakpoint debugging is a crucial tool in software development, enabling developers to quickly locate faults in the code and improve development efficiency.

[0051] However, currently, debugging running programs on Linux devices and other Linux-based operating systems typically requires specialized personnel familiar with the GDB (GNU Debugger) command line. These personnel need to input a series of commands into the GDB debugger to guide it in performing breakpoint debugging on the Linux device's running programs. This approach not only increases the cost of debugging but also results in low efficiency.

[0052] For standard debugging methods, please refer to... Figure 1 Specifically, relevant personnel input GDB commands into the GDB debugger via a terminal; then, the GDB debugger traces and debugs the target device's running program based on the input commands. Thus, the entire debugging process involves debugging the target device's running program by writing commands through the terminal. This not only results in poor debugging flexibility and a long debugging cycle, but is also unfavorable for remote or distributed development models.

[0053] Based on this, this application provides a breakpoint debugging method applied to the device side. First, it receives a breakpoint debugging command sent by the client, and then extracts breakpoint information from a preset breakpoint storage area. Next, based on the debugger's instruction format on the device side, it parses and processes the breakpoint information to convert the breakpoint information format into the debugger's instruction format to obtain the target breakpoint information. Then, based on the target breakpoint information, the debugger debugs the target device's running program to obtain the debugging result, and sends the debugging result to the client, thus completing the breakpoint debugging process for the target device.

[0054] Therefore, the breakpoint debugging method provided in this application allows users to send breakpoint debugging commands to the device via a client when debugging the target device. This allows the user to indirectly provide the debugger with relevant debugging instructions (i.e., target breakpoint information) by utilizing the breakpoint information stored on the device and related parsing processes. Compared to the conventional method that requires professionals to directly input debugging instructions into the debugger, this application does not rely on professionals familiar with debugger instructions. Furthermore, users can remotely set and debug breakpoints on the running program on the device via the client, greatly simplifying the breakpoint debugging process. Therefore, this application not only has low debugging costs but also high debugging efficiency.

[0055] Furthermore, since the breakpoint debugging method provided in this application does not rely on local debugging, this application not only offers high debugging flexibility and a short debugging cycle, but also benefits remote or distributed development models.

[0056] In the breakpoint debugging method of this application, the device that acts as the execution subject can be an electronic device, such as a mobile phone, tablet computer, or computer; or it can be a control device, control system, or control circuit that can realize data processing, network communication, and program execution functions. This embodiment does not specifically limit it in this regard.

[0057] The following description uses electronic devices as the execution subject as an example to illustrate the various embodiments.

[0058] Based on this, this application proposes a breakpoint debugging method according to the first embodiment, please refer to... Figure 2 When applied to the device side, the breakpoint debugging method may include steps S10 to S40:

[0059] Step S10: Receive the breakpoint debugging command sent by the client;

[0060] It should be noted that the client can be the developer's IDE (Integrated Development Environment). The breakpoint debugging command is used to indicate that breakpoint debugging should be performed on the running program of the target device.

[0061] Step S20: Extract breakpoint information from the preset breakpoint storage area;

[0062] It should be noted that breakpoint information is used to define a series of parameters and attributes required for a breakpoint. Breakpoint information may include, but is not limited to, location information indicating the program location where the breakpoint needs to be set, and status information indicating the breakpoint state (enabled / disabled state). The breakpoint storage area is used to store breakpoint information sent by the client. The breakpoint storage area can store breakpoint information sent by the client in list form. The breakpoint information stored in the breakpoint storage area is not added to the target device's running program. After a breakpoint is retrieved from the breakpoint storage area, that breakpoint information is cleared from the breakpoint storage area. The device can also set a breakpoint status counter to record the number of breakpoints stored in the breakpoint storage area.

[0063] Additionally, it should be noted that a communication connection can be established between the device and the client via Ethernet, and data can be transmitted using a specific communication protocol (such as the UDAP bus network protocol) to ensure reliable and efficient communication. The client can output breakpoint debugging commands to the device when breakpoint debugging conditions are triggered (e.g., by pressing a relevant button).

[0064] Step S30: Based on the instruction format of the debugger on the device, the breakpoint information is parsed and processed to obtain the target breakpoint information;

[0065] It should be noted that the debugger can be the GDB debugger, and the target breakpoint information is the breakpoint information after being converted into the debugger's instruction format.

[0066] Understandably, debuggers have their own specific instruction sets and communication protocols. To ensure that breakpoint information can be correctly identified and processed by the debugger, it is necessary to parse and process the breakpoint information based on the debugger's instruction format in order to convert it into the debugger's instruction format.

[0067] In one feasible implementation, step S30 may include steps S31 to S32:

[0068] Step S31: Check whether the target breakpoint information is valid;

[0069] It should be noted that the purpose of detecting the validity of target breakpoint information is to determine whether the target breakpoint information can be used to debug the target device's running program.

[0070] Furthermore, in one feasible implementation, step S31 may include steps S311 to S312:

[0071] Step S311: Determine the program location where the target breakpoint information needs to be added;

[0072] Step S312: If the target device's running program has a program location, then the target breakpoint information is determined to be valid.

[0073] For example, taking program position as program behavior, assuming that the target device's running program has 5 lines, if the target breakpoint information needs to be added to the 4th line of program behavior, then the target breakpoint information is determined to be valid; if the target breakpoint information needs to be added to the 6th line of program behavior, then the target breakpoint information is determined to be invalid.

[0074] Step S32: If the target breakpoint information is found to be valid, the target breakpoint information is added to the target device's running program to debug the target device's running program and obtain the debugging result.

[0075] This implementation method sets the target breakpoint information to be valid, meaning that the target breakpoint information can be used to debug the target device's running program, in order to improve the reliability of debugging.

[0076] Step S40: Debug the target device's running program using a debugger based on the target breakpoint information, obtain the debugging results, and send the debugging results to the client.

[0077] It should be noted that the target device is a device with a Linux operating system, and the executable program for the target device refers to the program used to support the operation of the target device. In cases where problems exist with the executable program, the debugging results can record the specific problematic code and its location.

[0078] This embodiment provides a breakpoint debugging method applied to the device side. First, it receives a breakpoint debugging command sent by the client, and then extracts breakpoint information from a preset breakpoint storage area. Next, based on the debugger's instruction format on the device side, it parses the breakpoint information to convert the breakpoint information format into the debugger's instruction format to obtain the target breakpoint information. Then, based on the target breakpoint information, the debugger debugs the target device's running program to obtain the debugging result, and sends the debugging result to the client, thus completing the breakpoint debugging process for the target device.

[0079] Therefore, the breakpoint debugging method provided in this embodiment allows users to send breakpoint debugging commands to the device via a client when debugging the target device. This allows the user to indirectly provide the debugger with relevant debugging instructions (i.e., target breakpoint information) by utilizing the breakpoint information stored on the device and related parsing processing. Compared to the conventional method that requires professionals to directly input debugging instructions into the debugger, this embodiment does not rely on professionals familiar with debugger instructions. Furthermore, users can remotely set and debug breakpoints on the running program on the device via the client, greatly simplifying the breakpoint debugging process. Therefore, this embodiment not only has low debugging costs but also high debugging efficiency.

[0080] Based on the first embodiment described above, a second embodiment of the breakpoint debugging method of this application is proposed. In the second embodiment, before step S20, the breakpoint debugging method may further include steps S01 to S02:

[0081] Step S01: Detect whether the target device's program is running;

[0082] Step S02: If the running program of the target device is detected to be in a running state, then the step of extracting breakpoint information from the preset breakpoint storage area is executed.

[0083] It should be noted that the running status of a program on a target device can be determined by detecting its running flag. For example, assuming the running flag is a Boolean value, if the running flag of the target device's program is detected as "true", then it can be determined that the target device's program is running.

[0084] This embodiment sets the program to run on the target device before breakingpoint debugging, thereby enabling dynamic analysis of the target device's program. This improves the efficiency and accuracy of problem location, and ultimately enhances the quality and efficiency of software development.

[0085] Based on the first and / or second embodiments described above, a third embodiment of the breakpoint debugging method of this application is proposed. In the third embodiment, the target device in the device end can be configured with independent threads and processes to perform operations such as communication with the client and the debugger, and parsing of breakpoint information.

[0086] In one feasible approach, please refer to Figure 3 The target device may include a user process 21 and a parsing process 22. The user process 21 may include a communication thread 211 for communicating with the client 10 and the debugger 30, a main thread 212 for extracting breakpoint information and sending it to the parsing process 22, and a user thread 213 for the debugger 30 to track and debug. The parsing process 22 is used to parse and process the received breakpoint information to obtain the target breakpoint information and send the target breakpoint information to the debugger 30.

[0087] Based on the first, second, and / or third embodiments described above, a fourth embodiment of the breakpoint debugging method of this application is proposed. In this fourth embodiment, to ensure that the debugger can fully utilize all breakpoint information stored in the breakpoint storage area of ​​the target device during breakpoint debugging, a breakpoint status counter can be used to record the number of breakpoint information stored in the breakpoint storage area (the breakpoint information stored in the breakpoint storage area has not been added to the running program of the target device). Based on this, please refer to... Figure 4 When the target device's program is running, the system checks if the breakpoint status counter is zero. If it is zero, the breakpoint can be skipped, and the target device's program can continue running. If it is not zero, it means that the breakpoint storage area still stores breakpoint information, and the target device can continue to extract breakpoint information from the breakpoint storage area, decrementing the corresponding breakpoint status counter. After parsing the extracted breakpoint information, the target device sends the parsed breakpoint information to the debugger. The debugger then checks if the parsed breakpoint information is valid. If valid, the debugger adds the parsed breakpoint information to the target device's program; if invalid, it returns to the step of checking if the breakpoint status counter is zero.

[0088] Compared with the prior art, the breakpoint debugging method proposed in this embodiment has the same beneficial effects as the breakpoint debugging method proposed in the first embodiment above, and will not be described in detail here.

[0089] Based on the first, second, third, and / or fourth embodiments described above, a fifth embodiment of the breakpoint debugging method of this application is proposed. In the fifth embodiment, the breakpoint debugging method may further include step S001:

[0090] Step S001: When the main thread of the running program is suspended, control the debugger to enter non-stop mode so as to control the remaining threads in the running program to continue running.

[0091] It's important to note that in non-stop mode, if one or more threads pause at a breakpoint, the other threads will continue running. In all-stop mode, if any one thread stops running, all threads will stop running.

[0092] This embodiment configures the debugger to enter non-stop mode when the main thread of the running program is paused, so that the remaining threads in the running program can continue to run. This avoids prolonging the debugging cycle due to the remaining threads pausing along with the main thread and improves the efficiency of breakpoint debugging.

[0093] Based on the first, second, third, fourth, and / or fifth embodiments described above, a sixth embodiment of the breakpoint debugging method of this application is proposed. In the sixth embodiment, step S40 may include steps S41 to S42:

[0094] Step S41: Establish a communication connection between the debugger process and the target device process to send the debugging results from the debugger to the target device;

[0095] Step S42: The debugging results are fed back to the client through the target device.

[0096] Understandably, shared memory can be configured by establishing a communication connection between the debugger's process and the target device's process. The debugger can then use shared memory to send debugging results to the target device, which in turn can send those results back to the client. Subsequently, by displaying the debugging results on the client's interface, users can intuitively determine the breakpoint debugging results of the target device's running program, facilitating rapid location and repair of problems.

[0097] Furthermore, to help understand how breakpoint debugging commands, breakpoint information, and debugging results are transmitted between the target device and the debugger, please refer to [link / reference]. Figure 5Specifically: Client 10 can send a breakpoint debugging command to user process 21 of the target device through a communication network (e.g., Ethernet network); after receiving the breakpoint debugging command, user process 21 of the target device can send the extracted breakpoint information to parsing process 22 through a message queue; after parsing the breakpoint information into target breakpoint information, parsing process 22 sends the target breakpoint information to debugger 30 through an anonymous pipe; debugger 30 will debug the running program of the target device based on the received target breakpoint information, obtain the debugging result, and send the debugging result to user process 21 of the target device through shared memory; after receiving the debugging result, user process 21 of the target device will feed back the debugging result to client 10 through the communication network.

[0098] For example, to help understand the overall implementation flow of the breakpoint debugging method obtained by combining the above embodiments, please refer to... Figure 6 , specifically:

[0099] After the user triggers the relevant button in the client's IDE, the client will output a breakpoint debugging command to the user process of the target device. After receiving the breakpoint debugging command, the user process will extract the breakpoint information from the preset breakpoint storage area and send the extracted breakpoint information to the parsing process of the target device. After receiving the breakpoint information, the parsing process will parse the breakpoint information according to the instruction format of the debugger on the device, obtain the target breakpoint information, and send the target breakpoint information to the debugger. After receiving the target breakpoint information, the debugger will trace the user process of the target device based on the target breakpoint information, thereby realizing breakpoint debugging of the running program of the target device.

[0100] It should be noted that this example is only for the purpose of assisting in understanding this application and does not constitute a limitation on the breakpoint debugging method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0101] This application also provides a breakpoint debugging system; please refer to... Figure 7 A breakpoint debugging system may include:

[0102] Client 10 is used to output breakpoint debugging commands to device 100;

[0103] Device 100 includes target device 20, which is used to receive breakpoint debugging commands sent by client 10; extract breakpoint information from a preset breakpoint storage area; and parse and process the breakpoint information based on the instruction format of debugger 30 of device 100 to obtain target breakpoint information.

[0104] The device 100 also includes a debugger 30, which is used to debug the running program of the target device 20 based on the target breakpoint information, obtain the debugging results, and send the debugging results to the client 10.

[0105] In one embodiment, the device 100 is further configured to:

[0106] Detect whether the program running on the target device 20 is in operation;

[0107] If the running program of the target device 20 is detected to be running, the step of extracting breakpoint information from the preset breakpoint storage area is executed.

[0108] In one embodiment, the device 100 is further configured to:

[0109] Check if the target breakpoint information is valid;

[0110] If the target breakpoint information is found to be valid, the target breakpoint information is added to the running program of the target device 20 to debug the running program of the target device 20 and obtain the debugging results.

[0111] In one embodiment, the device 100 is further configured to:

[0112] Determine the program location where the target breakpoint information needs to be added;

[0113] If the target device 20 has a program location in its running program, then the target breakpoint information is determined to be valid.

[0114] In one embodiment, the device 100 is further configured to:

[0115] When the main thread of the running program is paused, the debugger 30 is put into non-stop mode to control the remaining threads in the running program to continue running.

[0116] In one embodiment, the device 100 is further configured to:

[0117] Decrement the count value of the breakpoint state counter by one to obtain the target count value, and then determine whether the target count value is zero;

[0118] If so, then end the breakpoint debugging process for target device 20;

[0119] If not, return to the step of retrieving breakpoint information from the preset breakpoint storage area.

[0120] In one embodiment, the device 100 is further configured to:

[0121] A communication connection is established between the process of debugger 30 and the process of target device 20 to send the debugging results from debugger 30 to target device 20;

[0122] The debugging results are fed back to the client 10 through the target device 20.

[0123] The breakpoint debugging system provided in this application, employing the breakpoint debugging method described in the above embodiments, can reduce debugging costs and improve debugging efficiency. Compared with the prior art, the beneficial effects of the breakpoint debugging system provided in this application are the same as those of the breakpoint debugging method provided in the above embodiments, and will not be repeated here.

[0124] This application also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the breakpoint debugging method in the above embodiments.

[0125] The following is for reference. Figure 8 It shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of this application. Figure 8 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0126] like Figure 8 As shown, the electronic device may include a processing unit 101 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage device 103 into a random access memory (RAM) 104. The RAM 104 also stores various programs and data required for the operation of the electronic device. The processing unit 101, ROM 102, and RAM 104 are interconnected via a bus 105. An input / output (I / O) interface 106 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 106: input devices 107 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 108 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 103 including, for example, magnetic tapes, hard disks, etc.; and communication devices 109. The communication device 109 allows the electronic device to exchange data with other devices wirelessly or via wired communication. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.

[0127] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 103, or installed from ROM 102. When the computer program is executed by processing device 101, it performs the functions defined in the methods of the embodiments of this application.

[0128] The electronic device provided in this application, employing the breakpoint debugging method described in the above embodiments, can reduce debugging costs and improve debugging efficiency. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the breakpoint debugging method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0129] It should be understood that various parts of the embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0130] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the above claims.

[0131] This application also provides a computer-readable storage medium storing a computer program that can run on a processor. The computer program is used to execute the breakpoint debugging method in the above embodiments.

[0132] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0133] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0134] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by an electronic device, the electronic device causes the electronic device to: receive a breakpoint debugging command sent by a client; extract breakpoint information from a preset breakpoint storage area; parse and process the breakpoint information based on the instruction format of the debugger on the device side to obtain target breakpoint information; debug the running program of the target device based on the target breakpoint information using the debugger to obtain debugging results, and send the debugging results to the client.

[0135] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0137] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0138] The computer-readable storage medium provided in this application embodiment stores computer-readable program instructions for executing the above-described breakpoint debugging method, which can reduce debugging costs and improve debugging efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application embodiment are the same as the beneficial effects of the breakpoint debugging method provided in the above embodiments, and will not be repeated here.

[0139] This application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the breakpoint debugging method described above.

[0140] The computer program product provided in this application can reduce debugging costs and improve debugging efficiency. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the breakpoint debugging method provided in the above embodiments, and will not be repeated here.

[0141] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. A breakpoint debugging method, characterized in that, Applied to the device side, the method includes: Receive breakpoint debugging commands sent by the client; Extract breakpoint information from the preset breakpoint storage area; Based on the instruction format of the debugger on the device, the breakpoint information is parsed and processed to obtain the target breakpoint information; The debugger debugs the target device's running program based on the target breakpoint information, obtains the debugging results, and sends the debugging results to the client.

2. The breakpoint debugging method as described in claim 1, characterized in that, Before the step of extracting breakpoint information from the preset breakpoint storage area, the method further includes: Detect whether the target device's program is running; If the target device's running program is detected to be in a running state, then the step of extracting breakpoint information from the preset breakpoint storage area is executed.

3. The breakpoint debugging method as described in claim 1, characterized in that, The step of debugging the target device's running program based on the target breakpoint information to obtain the debugging result includes: Detect whether the target breakpoint information is valid; If the target breakpoint information is found to be valid, the target breakpoint information is added to the running program of the target device to debug the running program of the target device and obtain the debugging result.

4. The breakpoint debugging method as described in claim 3, characterized in that, The step of detecting whether the target breakpoint information is valid includes: Determine the program location where the target breakpoint information needs to be added; If the target device's running program exists at the program location, then the target breakpoint information is determined to be valid.

5. The breakpoint debugging method as described in any one of claims 1 to 4, characterized in that, The method further includes: When the main thread of the running program is paused, the debugger is controlled to enter non-stop mode so that the remaining threads in the running program can continue to run.

6. The breakpoint debugging method as described in any one of claims 1 to 4, characterized in that, After the step of debugging the target device's running program based on the target breakpoint information to obtain the debugging result, the method further includes: Decrement the count value of the breakpoint state counter by one to obtain the target count value, and determine whether the target count value is zero; If so, then the breakpoint debugging process for the target device will end; If not, return to the step of extracting breakpoint information from the preset breakpoint storage area.

7. The breakpoint debugging method as described in any one of claims 1 to 4, characterized in that, The step of sending the debugging results to the client includes: A communication connection is established between the process of the debugger and the process of the target device to send the debugging results from the debugger to the target device; The debugging results are fed back to the client through the target device.

8. A breakpoint debugging system, characterized in that, The breakpoint debugging system includes: The client is used to output breakpoint debugging commands to the device. On the device side, the device side includes a target device, which is used to receive breakpoint debugging commands sent by the client; extract breakpoint information from a preset breakpoint storage area; and parse the breakpoint information based on the instruction format of the debugger on the device side to obtain target breakpoint information. The device also includes a debugger, which is used to debug the running program of the target device based on the target breakpoint information, obtain the debugging results, and send the debugging results to the client.

9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the breakpoint debugging method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the breakpoint debugging method according to any one of claims 1 to 7.