Software debugging method, device, computer equipment and storage medium
By receiving the data pass-through command, controlling the execution task port to be in the data pass-through state, sending the debugging command and returning the result, the problem of low software debugging efficiency in the existing technology is solved, and the effect of quickly obtaining debugging results is achieved.
Patent Information
- Application Number
- CN202011209205.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-03
AI Technical Summary
Existing software debugging methods require restarting the software, causing the problem site to be destroyed. The probability of reproducing the problem is low or takes a long time to recur, which reduces debugging efficiency.
By receiving the data pass-through command, the execution task port is controlled to be in the data pass-through state, debugging commands are sent and execution results are returned, without restarting the software, the problem site is maintained and debugging efficiency is improved.
It achieves rapid acquisition of debugging results without destroying the scene of software problems, and improves the efficiency of software debugging.
Smart Images

Figure CN112286820B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a software debugging method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of computer technology, debugging software with problems has become one of the daily tasks of technicians. At present, the method of debugging software with problems is either to debug the software with problems by welding the serial port line, or to debug the software with problems through the debugging bridge port after switching to the mode of the debugging bridge port by inputting commands.
[0003] However, the current methods all require restarting the software that has the problem to take effect. However, restarting the software that has the problem will destroy the problem site where the software is located. It takes a long time to reproduce problems with a low probability of occurrence or problems that only occur in a specific environment, which makes it impossible to capture the logs of the software that has the problem in a timely and effective manner, reducing the efficiency of software debugging. Summary of the invention
[0004] Based on this, it is necessary to provide a software debugging method, apparatus, computer equipment and storage medium that can improve the efficiency of software debugging in order to solve the above technical problems.
[0005] A software debugging method, the method comprising:
[0006] Receive a data pass-through command for a port that performs a task;
[0007] According to the data pass-through command, controlling the execution task port to be in a data pass-through state;
[0008] Sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0009] The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0010] In one of the embodiments, controlling the execution task port to be in a data pass-through state according to the data pass-through command includes: responding to the data pass-through command, controlling the execution task port to be in a data pass-through state through a preconfigured control program.
[0011] In one embodiment, after receiving a data pass-through command for the execution task port and before controlling the execution task port to be in a data pass-through state according to the data pass-through command, the method further includes:
[0012] Get the input verification password;
[0013] Verifying the input verification password;
[0014] When the verification password is correct, the received data pass-through command is executed to control the execution task port to be in a data pass-through state.
[0015] In one of the embodiments, the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write an execution result obtained by executing the debugging command into the execution task port.
[0016] In one embodiment, the method further comprises:
[0017] After the task execution port is controlled to be in a data direct pass state, when a command to exit the data direct pass state is received, the task execution port is controlled to exit the data direct pass state.
[0018] In one embodiment, returning the execution result through the execution task port in the data pass-through state includes:
[0019] The execution result is returned to the serial port tool through the execution task port in the data pass-through state.
[0020] In one of the embodiments, the target software includes at least one of an application and a kernel; the execution result is a debug log;
[0021] The step of returning the execution result to the serial port tool through the execution task port in the data pass-through state includes:
[0022] When the target software is a kernel, returning the debug log of the kernel to the serial port tool through the execution task port in the data pass-through state;
[0023] When the target software is an application program, the debugging log of the application program is returned to the serial port tool through the execution task port in the data pass-through state.
[0024] A software debugging device, comprising:
[0025] A receiving module, used for receiving a data pass-through command for a port for executing a task;
[0026] A control module, used for controlling the execution task port to be in a data pass-through state according to the data pass-through command;
[0027] A sending module, used for sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0028] The return module is used to return the execution result through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0029] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0030] Receive a data pass-through command for a port that performs a task;
[0031] According to the data pass-through command, controlling the execution task port to be in a data pass-through state;
[0032] Sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0033] The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0034] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0035] Receive a data pass-through command for a port that performs a task;
[0036] According to the data pass-through command, controlling the execution task port to be in a data pass-through state;
[0037] Sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0038] The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0039] The above-mentioned software debugging method, device, computer equipment and storage medium, the terminal controls the execution task port to be in a data direct state according to the received data direct command for the execution task port. At this time, there is no need to restart the target software. Under the condition of maintaining the problem scene of the target software to be debugged, the user only needs to input the debugging command, and the terminal will send the debugging command input by the user to the target software through the execution task port in the data direct state. When the terminal monitors that the execution task port has the execution result corresponding to the debugging command input by the user returned by the target software, the execution result is returned through the execution task port. In this way, the user can obtain the execution result corresponding to the input debugging command, thereby improving the efficiency of software debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flowchart of a software debugging method in one embodiment;
[0041] Figure 2 The flowchart of software debugging steps in one embodiment is shown;
[0042] Figure 3 A flowchart of a software debugging method in another embodiment;
[0043] Figure 4 is a structural block diagram of a software debugging device in one embodiment;
[0044] Figure 5 is a structural block diagram of a software debugging device in another embodiment;
[0045] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] In one embodiment, Figure 1 As shown, a software debugging method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0048] Step 102: Receive a data pass-through command for the port that executes the task.
[0049] Among them, the execution task port is a port that needs to be opened by a preset program before it is facing the user. It can be understood that the native function of the execution task port in the system is not user-oriented, that is, it can only accept commands sent from within the system, but cannot accept commands entered by the user. The solution of the present application is to improve the execution task port so that the execution task port can face the user and thus can accept commands entered by the user. Then, when the execution task port is opened by the terminal and faces the user, the execution task port can be used to transmit the debugging commands entered by the user and to return the corresponding results of the debugging commands to the user. The data pass-through command is a command that puts the execution task port in a data pass-through state.
[0050] Specifically, the user inputs a data direct access command for the port for executing the task, and the terminal receives the data direct access command input for the port for executing the task.
[0051] In one embodiment, the data pass-through command may be an “AT (attention)” command.
[0052] In one embodiment, the execution task port may be an "AT" port.
[0053] Step 104: According to the data pass-through command, the task execution port is controlled to be in a data pass-through state.
[0054] Among them, the data pass-through state is a state in which the task execution port is opened and facing the user.
[0055] It can be understood that the execution task port in the data direct state can be used to receive and forward the instructions input by the user and return the corresponding data obtained by executing the instructions. That is, when the execution task port is in the data direct state, the terminal forwards the relevant commands input by the user through the execution task port and returns the corresponding data to the user through the execution task port.
[0056] Specifically, the terminal opens the execution task port according to the received data direct command for the execution task port, so that the execution task port is in a data direct state.
[0057] In one embodiment, the function implemented by the data pass-through command may be a "PASS function".
[0058] In one embodiment, after the terminal controls the task execution port to be in a data pass-through state, the task execution port can have a "debug serial port" function.
[0059] Step 106, sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged.
[0060] The debugging command is a command for debugging the target software.
[0061] Specifically, the user inputs a corresponding debugging command for the target software to be debugged, and the terminal sends the debugging command input by the user to the target software through the execution task port in the data pass-through state.
[0062] In one embodiment, the debugging command may be a debugging and analysis command commonly used by an operating system for debugging target software input by a user on a terminal, for example, a debugging and analysis command commonly used by a Linux system.
[0063] Step 108, returning the execution result through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0064] Specifically, the terminal sends the debugging command input by the user to the target software through the execution task port in the data pass-through state, and then monitors the execution task port. The target software can execute the debugging command, obtain the execution result corresponding to the debugging command, and send the execution result to the execution task port in the data pass-through state. When the terminal monitors the execution task port that there is an execution result corresponding to the debugging command sent by the target software, it returns the execution result to the user through the execution task port.
[0065] The software debugging method, device, computer equipment and storage medium described above, the terminal controls the execution task port to be in a data pass-through state according to the received data pass-through command for the execution task port. At this time, there is no need to restart the target software. While maintaining the problem site of the target software to be debugged, the user only needs to input the debugging command, and the terminal will send the debugging command input by the user to the target software through the execution task port in the data pass-through state. When the terminal monitors that the execution task port has the execution result returned by the target software corresponding to the debugging command input by the user, the execution result is returned through the execution task port. In this way, the user can obtain the execution result corresponding to the input debugging command, thereby improving the efficiency of software debugging.
[0066] In one embodiment, according to the data pass-through command, controlling the execution task port to be in the data pass-through state includes: responding to the data pass-through command, controlling the execution task port to be in the data pass-through state through a preconfigured control program.
[0067] The pre-configured control program is a control program pre-configured for the task execution port, and is used to control the task execution port to be in a data pass-through state according to a data pass-through command.
[0068] Specifically, the user inputs a data direct access command in the terminal. In response to the data direct access command input by the user, the terminal controls the execution task port to be in a data direct access state through a pre-configured control program.
[0069] In one embodiment, the user can call out an interface for inputting a data direct command through a shortcut command, and then input a data direct command on the interface.
[0070] In one embodiment, the terminal may display an interface for inputting a data direct command in response to a user triggering an operation on a button.
[0071] In one embodiment, the user inputs the command "AT+GTDEBUGPASS=1". In response to the command "AT+GTDEBUGPASS=1" input by the user, the terminal controls the execution task port to be in a data pass-through state through a pre-configured control program.
[0072] In this embodiment, the terminal can control the task execution port to be in the data through state according to the data through command through the pre-configured control program. The user can use the task execution port as long as he inputs the data through command, thereby improving the efficiency of the user in using the task execution port.
[0073] In one embodiment, after receiving a data pass-through command for an execution task port, before controlling the execution task port to be in a data pass-through state according to the data pass-through command, it also includes: obtaining an input verification password; verifying the input verification password; when the verification password is correct, executing the received data pass-through command to control the execution task port to be in a data pass-through state.
[0074] The verification password is a password applied for in advance by the user who is debugging the target software, and is used to verify whether the user is qualified to debug the target software.
[0075] Specifically, the terminal prompts the user to enter a verification password in response to the data pass-through command input by the user. The user enters the verification password according to the prompt. The terminal obtains the verification password input by the user and verifies the verification password. When the terminal verifies that the verification password is correct, the task execution port is controlled to be in a data pass-through state.
[0076] In one embodiment, when the terminal verifies that the verification password input by the user is incorrect, it can return to the state of monitoring the data direct command. The user needs to re-enter the data direct command and then re-enter the verification password according to the prompt to verify the identity.
[0077] In one embodiment, when the terminal verifies that the verification password input by the user is incorrect, the terminal can directly prompt the user to re-enter the verification password. The user then re-enters the verification password according to the prompt to verify the identity.
[0078] In one embodiment, the terminal can prompt the user to enter the verification password on the same interface where the data direct command is entered, and the user enters the verification password according to the prompt on the same interface where the data direct command is entered.
[0079] In one embodiment, after the user inputs the data direct access command, the terminal can automatically pop up a verification password interface to prompt the user to enter the verification password in the verification password interface. The verification password interface and the interface for inputting the data direct access command are displayed independently of each other.
[0080] In this embodiment, the user identity is verified through the verification password input by the user, which can prevent users who are not qualified to use the task execution port from using the task execution port, thereby strengthening the management and control of the task execution port.
[0081] In one embodiment, the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write the execution result obtained by executing the debugging command into the execution task port.
[0082] Among them, the system function is a function that comes with the terminal system and is used to process corresponding data according to the received command.
[0083] Specifically, the user inputs the corresponding debugging command for the target software to be debugged. The terminal receives the debugging command input by the user through the execution task port and sends the debugging command to the target software. Then, the target software executes the debugging command input by the user by calling the system function. After the target software executes the debugging command input by the user, it sends the execution result obtained by executing the debugging command to the execution task port.
[0084] In one embodiment, when the target software encounters a network disconnection problem, the user can send multiple debugging commands to view the network status, and determine the specific problem of the target software through the execution results corresponding to the debugging commands returned by the target software.
[0085] In one embodiment, the user can send an "ifconfig" debugging command to check the status of the network card to see whether the network card has obtained an IP address.
[0086] In one embodiment, the user may also send a routing debugging command to check whether the routing table is correct.
[0087] In one embodiment, the user may also send a network information table debugging command (ie, an iptables debugging command) to view the relevant network information table.
[0088] In one embodiment, the user may also use the system's modem debugging command (ie, cat debugging command) to view the contents of the file on the target software.
[0089] In one embodiment, the user may also use the "dmesg" debugging command to view the kernel's most recent print information.
[0090] In one embodiment, the user may also use a communication connection debugging command (eg, a "ping 8.8.8.8" debugging command) to check whether the network is able to connect for communication.
[0091] In this embodiment, the terminal directly sends the debugging command input by the user to the target software through the execution task port. Then, the target software can call the system function execution according to the debugging command input by the user, and return the corresponding execution result to the execution task port. Through these steps, the corresponding execution result can be obtained without destroying the problem site of the target software, thereby quickly obtaining the execution result related to the target software.
[0092] In one embodiment, the method further includes: after controlling the task execution port to be in a data pass-through state, when receiving a command to exit the data pass-through state, controlling the task execution port to exit the data pass-through state.
[0093] Specifically, after the terminal controls the task execution port to be in the data direct state, it monitors the command input by the user. When the terminal receives a command to exit the data direct state, it controls the task execution port to exit the data direct state.
[0094] In one embodiment, when the terminal receives the "AT+GTDEBUGPASS=0" command input by the user, the terminal controls the execution task port to exit the data direct pass state and return to the state before receiving the data direct pass command.
[0095] In this embodiment, the terminal can control the task execution port to exit the data direct pass state by receiving the command to exit the data direct pass state, thereby simplifying the process of controlling the task execution port and reducing the workload of relevant staff.
[0096] In one embodiment, returning the execution result through the execution task port in the data direct pass state includes: returning the execution result to the serial port tool through the execution task port in the data direct pass state.
[0097] The serial port tool is software connected to the execution task port and is used to receive the execution result returned from the execution task port.
[0098] Specifically, after the terminal sends the debugging command input by the user to the target software through the execution task port, it monitors the execution task port in the data pass-through state. When the terminal monitors the execution result sent by the target software on the execution task port, it returns the execution result to the serial port tool through the execution task port.
[0099] In one embodiment, for example, a problem occurs in the software for downloading files. The terminal sends the debugging command input by the user to the software for downloading files through the execution task port. The software for downloading files calls the system function to execute the debugging command, and writes the execution result obtained by executing the debugging command into the execution task port. The terminal then returns the execution result to the serial port tool through the execution task port. When the execution task port is in the data pass-through state, the user only needs to input the debugging command to view the corresponding execution result on the serial port tool.
[0100] In this embodiment, the execution result corresponding to the debugging command input by the user is returned to the serial port tool through the execution task port, so that the user can obtain the execution result of the target software for analyzing the problem, thereby improving the efficiency of the user in obtaining the execution result and improving the efficiency of the user in debugging the target software.
[0101] In one embodiment, the target software includes at least one of an application and a kernel; the execution result is a debug log; and the execution result is returned to the serial port tool through an execution task port in a data pass-through state, including: when the target software is the kernel, the kernel debug log is returned to the serial port tool through the execution task port in a data pass-through state; when the target software is an application, the application debug log is returned to the serial port tool through the execution task port in a data pass-through state.
[0102] Among them, the application is a computer program used by the terminal to complete at least one specific task. The debug log is the result generated after the target software executes the debug command. The kernel is the software used to control the hardware-related work of the terminal.
[0103] Specifically, the terminal determines whether the target software that the user needs to debug is an application or a kernel according to the debugging command input by the user. When the terminal determines that the target software that the user needs to debug is the kernel, the kernel debugging log is returned to the serial port tool through the execution task port in the data pass-through state. When the terminal determines that the target software that the user needs to debug is an application, the application debugging log is returned to the serial port tool through the execution task port in the data pass-through state.
[0104] In this embodiment, the kernel debug log or the application debug log can be returned to the serial port tool through the execution task port in the data pass-through state. Therefore, without destroying the problem site of the target software, the user can easily and quickly obtain the debug log of the kernel or application with the problem, thereby improving the efficiency of debugging the target software.
[0105] In one embodiment, Figure 2 The flowchart of the software debugging steps is shown in FIG. 1 . The terminal receives a data pass-through command and prompts the user to enter a verification password. The terminal obtains the verification password entered by the user (i.e., "obtains the verification code") and verifies the verification password. When the terminal verifies that the verification password is incorrect, it returns to the state before receiving the data pass-through command, which is indicated by "end" in the figure. When the terminal verifies that the verification password is correct, it controls the execution task port to be in the data pass-through state according to the received data pass-through command. Next, the terminal waits for the user to enter a debugging command. When the terminal receives a command to exit the data pass-through state, it controls the execution task port to exit the data pass-through state and return to the state before receiving the data pass-through command, which is indicated by "end" in the figure. When the terminal receives a debugging command entered by the user for debugging the target software, the debugging command is sent to the target software through the execution task port. After the target software obtains the debugging command, it executes it through the system call function. Finally, the target software writes the execution result obtained by executing the debugging command to the execution task port.
[0106] like Figure 3 As shown, in one embodiment, another software debugging method is provided, and the method specifically includes the following steps:
[0107] Step 302 monitors the data pass-through command for the port that performs the task.
[0108] Step 304 receives a data pass-through command for the port that performs the task.
[0109] Step 306 obtains the input verification password; and verifies the input verification password.
[0110] It can be understood that when the verification password is correct, step 308 is executed, and when the verification password is incorrect, the process returns to step 302 for execution.
[0111] Step 308 controls the execution task port to be in a data pass-through state through a pre-configured control program in response to the data pass-through command.
[0112] It can be understood that after the control execution task port is in the data pass-through state, when a command to exit the data pass-through state is received, step 311 is executed, and when a debugging command is received, step 312 is executed.
[0113] Step 311 controls the execution task port to exit the data pass-through state.
[0114] Step 312 sends the input debugging command to the target software through the execution task port in the data pass-through state.
[0115] The target software is the software to be debugged; the target software includes at least one of an application and a kernel; the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write the execution result obtained by executing the debugging command into the execution task port.
[0116] It can be understood that when the target software is a kernel, step 314 is executed, and when the target software is an application, step 316 is executed.
[0117] Step 314 returns the kernel debugging log to the serial port tool through the execution task port in the data pass-through state.
[0118] The execution result is the debug log.
[0119] Step 316 returns the debugging log of the application to the serial port tool through the execution task port in the data pass-through state.
[0120] The execution result is the result obtained by the target software executing the debugging command.
[0121] It should be understood that although Figure 1 to Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 to Figure 3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0122] In one embodiment, Figure 4 As shown, a software debugging device 400 is provided, including: a receiving module 402, a control module 404, a sending module 406 and a returning module 408, wherein:
[0123] The receiving module 402 is used to receive a data pass-through command for the port executing the task.
[0124] The control module 404 is used to control the execution task port to be in a data pass-through state according to the data pass-through command.
[0125] The sending module 406 is used to send the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged.
[0126] The return module 408 is used to return the execution result through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0127] In one embodiment, the control module 404 is further configured to control the execution task port to be in a data pass-through state through a pre-configured control program in response to a data pass-through command.
[0128] like Figure 5 As shown, in one embodiment, the device further comprises:
[0129] The verification module 403 is used to obtain the input verification password; verify the input verification password; when the verification password is correct, execute the received data direct command to control the execution task port to be in the data direct state.
[0130] In one embodiment, the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write the execution result obtained by executing the debugging command into the execution task port.
[0131] In one embodiment, the control module 404 is further configured to control the task execution port to exit the data direct pass state after the task execution port is in the data direct pass state and when receiving a command to exit the data direct pass state.
[0132] In one embodiment, the return module 408 is further configured to return the execution result to the serial port tool via the execution task port in the data pass-through state.
[0133] In one embodiment, the return module 408 is further configured to return the kernel debugging log to the serial port tool through the execution task port in a data pass-through state when the target software is the kernel.
[0134] In one embodiment, the return module 408 is further configured to return the debugging log of the application to the serial port tool through the execution task port in the data pass-through state when the target software is an application.
[0135] For the specific definition of the software debugging device, please refer to the definition of the software debugging method above, which will not be repeated here. Each module in the above-mentioned software debugging device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0136] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a software debugging method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0137] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0138] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0139] Receive a data pass-through command for a port that performs a task;
[0140] According to the data pass-through command, the control execution task port is in the data pass-through state;
[0141] The input debugging command is sent to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0142] The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0143] In one embodiment, when the processor executes the computer program, the following steps are further implemented: in response to a data pass-through command, the execution task port is controlled to be in a data pass-through state through a pre-configured control program.
[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining an input verification password; verifying the input verification password; when the verification password is correct, executing the received data pass-through command to control the execution task port to be in a data pass-through state.
[0145] In one embodiment, the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write the execution result obtained by executing the debugging command into the execution task port.
[0146] In one embodiment, when executing the computer program, the processor further implements the following steps: after controlling the execution task port to be in a data pass-through state, when receiving a command to exit the data pass-through state, the execution task port is controlled to exit the data pass-through state.
[0147] In one embodiment, when executing the computer program, the processor further implements the following steps: returning the execution result to the serial port tool through the execution task port in the data pass-through state.
[0148] In one embodiment, when executing the computer program, the processor further implements the following steps: when the target software is the kernel, the kernel debugging log is returned to the serial port tool through the execution task port in the data pass-through state.
[0149] In one embodiment, when executing the computer program, the processor further implements the following steps: when the target software is an application program, the debugging log of the application program is returned to the serial port tool through the execution task port in the data pass-through state.
[0150] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0151] Receive a data pass-through command for a port that performs a task;
[0152] According to the data pass-through command, the control execution task port is in the data pass-through state;
[0153] The input debugging command is sent to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged;
[0154] The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
[0155] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: in response to a data pass-through command, the execution task port is controlled to be in a data pass-through state through a pre-configured control program.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining an input verification password; verifying the input verification password; when the verification password is correct, executing the received data pass-through command to control the execution task port to be in a data pass-through state.
[0157] In one embodiment, the debugging command is used to instruct the target software to call a system function to execute the debugging command, and write the execution result obtained by executing the debugging command into the execution task port.
[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after controlling the execution task port to be in a data pass-through state, when a command to exit the data pass-through state is received, the execution task port is controlled to exit the data pass-through state.
[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: returning the execution result to the serial port tool through the execution task port in the data pass-through state.
[0160] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target software is the kernel, the kernel debugging log is returned to the serial port tool through the execution task port in the data pass-through state.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target software is an application program, the debugging log of the application program is returned to the serial port tool through the execution task port in the data pass-through state.
[0162] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by commanding the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0163] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0164] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A software debugging method, characterized in that: The method comprises: receiving a data pass-through command for a task execution port; the data pass-through command is a command that puts the task execution port in a data pass-through state; In response to the data direct access command, the task execution port is controlled to be in a data direct access state through a pre-configured control program; the data direct access state is a state in which the task execution port is opened and faces the user; the task execution port in the data direct access state is used to receive and forward instructions input by the user, and return corresponding data obtained by executing the instructions; Sending the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged; the debugging command is a command for debugging the target software; The execution result is returned through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
2. The method according to claim 1, characterized in that: After receiving the data pass-through command for the execution task port and before controlling the execution task port to be in the data pass-through state according to the data pass-through command, the method further includes: Get the input verification password; Verifying the input verification password; When the verification password is correct, the received data pass-through command is executed to control the execution task port to be in a data pass-through state.
3. The method according to claim 2, characterized in that The verification password is a password applied for in advance by a user who is debugging the target software, and is used to verify whether the user is qualified to debug the target software.
4. The method according to claim 1, characterized in that: The debugging command is used to instruct the target software to call a system function to execute the debugging command, and write an execution result obtained by executing the debugging command into the execution task port.
5. The method according to claim 1, characterized in that The method further comprises: After the task execution port is controlled to be in a data direct pass state, when a command to exit the data direct pass state is received, the task execution port is controlled to exit the data direct pass state.
6. The method according to claim 1, characterized in that The returning the execution result through the execution task port in the data pass-through state includes: The execution result is returned to the serial port tool through the execution task port in the data pass-through state.
7. The method according to claim 6, characterized in that The target software includes at least one of an application and a kernel; the execution result is a debugging log; The step of returning the execution result to the serial port tool through the execution task port in the data pass-through state includes: When the target software is a kernel, returning the debug log of the kernel to the serial port tool through the execution task port in the data pass-through state; When the target software is an application program, the debugging log of the application program is returned to the serial port tool through the execution task port in the data pass-through state.
8. A software debugging device, characterized in that: The device comprises: A receiving module, used for receiving a data pass-through command for a task execution port; the data pass-through command is a command to put the task execution port in a data pass-through state; The control module is used to control the execution task port to be in a data direct state through a pre-configured control program in response to the data direct command; the data direct state is a state in which the execution task port is opened and faces the user; the execution task port in the data direct state is used to receive and forward instructions input by the user, and return corresponding data obtained by executing the instructions; A sending module, used to send the input debugging command to the target software through the execution task port in the data pass-through state; the target software is the software to be debugged; the debugging command is a command for debugging the target software; The return module is used to return the execution result through the execution task port in the data pass-through state; the execution result is the result obtained by the target software executing the debugging command.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
