WO2021244088A1 - 程序控制方法、装置、计算机设备及存储介质 - Google Patents

程序控制方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021244088A1
WO2021244088A1 PCT/CN2021/079097 CN2021079097W WO2021244088A1 WO 2021244088 A1 WO2021244088 A1 WO 2021244088A1 CN 2021079097 W CN2021079097 W CN 2021079097W WO 2021244088 A1 WO2021244088 A1 WO 2021244088A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
debugging information
processed
analysis result
input parameter
Prior art date
Application number
PCT/CN2021/079097
Other languages
English (en)
French (fr)
Inventor
何兴诗
吴永航
张泽建
曾维新
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2021244088A1 publication Critical patent/WO2021244088A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Definitions

  • This application relates to the field of computer technology, for example, to a program control method, device, computer equipment, and storage medium.
  • Embedded technology is a device or system that performs special functions and is controlled by an internal computer.
  • embedded systems play an irreplaceable role in production, life, industry, and agriculture.
  • embedded devices play a decisive role, and their applications require uninterrupted operation.
  • This application provides a program control method, device, computer equipment, and storage medium to dynamically control the program, thereby improving the control efficiency of the program.
  • a program control method including:
  • the debugging information generated during the compilation of the program to be processed; wherein the debugging information is acquired through the instrumentation function preset in the program to be processed; parse the debugging information to obtain the debugging information analysis result; according to the debugging
  • the information analysis result controls the to-be-processed program.
  • a program control device including:
  • the debugging information acquisition module is set to acquire the debugging information generated by the program to be processed during the compilation period; wherein the debugging information is acquired through the instrumentation function preset in the program to be processed; the debugging information analysis module is set as the analysis location The debugging information is used to obtain the debugging information analysis result; the program control module is configured to control the to-be-processed program according to the debugging information analysis result.
  • a computer device is also provided, and the computer device includes:
  • One or more processors a storage device configured to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors can realize the above Program control method.
  • a computer storage medium is also provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned program control method is realized.
  • FIG. 1 is a schematic flowchart of a program control method provided by an embodiment of this application
  • FIG. 2 is a schematic flowchart of another program control method provided by an embodiment of the application.
  • Figure 3 is a schematic diagram of a program control provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a program control device provided by an embodiment of the application.
  • Fig. 5 is a schematic structural diagram of a computer device provided by this application.
  • module means, “component” or “unit” used to indicate elements is only for the description of the present application, and has no special meaning in itself. Therefore, “module”, “part” or “unit” can be used in a mixed manner.
  • FIG. 1 is a schematic flowchart of a program control method provided by an embodiment of this application. This method is suitable for situations where the program is dynamically controlled.
  • the method can be executed by the program control device provided in the present application, and the program control device can be implemented by software and/or hardware, and integrated in the computer equipment.
  • the program control method provided by the embodiment of the present application includes:
  • S110 Acquire debugging information generated during compilation of the program to be processed; the debugging information is acquired through an instrumentation function preset in the program to be processed.
  • the program to be processed may be a program that needs to be dynamically controlled, for example, a C language program or a C++ voice program, etc.
  • the embodiment of the present application does not limit the type of programming language applied to the processing program.
  • the debugging information may be related information generated during compilation of the program to be processed, and has a certain data format, and the type of the data format depends on the type of programming language used. For example, if the programming language of the program to be processed is C language, the debugging information may be pointer information or input parameter information when calling a function, etc.
  • the embodiment of the present application does not limit the type of debugging information.
  • the program to be processed can be dynamically controlled by a computer device connected to the program to be processed.
  • the instrumentation function can be preset in the program to be processed.
  • the number of instrumentation functions can be one or more, and can be set according to actual needs.
  • the embodiment of the present application does not limit the number of instrumentation functions.
  • the instrumentation function built in the program to be processed can obtain the debugging information generated by the program to be processed, and send the acquired debugging information to the computer device connected to the program to be processed.
  • the debugging information parsing result may be the parsing result obtained by parsing the debugging information.
  • the debugging information can be analyzed to obtain a matching debugging information analysis result.
  • the debugging information analysis result can reflect the parameter information involved in the compilation and operation of the program to be processed.
  • the result of debugging information analysis may be, for example, stack information of function calls or input parameter values. That is, the debugging information may be the behavior data of the program to be processed, and the result of the debugging information analysis may be a semantic analysis of the behavior data.
  • the debugging information Since the debugging information has a certain data format, the data format corresponding to the debugging information may be different when the type of the programming language adopted by the program to be processed is different. Therefore, the debugging information needs to be parsed according to the data format of the debugging information to avoid parsing failure.
  • the result of the debugging information analysis of the debugging information may be: Byte 1 data plus words
  • the processing program can be controlled according to the debugging information analysis result.
  • the so-called control may be, for example, monitoring the internal running status of the program to be processed, changing the output information of the program to be processed, or changing the running behavior of the program to be processed, etc.
  • the embodiment of the present application does not limit the type of control behavior of the processing program.
  • the program to be processed is controlled according to the analysis result of the debugging information, which can be the program to be processed in the dynamic control running state.
  • the debugging information generated by the program to be processed during compilation is obtained through the instrumentation function preset in the program to be processed, and the program to be processed in the running state is dynamically controlled according to the debugging information analysis result of the debugging information . That is, the program control method provided by the embodiment of the present application does not need to interrupt the running state of the program to be processed, so there is no need to recompile the software version of the program to be processed and replace the new program to be processed, and there is no need to restart the device or the program to be processed. , It can be dynamically controlled during the running process of the pending program to solve the problem of the failure of the pending program, or to change the behavioral requirements of the pending program, etc. It can be seen that the dynamic control of the program during the running of the program can greatly reduce the time consumed for program modification, recompilation, replacement of the old version, and re-operation, thereby improving the control efficiency of the program.
  • the debugging information generated by the program to be processed during the compilation period is obtained through the instrumentation function preset in the program to be processed, so as to analyze the obtained debugging information to obtain the debugging information analysis result, and then to be processed according to the debugging information analysis result
  • the program is controlled to solve the problem of low efficiency when the program needs to be controlled through editing operations such as recompiling, publishing, and replacing, so that the software version is not recompiled, the software is not replaced, the device is not restarted, or the program is restarted. , Dynamically control the program, thereby improving the control efficiency of the program.
  • FIG. 2 is a schematic flowchart of another program control method provided by an embodiment of the application. This embodiment is described on the basis of the foregoing embodiment. In this embodiment, a variety of optional implementation manners for controlling the program to be processed according to the debugging information analysis result are given. As shown in Figure 2, the method of this embodiment may include:
  • the computer equipment that dynamically controls the program to be processed needs to establish a connection with the program to be processed before it can control the program to be processed.
  • the instrumentation function may not take any action at this time, that is, no capture operation of the function call behavior is performed.
  • the instrumentation function starts to perform the capture operation, and captures the function call behavior in the program to be processed, so as to obtain the debugging information generated by the program to be processed during compilation.
  • the debugging information may include the current pointer variable, stack pointer, input parameter type, input parameter stack position, and input parameter structure obtained when the instrumented function captures the function call behavior At least one of.
  • the debugging information may include, but is not limited to, the current pointer variable stack pointer, input parameter type, input parameter stack position, and input parameter structure obtained when the instrumented function captures the function call behavior.
  • the current pointer variable can be used to determine the function type captured by the instrumented function, and can be used to determine the calling chain of the calling function of the program to be processed.
  • the stack pointer can be used to determine the stack information of the program to be processed.
  • Input parameter type, input parameter stack position, and input parameter structure can be used to determine input parameter information, such as input parameter type or input parameter value.
  • S220 Parse the debugging information to obtain a debugging information parsing result.
  • the debugging information analysis result may include at least one of call stack associated information, input parameter type, and input parameter value called by the function call behavior in the program to be processed; wherein ,
  • the call stack associated information may include call chain and/or stack information.
  • the debugging information analysis result may include, but is not limited to, the call stack associated information, input parameter type, and input parameter value called by the function call behavior in the program to be processed.
  • the call stack related information can include the call chain and/or stack information, which can be obtained by parsing the current pointer variable and the stack pointer, the input parameter type can be obtained by analyzing the input parameter type in the debugging information, and the input parameter value can be Analyze and obtain according to the input parameter stack position and input parameter structure.
  • S230 Execute a dynamic instruction that has a mapping relationship with the instrumentation function according to the result of the debugging information analysis, so as to control the program to be processed.
  • the dynamic instructions include dynamic commands and/or dynamic scripts.
  • Dynamic instructions can be used to dynamically control the program to be processed, such as modifying the behavior of calling functions.
  • Dynamic instructions may include, but are not limited to, dynamic commands and/or dynamic scripts.
  • Dynamic commands can be commands commonly used in programs, such as delay, print parameters, parameter save, return and other commands.
  • the dynamic script can refer to the explanatory script written in a high-level language. The dynamic script can be dynamically modified without the need for operations such as compilation, packaging and publishing.
  • the computer device can execute dynamic commands such as dynamic commands and/or dynamic scripts that have a mapping relationship with the instrumentation function according to the obtained debugging information analysis results, and dynamically control the processing program.
  • the instrumentation function can correspond to one or more dynamic commands and/or dynamic scripts. That is, the instrumentation function can establish a mapping relationship with one or more dynamic commands and/or dynamic scripts. The number of dynamic commands and/or dynamic scripts correspondingly set is limited.
  • Fig. 3 is a schematic diagram of a program control provided by an embodiment of the present application.
  • an embedded C language program is used as a program to be processed, and a behavior capture suite is used to dynamically control the runtime C program.
  • the behavior capture suite can be run in a computer device connected to the program to be processed.
  • multiple instrumentation functions can be preset in the C program code (3 instrumentation functions are preset in Figure 3). When the C program does not establish a connection with the behavior capture suite at runtime, the instrumentation function does nothing.
  • the instrumentation function can start to capture the function call behavior in the C program to obtain the current Internet Protocol (Internet Protocol) generated by the runtime C program during compilation.
  • Internet Protocol Internet Protocol
  • IP Protocol
  • the behavior capture suite includes a remote dynamic analysis program, which can receive debugging information sent by the instrumentation function.
  • the remote dynamic analysis program can analyze the debugging information and analyze the stack structure of the runtime C program, so as to obtain the debugging information analysis results such as the call chain of the current calling function call, the stack information, the input parameter type of the calling function, and the input parameter value. That is, to obtain the analysis result of the stack result.
  • the remote dynamic analysis program can execute dynamic commands and/or dynamic scripts corresponding to the instrumentation function according to the analysis results of the stack results, so as to monitor the running status of the C program at runtime and change the output printing of the program. Dynamic control operations such as information or changing the running behavior of the program.
  • the behavior capture kit may also include a behavior record database and a behavior display module.
  • the behavior record database can be used to record the time, parameter information, call chain or stack information of the function call behavior, and the behavior record database can also provide data query, analysis, or filtering mechanisms to perform data processing on the stored data.
  • the behavior display module can provide a visual display function to display the behavior information collected during the program control process, that is, the data stored in the behavior record database.
  • S230 may include:
  • S232a Modify the current parameter value of the input parameter to be controlled to the target parameter value according to the pre-configured dynamic script.
  • the input parameter to be controlled may be an input parameter that needs to be dynamically controlled in the program to be processed.
  • the current parameter value may be the parameter value currently used by the input parameter to be controlled, and the target parameter value may be the parameter value set for the control requirement of the program to be processed.
  • the computer equipment when the computer equipment is dynamically controlling the program to be processed, if it is necessary to deal with program failures or hardware failures (such as hardware damage, etc.), you can traverse the debugging information analysis results, find the input parameters to be controlled, and use The pre-configured dynamic script of the instrumentation function that captures the debugging information modifies the current parameter value of the input parameter to be controlled to the target parameter value.
  • FIG. 3 it is illustrated with reference to FIG. 3. Assuming that the C program is used as a program to be processed, one or more instrumentation functions are preset before the C program is run. If the target input parameter value of the target function in the C program is 100, a program failure will occur. When the target input parameter value 100 is detected, the parameter value of the target input parameter needs to be modified to 200.
  • a dynamic script can be configured in the behavior capture suite. The function of the dynamic script is: when the parameter value of the target input parameter of the target function is detected as 100, the parameter value of the target input parameter is modified to 200.
  • the behavior capture suite can traverse the debugging information analysis result, find the target input parameter, and modify the current parameter value of the target input parameter from 100 to 200, thereby Effectively avoid the problem of program failure.
  • the data output operation includes printing the current parameter value of the input parameter to be controlled, and/or storing the current parameter value of the input parameter to be controlled.
  • the computer device when the computer device is dynamically controlling the program to be processed, if it is necessary to analyze the function input parameters in the program, you can traverse the debugging information analysis result, find the input parameter to be controlled, and use the plug-in that captures the debugging information.
  • the dynamic command pre-configured by the stub function performs data output operations such as printing parameter values or storing parameter values for the input parameter to be controlled.
  • the C program is used as a program to be processed
  • one or more instrumentation functions are preset before the C program is run. If you need to print and analyze the target input parameters of the target function in the C program, you can configure a dynamic command in the behavior capture suite.
  • the function of the dynamic command is: print and store the current parameter value of the target input parameter of the target function .
  • the behavior capture suite can traverse the debugging information analysis result, find the target input parameter, and obtain the current parameter value of the target input parameter.
  • the current parameter value can be changed Stored in the behavior record database to analyze and display the current parameter values of the target input parameters through the behavior record database.
  • the associated behavior information includes the time of the function call.
  • the associated behavior information may be related information of the calling function in the debugging information, such as the time when the function is called.
  • the debugging information analysis result and the associated behavior information of the debugging information analysis result can be stored in the behavior record database to be based on the behavior
  • the data obtained by the database is visually displayed or analyzed.
  • the debugging information generated by the program to be processed during compilation is obtained through the instrumentation function preset in the program to be processed, so as to analyze the acquired debugging information to obtain the debugging information analysis result, and then treat it according to the debugging information analysis result
  • the processing program is controlled, such as monitoring the internal operating status of the processing program, changing the output printing information of the processing program, and changing the running behavior of the processing program.
  • the behavior of the function can be dynamically changed.
  • the fault can also be downgraded. It can avoid modifying the code, recompiling the program, publishing and replacing the software version, thereby improving the control efficiency of the program.
  • FIG. 4 is a schematic diagram of a program control apparatus provided by an embodiment of the application.
  • the apparatus may be implemented by software and/or hardware and integrated into a computer device.
  • the program control device includes: a debugging information acquisition module 310, a debugging information analysis module 320, and a program control module 330.
  • the debugging information acquisition module 310 is configured to acquire the debugging information generated by the program to be processed during compilation; the debugging information is acquired through the instrumentation function preset in the program to be processed; the debugging information analysis module 320 is configured to be the analysis location. The debugging information is described to obtain the debugging information analysis result; the program control module 330 is configured to control the to-be-processed program according to the debugging information analysis result.
  • the debugging information generated by the program to be processed during the compilation period is obtained through the instrumentation function preset in the program to be processed, so as to analyze the obtained debugging information to obtain the debugging information analysis result, and then to be processed according to the debugging information analysis result
  • the program is controlled to solve the problem of low efficiency when the program needs to be controlled through editing operations such as recompiling, publishing, and replacing, so that the software version is not recompiled, the software is not replaced, the device is not restarted, or the program is restarted. , Dynamically control the program, thereby improving the control efficiency of the program.
  • the debugging information acquisition module 310 is configured to: in the case of establishing a connection with the to-be-processed program, capture the function call behavior in the to-be-processed program through the instrumentation function to obtain the to-be-processed program Debug information generated at compile time.
  • the program control module 330 is configured to execute a dynamic instruction that has a mapping relationship with the instrumentation function according to the debugging information analysis result to control the program to be processed; wherein, the dynamic instruction includes dynamic Commands and/or dynamic scripts.
  • the program control module 330 is configured to: traverse the debugging information analysis result to find the input parameter to be controlled; and modify the current parameter value of the input parameter to be controlled to the target parameter value according to a pre-configured dynamic script.
  • the program control module 330 is configured to: traverse the debugging information analysis result to find the input parameter to be controlled; perform a data output operation on the input parameter to be controlled according to a pre-configured dynamic command; wherein, the data The output operation includes printing the current parameter value of the input parameter to be controlled, and/or storing the current parameter value of the input parameter to be controlled.
  • the program control module 330 is configured to store the debugging information analysis result and the associated behavior information of the debugging information analysis result in a behavior record database; wherein the associated behavior information includes the time of the function call.
  • the debugging information includes at least one of the current pointer variable, stack pointer, input parameter type, input parameter stack position, and input parameter structure acquired when the instrumented function captures the function call behavior.
  • the debugging information analysis result includes at least one of call stack associated information, input parameter type, and input parameter value called by the function call behavior in the to-be-processed program; wherein, the call stack associated information includes Call chain and/or stack information.
  • the above-mentioned program control device can execute the program control method provided by the embodiment of the present application, and has the functional modules and effects corresponding to the execution method.
  • the program control method provided in the embodiment of this application please refer to the program control method provided in the embodiment of this application.
  • FIG. 5 is a schematic structural diagram of a computer device provided in this application.
  • the computer device provided in this application includes: One or more processors 410 and a storage device 420; the processor 410 of the computer device may be one or more.
  • one processor 410 is taken as an example; the storage device 420 is configured to store one or more programs; The one or more programs are executed by the one or more processors 410, so that the one or more processors 410 implement the program control method as described in the embodiments of the present application.
  • the processor 410 and the storage device 420 in the computer equipment may be connected through a bus or in other ways.
  • the connection through a bus is taken as an example.
  • the storage device 420 can be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the program control method described in the embodiments of the present application (for example, in a program control device).
  • the storage device 420 may include a storage program area and a storage data area.
  • the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the device, and the like.
  • the storage device 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the storage device 420 may include memories remotely provided with respect to the processor 410, and these remote memories may be connected to a communication node through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the embodiment of the present application also provides a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the program control method in the embodiment of the present application is realized: obtaining the debugging generated by the program to be processed during compilation. Information; the debugging information is obtained through an instrumentation function preset in the program to be processed; the debugging information is parsed to obtain a debugging information analysis result; the program to be processed is controlled according to the debugging information analysis result.
  • this application can be implemented by software and necessary general-purpose hardware, or can be implemented by hardware.
  • the technical solution of this application can essentially be embodied in the form of a software product.
  • the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (Read-Only Memory, ROM), and random access Random Access Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including multiple instructions to make a communication device (which can be a personal computer, server, or network device, etc.) execute the embodiments described in this application Methods.
  • the multiple units and modules included are only divided according to the functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the multiple functional units
  • the names are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
  • the various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof.
  • some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, although the application is not limited thereto.
  • the embodiments of the present application may be implemented by executing computer program instructions by a data processor of a mobile device, for example, in a processor entity, or by hardware, or by a combination of software and hardware.
  • Computer program instructions can be assembly instructions, instruction set architecture (Instruction Set Architecture, ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or written in any combination of one or more programming languages Source code or object code.
  • the block diagram of any logic flow in the drawings of the present application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions.
  • the computer program can be stored on the memory.
  • the memory can be of any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to ROM, RAM, optical storage devices and systems (Digital Video Disc, DVD) or optical disc ( Compact Disk, CD)) etc.
  • Computer-readable media may include non-transitory storage media.
  • the data processor can be any type suitable for the local technical environment, such as but not limited to general-purpose computers, special-purpose computers, microprocessors, digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (ASICs) ), programmable logic devices (Field-Programmable Gate Array, FPGA), and processors based on multi-core processor architecture.
  • DSP Digital Signal Processing
  • ASICs application specific integrated circuits
  • FPGA Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种程序控制方法、装置、计算机设备及存储介质,方法包括:获取待处理程序在编译时期生成的调试信息,所述调试信息通过预置在所述待处理程序中的插桩函数获取(S110);解析所述调试信息,得到调试信息解析结果(S120);根据所述调试信息解析结果对所述待处理程序进行控制(S130)。

Description

程序控制方法、装置、计算机设备及存储介质 技术领域
本申请涉及计算机技术领域,例如涉及一种程序控制方法、装置、计算机设备及存储介质。
背景技术
嵌入式技术执行专用功能并被内部计算机控制的设备或者系统。随着嵌入式技术的发展,嵌入式系统在生产、生活、工业、农业等方面发挥不可替代的作用。例如对于工业、航空、通信等领域来说,嵌入式设备起着决定性的作用,其应用时需要不间断运行。
绝大多数嵌入式系统是用户针对特定任务而定制的,而嵌入式系统中的软件系统通常需要利用专用的编程语言,如C语言或汇编语言等实现。嵌入式系统在应用过程中,不可避免的存在故障、需求变更或硬件损坏等情况。因此,在嵌入式系统中程序运行过程中,往往需要对程序的运行过程进行监控,或者,在有需求时改变程序的行为。
如果需要改变程序的行为,最常用的方式是修改程序代码,程序代码修改完成后需要重新编译程序,并发布、替换软件版本,而且还需要重启设备或重启程序,对于大型项目来说需要消耗大量的时间成本,效率较低。
发明内容
本申请提供了一种程序控制方法、装置、计算机设备及存储介质,以对程序进行动态控制,从而提高程序的控制效率。
提供了一种程序控制方法,包括:
获取待处理程序在编译时期生成的调试信息;其中,所述调试信息通过预置在所述待处理程序中的插桩函数获取;解析所述调试信息,得到调试信息解析结果;根据所述调试信息解析结果对所述待处理程序进行控制。
还提供了一种程序控制装置,包括:
调试信息获取模块,设置为获取待处理程序在编译时期生成的调试信息;其中,所述调试信息通过预置在所述待处理程序中的插桩函数获取;调试信息解析模块,设置为解析所述调试信息,得到调试信息解析结果;程序控制模块,设置为根据所述调试信息解析结果对所述待处理程序进行控制。
还提供了一种计算机设备,所述计算机设备包括:
一个或多个处理器;存储装置,设置为存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述的程序控制方法。
还提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述的程序控制方法。
附图说明
图1为本申请实施例提供的一种程序控制方法的流程示意图;
图2为本申请实施例提供的另一种程序控制方法的流程示意图;
图3是本申请实施例提供的一种程序控制的示意图;
图4为本申请实施例提供的一种程序控制装置的示意图;
图5为本申请提供的一种计算机设备的结构示意图。
具体实施方式
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本申请的说明,其本身没有特有的意义。因此,“模块”、“部件”或“单元”可以混合地使用。
下文中将结合附图对本申请的实施例进行说明。
在一个示例性实施方式中,图1为本申请实施例提供的一种程序控制方法的流程示意图。该方法适用于动态地控制程序的情况。该方法可以由本申请提供的程序控制装置执行,该程序控制装置可以由软件和/或硬件实现,并集成在计算机设备中。
如图1所示,本申请实施例提供的程序控制方法,包括:
S110、获取待处理程序在编译时期生成的调试信息;所述调试信息通过预置在所述待处理程序中的插桩函数获取。
待处理程序可以是需要被动态控制的程序,示例性的,C语言程序或C++语音程序等,本申请实施例并不对待处理程序所应用的编程语言的类型进行限定。调试信息可以是待处理程序在编译时所生成的相关信息,具有一定的数据格式,其数据格式的类型取决于采用的编程语言的类型。例如,如果待处理程序的编程语言采用C语言,则调试信息诸如可以是函数调用时的指针信息或入 参信息等,本申请实施例并不对调试信息的类型进行限定。
在本申请实施例中,可以由与待处理程序相连的计算机设备对待处理程序进行动态控制。在待处理程序运行之前,可以预先在待处理程序中预置插桩函数。插桩函数的数量可以是一个或多个,可以根据实际需求设定,本申请实施例并不对插桩函数的数量进行限定。相应的,在待处理程序编译运行时,可以由内置在待处理程序中的插桩函数获取待处理程序所生成的调试信息,并将获取的调试信息发送至与待处理程序相连的计算机设备。
S120、解析所述调试信息,得到调试信息解析结果。
调试信息解析结果可以是对调试信息进行解析所得到的解析结果。
在计算机设备获取到待处理程序生成的调试信息后,即可对调试信息进行解析,得到匹配的调试信息解析结果。调试信息解析结果可以反应待处理程序在编译运行时所涉及的参数信息。例如,如果待处理程序的编程语言采用C语言,则调试信息解析结果诸如可以是函数调用的栈信息或入参数值等。也即,调试信息可以是待处理程序的行为数据,而调试信息解析结果则可以是对行为数据的语义分析。
由于调试信息具有一定的数据格式,待处理程序所采用的编程语言的类型不同时,调试信息对应的数据格式可能不同。因此,需要根据调试信息的数据格式对调试信息进行解析,以避免解析失败。
示例性的,假设调试信息的数据格式为:字节1:Ab,字节2:Ac,字节3:D,则对该调试信息的调试信息解析结果可以是:字节1的数据加字节3的数据得到参数E,也即,E=AbD。
S130、根据所述调试信息解析结果对所述待处理程序进行控制。
在计算机设备获取到调试信息对应的调试信息解析结果后,即可根据调试信息解析结果对待处理程序进行控制。所谓控制诸如可以是监控待处理程序内部的运行状态、改变待处理程序输出的信息或改变待处理程序的运行行为等,本申请实施例并不对待处理程序的控制行为类型进行限定。根据调试信息解析结果对待处理程序进行控制,可以是动态控制运行状态中的待处理程序。
在上述方案中,通过预置在待处理程序中的插桩函数获取待处理程序在编译时期生成的调试信息,并根据调试信息的调试信息解析结果对运行状态中的待处理程序进行动态地控制。也即,本申请实施例所提供的程序控制方法无需中断待处理程序的运行状态,因此也无需重新编译待处理程序的软件版本并重新替换新的待处理程序,更无需重启设备或待处理程序,在待处理程序运行过程中即可对其进行动态的控制,以解决待处理程序的故障问题,或更改待处理 程序的行为需求等。由此可见,在程序运行过程中对程序进行动态控制,可以大幅缩减程序修改、重新编译、替换旧版本以及重新操作所消耗的时间,从而提高程序的控制效率。
本申请实施例通过预置在待处理程序中的插桩函数获取待处理程序在编译时期生成的调试信息,以对获取的调试信息进行解析得到调试信息解析结果,进而根据调试信息解析结果对待处理程序进行控制,解决需要通过重新编译、发布及替换等编辑操作对程序进行控制时存在的效率低的问题,实现在不重新编译软件版本、不重新替换软件、不重启设备或者重启程序的前提下,动态地控制程序,从而提高程序的控制效率。
在一个示例性实施方式中,图2为本申请实施例提供的另一种程序控制方法的流程示意图。本实施例以上述实施例为基础进行说明,在本实施例中,给出了根据所述调试信息解析结果对所述待处理程序进行控制的多种可选的实现方式。如图2所示,本实施例的方法可以包括:
S210、在与所述待处理程序建立连接的情况下,通过所述插桩函数捕获所述待处理程序中的函数调用行为,以获取所述待处理程序在编译时期生成的调试信息。
对待处理程序进行动态控制的计算机设备需要与待处理程序建立连接,才可以对待处理程序进行控制。相应的,如果计算机设备没有与待处理程序建立连接,此时插桩函数可以不做任何动作,也即不进行函数调用行为的捕获操作。在计算机设备与待处理程序建立连接后,插桩函数才开始执行捕获操作,并对待处理程序中的函数调用行为进行捕获,以获取待处理程序在编译时期生成的调试信息。
在本申请的一个可选实施例中,所述调试信息可以包括所述插桩函数捕获函数调用行为时获取的当前指针变量、堆栈指针、入参类型、入参堆栈位置以及入参结构体中的至少一项。
可选的,调试信息可以包括但不限于插桩函数捕获函数调用行为时获取的当前指针变量堆栈指针、入参类型、入参堆栈位置以及入参结构体。其中,当前指针变量可以用于确定插桩函数捕获的函数类型,并可以用于确定待处理程序的调用函数的调用链。堆栈指针可以用于确定待处理程序的堆栈信息。入参类型、入参堆栈位置以及入参结构体可以用于确定入参信息,如入参类型或入参数值等。
S220、解析所述调试信息,得到调试信息解析结果。
在本申请的一个可选实施例中,所述调试信息解析结果可以包括所述待处理程序中函数调用行为所调用的调用栈关联信息、入参类型以及入参数值中的至少一项;其中,所述调用栈关联信息可以包括调用链和/或堆栈信息。
可选的,调试信息解析结果可以包括但不限于待处理程序中函数调用行为所调用的调用栈关联信息、入参类型以及入参数值。其中,调用栈关联信息可以包括调用链和/或堆栈信息,可以通过对当前指针变量及堆栈指针进行解析获取,入参类型可以根据调试信息中的入参类型进行解析获取,入参数值则可以根据入参堆栈位置以及入参结构体进行解析获取。
S230、根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,以对所述待处理程序进行控制。
所述动态指令包括动态命令和/或动态脚本。
动态指令可以用于对待处理程序进行动态控制,如修改调用函数的行为。动态指令可以包括但不限于动态命令和/或动态脚本。动态命令可以是程序中常用的命令,如延时、打印参数、参数保存、返回等命令。动态脚本可以是指用高级语言编写的解释性质的脚本,动态脚本可以动态的修改,不需要编译、打包及发布等操作。
可选的,计算机设备可以根据获取的调试信息解析结果执行与插桩函数存在映射关系的动态命令和/或动态脚本等动态指令,对待处理程序进行动态控制。插桩函数可以对应设置一个或多个动态命令和/或动态脚本,也即,插桩函数可以与一个或多个动态命令和/或动态脚本建立映射关系,本申请实施例并不对插桩函数所对应设置的动态命令和/或动态脚本的数量进行限定。
图3是本申请实施例提供的一种程序控制的示意图。在一个可选的示例中,如图3所示,以嵌入式C语言程序作为待处理程序,并利用行为捕获套件对运行时C程序进行动态控制。其中,行为捕获套件可以运行在与待处理程序相连的计算机设备中。可选的,可以在C程序代码中预置多个插桩函数(图3中预置了3个插桩函数)。当运行时C程序未与行为捕获套件建立连接时,插桩函数不做任何动作。当行为捕获套件通过网线或串口等形式连接到运行时C程序后,插桩函数可以开始捕获C程序中的函数调用行为,以获取运行时c程序在编译时期生成的当前网际互连协议(Internet Protocol,IP)指针、堆栈指针、入参类型、入参堆栈位置以及入参结构体等调试信息,并将获取的调试信息发送至行为捕获套件。
行为捕获套件内部包括远端动态解析程序,可以接收插桩函数发送的调试信息。远端动态解析程序可以解析调试信息,对运行时C程序的栈结构进行分 析,从而获取当前调用函数调用的调用链、堆栈信息、调用函数的入参类型及入参数值等调试信息解析结果,也即获取对栈结果的分析结果。相应的,远端动态解析程序可以根据栈结果的分析结果,执行插桩函数对应设置的动态命令和/或动态脚本,以对运行时C程序执行监控程序内部的运行状态、改变程序的输出打印信息或改变程序的运行行为等动态控制操作。
如图3所示,行为捕获套件内部还可以包括行为记录数据库和行为展示模块。其中,行为记录数据库可以用于记录函数调用行为的时间、参数信息、调用链或堆栈信息等,行为记录数据库还可以提供数据的查询、分析或过滤等机制,对存储的数据进行数据处理。行为展示模块可以提供可视化展示功能,以展示程序控制过程中所采集到的行为信息,也即行为记录数据库存储的数据。
S230可以包括:
S231a、遍历所述调试信息解析结果,查找待控制入参参数。
S232a、根据预先配置的动态脚本将所述待控制入参参数的当前参数值修改为目标参数值。
待控制入参参数可以是待处理程序中需要被动态控制的入参参数。当前参数值可以是待控制入参参数当前所使用的参数值,目标参数值可以是针对待处理程序控制需求所设定的参数值。
可选的,在计算机设备对待处理程序进行动态控制时,如果需要对程序故障或硬件故障(如硬件损坏等)等情况进行处理,可以遍历调试信息解析结果,查找待控制入参参数,并利用捕获该调试信息的插桩函数预先配置的动态脚本,将待控制入参参数的当前参数值修改为目标参数值。
在一个可选的示例中,结合图3举例说明。假设将C程序作为待处理程序,则在C程序运行之前,预置一个或多个插桩函数。如果C程序中目标函数的目标入参取值为100时会引发程序故障,需要在检测到目标入参取值100时,将目标入参的参数值修改为200。为此,可以在行为捕获套件中配置动态脚本,该动态脚本的功能是:检测到目标函数的目标入参的参数值为100时,将目标入参的参数值修改为200。相应的,如果运行时C程序的目标函数调用时被插桩函数捕获,则行为捕获套件可以遍历调试信息解析结果,查找目标入参,并将目标入参的当前参数值100修改为200,从而有效规避程序故障问题。
S231b、遍历所述调试信息解析结果,查找待控制入参参数。
S232b、根据预先配置的动态命令对所述待控制入参参数执行数据输出操作。
所述数据输出操作包括打印所述待控制入参参数的当前参数值,和/或,存储所述待控制入参参数的当前参数值。
可选的,在计算机设备对待处理程序进行动态控制时,如果需要对程序中的函数入参进行分析,则可以遍历调试信息解析结果,查找待控制入参参数,并利用捕获该调试信息的插桩函数预先配置的动态命令,对待控制入参参数执行打印参数值或存储参数值等数据输出操作。
在一个可选的示例中,结合图3举例说明。假设将C程序作为待处理程序,则在C程序运行之前,预置一个或多个插桩函数。如果有对C程序中目标函数的目标入参进行打印和分析的需求,则可以在行为捕获套件中配置动态命令,该动态命令的功能是:打印及存储目标函数的目标入参的当前参数值。相应的,如果运行时C程序的目标函数调用时被插桩函数捕获,则行为捕获套件可以遍历调试信息解析结果,查找目标入参,并获取目标入参的当前参数值,可以将当前参数值存储至行为记录数据库中,以通过行为记录数据库对目标入参的当前参数值进行分析和展示。
S231c、将所述调试信息解析结果以及所述调试信息解析结果的关联行为信息存储至行为记录数据库。
所述关联行为信息包括函数调用的时间。
关联行为信息可以是调试信息中调用函数的相关信息,如函数调用的时间等。
可选的,在计算机设备对待处理程序进行动态控制时,如果需要对程序的运行过程进行监控,则可以将调试信息解析结果以及调试信息解析结果的关联行为信息存储至行为记录数据库,以根据行为数据库获取的数据进行可视化展示或分析。
采用上述技术方案,通过预置在待处理程序中的插桩函数获取待处理程序在编译时期生成的调试信息,以对获取的调试信息进行解析得到调试信息解析结果,进而根据调试信息解析结果对待处理程序进行控制,如监控待处理程序内部的运行状态、改变待处理程序的输出打印信息,改变待处理程序的运行行为等。在待处理程序存在故障或需求变更的时候,可以动态改变函数的行为。在硬件损坏的时候,也可以对故障进行降级处理等。能够避免修改代码、重新编译程序、发布及替换软件版本,从而提高程序的控制效率。
在一个示例性实施方式中,图4为本申请实施例提供的一种程序控制装置的示意图,该装置可以由软件和/或硬件实现,并集成在计算机设备中。
如图4所示程序控制装置包括:调试信息获取模块310、调试信息解析模块320以及程序控制模块330。
调试信息获取模块310,设置为获取待处理程序在编译时期生成的调试信息;所述调试信息通过预置在所述待处理程序中的插桩函数获取;调试信息解析模块320,设置为解析所述调试信息,得到调试信息解析结果;程序控制模块330,设置为根据所述调试信息解析结果对所述待处理程序进行控制。
本申请实施例通过预置在待处理程序中的插桩函数获取待处理程序在编译时期生成的调试信息,以对获取的调试信息进行解析得到调试信息解析结果,进而根据调试信息解析结果对待处理程序进行控制,解决需要通过重新编译、发布及替换等编辑操作对程序进行控制时存在的效率低的问题,实现在不重新编译软件版本、不重新替换软件、不重启设备或者重启程序的前提下,动态地控制程序,从而提高程序的控制效率。
可选的,调试信息获取模块310设置为:在与所述待处理程序建立连接的情况下,通过所述插桩函数捕获所述待处理程序中的函数调用行为,以获取所述待处理程序在编译时期生成的调试信息。
可选的,程序控制模块330设置为:根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,以对所述待处理程序进行控制;其中,所述动态指令包括动态命令和/或动态脚本。
可选的,程序控制模块330设置为:遍历所述调试信息解析结果,查找待控制入参参数;根据预先配置的动态脚本将所述待控制入参参数的当前参数值修改为目标参数值。
可选的,程序控制模块330设置为:遍历所述调试信息解析结果,查找待控制入参参数;根据预先配置的动态命令对所述待控制入参参数执行数据输出操作;其中,所述数据输出操作包括打印所述待控制入参参数的当前参数值,和/或,存储所述待控制入参参数的当前参数值。
可选的,程序控制模块330设置为:将所述调试信息解析结果以及所述调试信息解析结果的关联行为信息存储至行为记录数据库;其中,所述关联行为信息包括函数调用的时间。
可选的,所述调试信息包括所述插桩函数捕获函数调用行为时获取的当前指针变量、堆栈指针、入参类型、入参堆栈位置以及入参结构体中的至少一项。
可选的,所述调试信息解析结果包括所述待处理程序中函数调用行为所调用的调用栈关联信息、入参类型以及入参数值中的至少一项;其中,所述调用栈关联信息包括调用链和/或堆栈信息。
上述程序控制装置可执行本申请实施例所提供的程序控制方法,具备执行方法相应的功能模块和效果。未在本实施例中详尽描述的技术细节,可参见本 申请实施例所提供的程序控制方法。
在一个示例性实施方式中,本申请实施例还提供了一种计算机设备,图5为本申请提供的一种计算机设备的结构示意图,如图5所示,本申请提供的计算机设备,包括:一个或多个处理器410和存储装置420;该计算机设备的处理器410可以是一个或多个,图5中以一个处理器410为例;存储装置420设置为存储一个或多个程序;所述一个或多个程序被所述一个或多个处理器410执行,使得所述一个或多个处理器410实现如本申请实施例中所述的程序控制方法。
计算机设备中的处理器410、存储装置420可以通过总线或其他方式连接,图5中以通过总线连接为例。
存储装置420作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例所述的程序控制方法对应的程序指令/模块(例如,程序控制装置中的调试信息获取模块310、调试信息解析模块320以及程序控制模块330)。存储装置420可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据设备的使用所创建的数据等。此外,存储装置420可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储装置420可包括相对于处理器410远程设置的存储器,这些远程存储器可以通过网络连接至通信节点。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
本申请实施例还提供一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现本申请实施例中的程序控制方法:获取待处理程序在编译时期生成的调试信息;所述调试信息通过预置在所述待处理程序中的插桩函数获取;解析所述调试信息,得到调试信息解析结果;根据所述调试信息解析结果对所述待处理程序进行控制。
通过以上关于实施方式的描述,本申请可借助软件及必需的通用硬件来实现,也可以通过硬件实现。本申请的技术方案本质上可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括多个指令用以使得一 台通信设备(可以是个人计算机,服务器,或者网络设备等)执行本申请实施例所述的方法。
上述程序控制装置的实施例中,所包括的多个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,多个功能单元的名称也只是为了便于相互区分,并不用于限制本申请的保护范围。
一般来说,本申请的多种实施例可以在硬件或专用电路、软件、逻辑或其任何组合中实现。例如,一些方面可以被实现在硬件中,而其它方面可以被实现在可以被控制器、微处理器或其它计算装置执行的固件或软件中,尽管本申请不限于此。
本申请的实施例可以通过移动装置的数据处理器执行计算机程序指令来实现,例如在处理器实体中,或者通过硬件,或者通过软件和硬件的组合。计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码。
本申请附图中的任何逻辑流程的框图可以表示程序步骤,或者可以表示相互连接的逻辑电路、模块和功能,或者可以表示程序步骤与逻辑电路、模块和功能的组合。计算机程序可以存储在存储器上。存储器可以具有任何适合于本地技术环境的类型并且可以使用任何适合的数据存储技术实现,例如但不限于ROM、RAM、光存储器装置和系统(数码多功能光碟(Digital Video Disc,DVD)或光盘(Compact Disk,CD))等。计算机可读介质可以包括非瞬时性存储介质。数据处理器可以是任何适合于本地技术环境的类型,例如但不限于通用计算机、专用计算机、微处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑器件(Field-Programmable Gate Array,FPGA)以及基于多核处理器架构的处理器。

Claims (11)

  1. 一种程序控制方法,包括:
    获取待处理程序在编译时期生成的调试信息;其中,所述调试信息通过预置在所述待处理程序中的插桩函数获取;
    解析所述调试信息,得到调试信息解析结果;
    根据所述调试信息解析结果对所述待处理程序进行控制。
  2. 根据权利要求1所述的方法,其中,所述获取待处理程序在编译时期生成的调试信息,包括:
    在与所述待处理程序建立连接的情况下,通过所述插桩函数捕获所述待处理程序中的函数调用行为,以获取所述待处理程序在编译时期生成的所述调试信息。
  3. 根据权利要求1所述的方法,其中,所述根据所述调试信息解析结果对所述待处理程序进行控制,包括:
    根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,以对所述待处理程序进行控制;
    其中,所述动态指令包括动态命令和动态脚本中的至少之一。
  4. 根据权利要求3所述的方法,其中,所述根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,包括:
    遍历所述调试信息解析结果,查找待控制入参参数;
    根据预先配置的动态脚本将所述待控制入参参数的当前参数值修改为目标参数值。
  5. 根据权利要求3所述的方法,其中,所述根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,包括:
    遍历所述调试信息解析结果,查找待控制入参参数;
    根据预先配置的动态命令对所述待控制入参参数执行数据输出操作;
    其中,所述数据输出操作包括打印所述待控制入参参数的当前参数值,和存储所述待控制入参参数的当前参数值中的至少之一。
  6. 根据权利要求3所述的方法,其中,所述根据所述调试信息解析结果执行与所述插桩函数存在映射关系的动态指令,包括:
    将所述调试信息解析结果以及所述调试信息解析结果的关联行为信息存储至行为记录数据库;
    其中,所述关联行为信息包括函数调用的时间。
  7. 根据权利要求1-6中任一项所述的方法,其中,所述调试信息包括所述插桩函数捕获函数调用行为时获取的当前指针变量、堆栈指针、入参类型、入参堆栈位置以及入参结构体中的至少一项。
  8. 根据权利要求1-6中任一项所述的方法,其中,所述调试信息解析结果包括所述待处理程序中函数调用行为所调用的调用栈关联信息、入参类型以及入参数值中的至少一项;
    其中,所述调用栈关联信息包括调用链和堆栈信息中的至少之一。
  9. 一种程序控制装置,包括:
    调试信息获取模块,设置为获取待处理程序在编译时期生成的调试信息;其中,所述调试信息通过预置在所述待处理程序中的插桩函数获取;
    调试信息解析模块,设置为解析所述调试信息,得到调试信息解析结果;
    程序控制模块,设置为根据所述调试信息解析结果对所述待处理程序进行控制。
  10. 一种计算机设备,包括:
    至少一个处理器;
    存储装置,设置为存储至少一个程序;
    当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1-8中任一项所述的程序控制方法。
  11. 一种存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-8中任一项所述的程序控制方法。
PCT/CN2021/079097 2020-06-04 2021-03-04 程序控制方法、装置、计算机设备及存储介质 WO2021244088A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010501224.6 2020-06-04
CN202010501224.6A CN113760290A (zh) 2020-06-04 2020-06-04 一种程序控制方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021244088A1 true WO2021244088A1 (zh) 2021-12-09

Family

ID=78783811

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/079097 WO2021244088A1 (zh) 2020-06-04 2021-03-04 程序控制方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN113760290A (zh)
WO (1) WO2021244088A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225925A (zh) * 2023-02-21 2023-06-06 东南大学 一种计算机软件在线实时可视化调试方法
CN116483736A (zh) * 2023-06-21 2023-07-25 荣耀终端有限公司 插桩位置确定方法及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040117771A1 (en) * 2002-12-12 2004-06-17 Microsoft Corporation Preprocessor-based source code instrumentation
US20070006159A1 (en) * 2005-02-18 2007-01-04 Green Hills Software, Inc. Post-compile instrumentation of object code for generating execution trace data
CN102053906A (zh) * 2009-10-30 2011-05-11 国际商业机器公司 用于收集程序运行时信息的系统和方法
CN104252402A (zh) * 2014-09-05 2014-12-31 深圳创维数字技术有限公司 一种程序调试方法及装置
CN107066390A (zh) * 2017-04-24 2017-08-18 许继集团有限公司 一种动态内存泄漏检测方法及系统
US20180032423A1 (en) * 2016-07-27 2018-02-01 Undo Ltd. Debugging systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040117771A1 (en) * 2002-12-12 2004-06-17 Microsoft Corporation Preprocessor-based source code instrumentation
US20070006159A1 (en) * 2005-02-18 2007-01-04 Green Hills Software, Inc. Post-compile instrumentation of object code for generating execution trace data
CN102053906A (zh) * 2009-10-30 2011-05-11 国际商业机器公司 用于收集程序运行时信息的系统和方法
CN104252402A (zh) * 2014-09-05 2014-12-31 深圳创维数字技术有限公司 一种程序调试方法及装置
US20180032423A1 (en) * 2016-07-27 2018-02-01 Undo Ltd. Debugging systems
CN107066390A (zh) * 2017-04-24 2017-08-18 许继集团有限公司 一种动态内存泄漏检测方法及系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225925A (zh) * 2023-02-21 2023-06-06 东南大学 一种计算机软件在线实时可视化调试方法
CN116225925B (zh) * 2023-02-21 2023-11-21 东南大学 一种计算机软件在线实时可视化调试方法
CN116483736A (zh) * 2023-06-21 2023-07-25 荣耀终端有限公司 插桩位置确定方法及电子设备
CN116483736B (zh) * 2023-06-21 2024-03-12 荣耀终端有限公司 插桩位置确定方法及电子设备

Also Published As

Publication number Publication date
CN113760290A (zh) 2021-12-07

Similar Documents

Publication Publication Date Title
WO2020134634A1 (zh) 程序调试方法、程序调试装置、终端设备及存储介质
JP2749528B2 (ja) エラー解析用のトレーサシステム
WO2021244088A1 (zh) 程序控制方法、装置、计算机设备及存储介质
EP2724235B1 (en) N-way runtime interoperative debugging
WO2018072493A1 (zh) 编译方法和编译系统
WO2016177124A1 (zh) 一种实现持续集成测试的方法及装置
US8910126B2 (en) Compiling source code for debugging with variable value restoration based on debugging user activity
US20110191752A1 (en) Method and System for Debugging of Software on Target Devices
US7900198B2 (en) Method and system for parameter profile compiling
CN108319555B (zh) 一种基于嵌入式实时系统的实时调试方法
US20100281463A1 (en) XML based scripting framework, and methods of providing automated interactions with remote systems
US9176848B2 (en) Program debugger and program debugging
US20190196936A1 (en) Conditional wrapper for program object
CN111382048B (zh) 真机测试平台上移动设备的管理方法和装置
US8607199B2 (en) Techniques for debugging code during runtime
CN100395725C (zh) 日志信息输出系统及输出方法
US20120036501A1 (en) Method and System for Capturing System and User Events Using Hardware Trace Devices
CN112000350B (zh) 一种动态规则更新方法、装置及存储介质
WO2016095570A1 (zh) 一种嵌入式系统的调试方法及装置、存储介质
TWI684916B (zh) 函式選取方法和伺服器
CN104216766A (zh) 对流数据进行处理的方法及装置
CN105446886A (zh) 一种计算机程序调试方法和装置
CN104008046A (zh) 程序的测试方法以及用于测试程序的设备
US9141511B2 (en) Method and system for verifying sleep wakeup protocol by computing state transition paths
CN115145381A (zh) 一种远程重置bmc芯片的方法、系统、存储介质及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21818058

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26.04.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21818058

Country of ref document: EP

Kind code of ref document: A1