CN111400172B - Program debugging method and device - Google Patents

Program debugging method and device Download PDF

Info

Publication number
CN111400172B
CN111400172B CN202010139856.2A CN202010139856A CN111400172B CN 111400172 B CN111400172 B CN 111400172B CN 202010139856 A CN202010139856 A CN 202010139856A CN 111400172 B CN111400172 B CN 111400172B
Authority
CN
China
Prior art keywords
function
program
virtual address
debugging
name
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010139856.2A
Other languages
Chinese (zh)
Other versions
CN111400172A (en
Inventor
张猛
冯大航
常乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI Technology Co Ltd
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 Beijing SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202010139856.2A priority Critical patent/CN111400172B/en
Publication of CN111400172A publication Critical patent/CN111400172A/en
Application granted granted Critical
Publication of CN111400172B publication Critical patent/CN111400172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure discloses a program debugging method, apparatus, electronic device, and computer-readable storage medium. Responding to a debugging instruction sent by a first program, and analyzing the debugging instruction to obtain the function name and parameters of a function to be debugged in a second program; acquiring the function according to the function name; the parameters are transmitted into the function, and the function is executed; and sending the execution result of the function to the first program, and displaying the execution result through the first program. The debugging instruction is analyzed to obtain the function name and the parameter of the function to be debugged in the second program, the parameter is transmitted into the function, the function is executed, the execution result of the function is sent to the first program, the execution result is displayed through the first program, online debugging can be supported, and normal operation of the second program is not affected.

Description

Program debugging method and device
Technical Field
The present disclosure relates to the field of personal computer technology, and in particular, to a program debugging method, apparatus, and computer readable storage medium.
Background
With the development of the internet and intelligent terminals, various application programs have also emerged. However, these applications all require debugging. The application program can be tested whether to have faults or not through debugging, and only the application program which is debugged can be normally used.
In the prior art, debugging is usually performed by using a debugging tool GDB, wherein the GDB is a debugging tool under UNIX and UNIX-like and is a relatively mature debugging tool. The compiled executable program can be debugged only by using GDB loading, the characteristics of breakpoint, conditional breakpoint, memory content printing, single step execution, function return in advance and the like are supported, and the debugging of the multi-thread and multi-process program is also supported.
However, GDB is more useful for offline debugging, requiring recompilation of the program during offline debugging, and requiring the addition of the GDB-g debugging option, so that the compiled program can be debugged with GDB. The published online program is generally free of-g options and belongs to the release version. The offline debugging is troublesome and cannot completely restore the on-line operation condition.
When using GDB for online debugging, it is necessary to use an attach command to connect to the running program, but when using an attach command to connect to the running program, it is necessary to stop execution and put the program under debug control, which results in the running program being suspended, which is not acceptable for some online programs.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The technical problem to be solved by the present disclosure is to provide a program debugging method, so as to at least partially solve the technical problem that the offline debugging cannot be performed or the offline debugging can cause the running program to be suspended in the prior art. Further, a program debugging device, a program debugging hardware device, a computer-readable storage medium, and a program debugging terminal are provided.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a program debugging method, comprising:
responding to a debugging instruction sent by a first program, and analyzing the debugging instruction to obtain the function name and the parameter of a function to be debugged in a second program;
acquiring the function according to the function name;
the parameters are transmitted into the function, and the function is executed;
and sending the execution result of the function to the first program, and displaying the execution result through the first program.
Further, the obtaining the function according to the function name includes:
obtaining a virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address respectively;
and acquiring the function according to the virtual address.
Further, the obtaining the virtual address corresponding to the function according to the function name includes:
searching a corresponding relation list according to the function name, and searching a virtual address corresponding to the function name from the corresponding relation list; and the corresponding relation list stores the corresponding relation between the function name and the virtual address of each function in the second program.
Further, the step of transferring the parameter into the function and executing the function includes:
determining a general proxy function corresponding to the function according to the virtual address of the function; the number of parameters of the general agent function is larger than that of all other functions;
and executing the universal proxy function.
Further, the method further comprises:
acquiring function information of all functions of the second program from a preset file; the function information of all functions is stored in the preset file, and the function information comprises function names and virtual addresses;
combining the function name and the virtual address of each function into a structure;
and constructing the corresponding relation list according to the structural bodies of all the functions.
Further, the execution subject of the method is a proxy thread.
Further, the proxy thread communicates with the first program in any one of the following communication modes: socket communication, remote communication, named pipe, message queue.
In order to achieve the above object, according to one aspect of the present disclosure, there is further provided the following technical solutions:
a program debugging device, comprising:
the function name and parameter acquisition module is used for responding to the debugging instruction sent by the first program and analyzing the debugging instruction so as to acquire the function name and parameter of the function to be debugged in the second program;
the function acquisition module is used for acquiring the function according to the function name;
a function execution module, configured to transfer the parameter into the function, and execute the function;
and the execution result sending module is used for sending the execution result of the function to the first program and displaying the execution result through the first program.
Further, the function obtaining module includes:
the virtual address acquisition unit is used for acquiring a virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address respectively;
and the function acquisition unit is used for acquiring the function according to the virtual address.
Further, the virtual address obtaining unit is specifically configured to: searching a corresponding relation list according to the function name, and searching a virtual address corresponding to the function name from the corresponding relation list; and the corresponding relation list stores the corresponding relation between the function name and the virtual address of each function in the second program.
Further, the function execution module is specifically configured to: determining a general proxy function corresponding to the function according to the virtual address of the function; the number of parameters of the general agent function is larger than that of all other functions; and executing the universal proxy function.
Further, the function obtaining module further includes:
the corresponding relation list construction unit is used for acquiring function information of all functions of the second program from a preset file; the function information of all functions is stored in the preset file, and the function information comprises function names and virtual addresses; combining the function name and the virtual address of each function into a structure; and constructing the corresponding relation list according to the structural bodies of all the functions.
Further, the debugging device is a proxy thread.
Further, the proxy thread communicates with the first program in any one of the following communication modes: socket communication, remote communication, named pipe, message queue.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
an electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor, when executed, implements the program debugging method of any preceding claim.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the program debugging method of any preceding claim.
In order to achieve the above object, according to still another aspect of the present disclosure, there is further provided the following technical solutions:
a program debugging terminal comprises any program debugging device.
According to the method and the device for debugging the function, the debugging instruction is analyzed in response to the debugging instruction sent by the first program, so that the function name and the parameter of the function to be debugged in the second program are obtained, the function is obtained according to the function name, the parameter is transmitted into the function, the function is executed, the execution result of the function is sent to the first program, the execution result is displayed through the first program, online debugging can be supported, and normal operation of the second program is not affected.
The foregoing description is only an overview of the disclosed technology, and may be implemented in accordance with the disclosure of the present disclosure, so that the above-mentioned and other objects, features and advantages of the present disclosure can be more clearly understood, and the following detailed description of the preferred embodiments is given with reference to the accompanying drawings.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow diagram of a program debug method according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a program debugging device according to one embodiment of the present disclosure;
fig. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
Example 1
In order to solve the technical problem that the running program is suspended due to the fact that offline debugging cannot be performed or offline debugging cannot be performed in the prior art, the embodiment of the disclosure provides a program debugging method. As shown in fig. 1, the program debugging method mainly includes the following steps S11 to S14.
Step S11: and responding to the debugging instruction sent by the first program, and analyzing the debugging instruction to obtain the function name and the parameter of the function to be debugged in the second program.
The second program is a program to be debugged, and the first program is a program additionally set up for realizing debugging. The first program may be a simple client program, and may be communicatively connected to the first program, and receive a debug instruction input by a user, and send the debug instruction. The debug instruction may include a function name and a parameter, and may also include a storage address corresponding to the function name and the parameter, so as to obtain the function name and the parameter according to the storage address.
The execution body of the present embodiment may be a proxy thread. I.e. a thread is additionally started in the second program, and when the proxy thread and the first program are on different devices, the proxy thread and the first program can perform socket communication or remote communication. For example, a snoop may be made on a socket binding a predefined IP and port in this thread, waiting for the connection of the first program. The first program may be a client, and the user connects the proxy program by running the client, and sends the debug instruction to the proxy thread in the second program through the socket. When the proxy thread is on the same device as the first program, the proxy thread and the first program may communicate in a named pipe or message queue.
The first program can run on the embedded equipment and the host machine, and is only used as a connecting medium for a user to input a debugging instruction and send an execution result, and the function is single and stable, so that each platform only needs to be compiled once.
The debugging mode can also support remote debugging, as long as the first program and the proxy thread network can be ensured to be communicated, so that one set of codes can simultaneously support a plurality of debugging modes under the condition of network existence and no network existence.
And the proxy thread is used for debugging instruction analysis and executing function operation, so that the system resources are not consumed too much, and the performance influence on the second program is not caused under the normal running condition.
Step S12: and acquiring the function according to the function name.
Specifically, the correspondence between all functions in the second program and the function names may be stored in advance, for example, in a local area or on the internet, and when necessary, the corresponding functions may be obtained according to the function names.
Step S13: and transmitting the parameters into the function, and executing the function.
Step S14: and sending the execution result of the function to the first program, and displaying the execution result through the first program.
The execution result can represent whether the function can normally run or not and whether the running result is accurate or not, and the first program is displayed to a user after receiving the execution result. Thus, after one debug instruction is executed, the next debug instruction can be executed, or the first program can be selected to exit to finish debugging.
According to the method, the device and the system, the debugging instructions are responded to the debugging instructions sent by the first program, so that function names and parameters of functions to be debugged in the second program are obtained, the functions are obtained according to the function names, the parameters are transmitted into the functions, the functions are executed, the execution results of the functions are sent to the first program, the execution results are displayed through the first program, online debugging can be supported, and normal operation of the second program is not affected.
In addition, the debugging method can execute all functions in the second program on line for unlimited times, and timely returns execution results, particularly for embedded equipment, the state of some registers can be considered to be changed on line, so that the program can be debugged more quickly and performance analysis can be performed.
In an alternative embodiment, step S12 specifically includes:
step S121: obtaining a virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address.
Wherein the virtual address is the location of the function.
Step S122: and acquiring the function according to the virtual address.
In an alternative embodiment, step S121 specifically includes:
searching a corresponding relation list according to the function name, and searching a virtual address corresponding to the function name from the corresponding relation list; and the corresponding relation list stores the corresponding relation between the function name and the virtual address of each function in the second program.
Specifically, a correspondence list may be pre-established, which supports a binary search algorithm. For example, the correspondence list may specifically be a balanced binary search tree or other data set that supports binary search.
In an alternative embodiment, the method further includes a process of constructing a correspondence list:
step S123: acquiring function information of all functions of the second program from a preset file; the preset file stores function information of all functions, wherein the function information comprises function names and virtual addresses.
The preset file may be an executable file, for example, an executable and linkable format (Executable and Linkable Format, ELF), and function information of all functions of the second program is stored in the preset file.
Step S124: the function name and virtual address of each function are combined into a structure.
Step S125: and constructing the corresponding relation list according to the structural bodies of all the functions.
For example, the function names may be formed of strings, and the structures may be sorted according to their string dictionary sequence and placed in a balanced binary search tree or other structure supporting binary search, i.e., a correspondence list.
For example, in Linux systems, executable programs are all in an ELF format, which is a very common format, symbols (i.e., function names and virtual addresses) corresponding to each function written in the program exist in the ELF file, and the stored structure is standard and definite.
The implementation is as follows, a thread, namely a proxy thread, can be additionally started in the second program, and the thread is used for reading the ELF file. When the second program is loaded and executed, the thread reads out all the function information of all the functions in the ELF file, obtains the function name of each function and the corresponding virtual address, wherein the function name of each function can be a character string, combines the function name and the virtual address into a structure body, sorts the structure bodies according to the character string dictionary sequence in the structure body, places the structure bodies into a balanced binary search tree or other structure supporting binary search, and monitors on a socket binding a predefined virtual address and a port to wait for the connection of the first program (the client).
In an alternative embodiment, step S13 specifically includes:
step S131: determining a general proxy function corresponding to the function according to the virtual address of the function; wherein the number of parameters of the general agent function is larger than all the other functions.
In order to be able to directly match the corresponding function, the virtual address can be forcedly converted into a universal proxy function, the universal proxy function has a plurality of parameters, the number of parameters is ensured to be larger than that of all other functions, and thus the function corresponding to the virtual address can be directly executed after conversion.
Step S132: and executing the universal proxy function.
It will be appreciated by those skilled in the art that obvious modifications (e.g., combinations of the listed modes) or equivalent substitutions may be made on the basis of the above-described embodiments.
In the foregoing, although the steps in the embodiments of the program debugging method are described in the above order, it should be clear to those skilled in the art that the steps in the embodiments of the disclosure are not necessarily performed in the above order, but may be performed in reverse order, parallel, cross, etc., and other steps may be added to those skilled in the art based on the above steps, and these obvious modifications or equivalent manners are also included in the protection scope of the disclosure and are not repeated herein.
The following is an embodiment of the disclosed apparatus, which may be used to perform steps implemented by an embodiment of the disclosed method, and for convenience of explanation, only those portions relevant to the embodiment of the disclosed method are shown, and specific technical details are not disclosed, referring to the embodiment of the disclosed method.
Example two
In order to solve the technical problem that the running program is suspended due to the fact that offline debugging cannot be performed or offline debugging cannot be performed in the prior art, the embodiment of the disclosure provides a program debugging device. The apparatus may perform the steps of the program debugging method embodiment described in the first embodiment. As shown in fig. 2, the apparatus mainly includes: a function name and parameter acquisition module 21, a function acquisition module 22, a function execution module 23 and an execution result transmission module 24; wherein, the liquid crystal display device comprises a liquid crystal display device,
the function name and parameter obtaining module 21 is configured to respond to a debug instruction sent by the first program, and parse the debug instruction to obtain a function name and parameter of a function to be debugged in the second program;
the function obtaining module 22 is configured to obtain the function according to the function name;
the function execution module 23 is configured to transfer the parameters into the function and execute the function;
the execution result sending module 24 is configured to send an execution result of the function to the first program, and display the execution result through the first program.
Further, the function obtaining module 22 includes: a virtual address acquisition unit 222 and a function acquisition unit 223;
the virtual address obtaining unit 222 is configured to obtain a virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address respectively;
the function acquisition unit 223 is configured to acquire the function according to the virtual address.
Further, the virtual address obtaining unit 222 is specifically configured to: searching a corresponding relation list according to the function name, and searching a virtual address corresponding to the function name from the corresponding relation list; and the corresponding relation list stores the corresponding relation between the function name and the virtual address of each function in the second program.
Further, the function execution module 23 is specifically configured to: determining a general proxy function corresponding to the function according to the virtual address of the function; the number of parameters of the general agent function is larger than that of all other functions; and executing the universal proxy function.
Further, the function obtaining module 22 further includes: a correspondence list construction unit 221; wherein, the correspondence list construction unit 221 is configured to obtain function information of all functions of the second program from a preset file; the function information of all functions is stored in the preset file, and the function information comprises function names and virtual addresses; combining the function name and the virtual address of each function into a structure; and constructing the corresponding relation list according to the structural bodies of all the functions.
Further, the debugging device is a proxy thread.
Further, the proxy thread communicates with the first program in any one of the following communication modes: socket communication, remote communication, named pipe, message queue.
For detailed descriptions of the working principles, the technical effects, etc. of the embodiments of the program debugging device, reference may be made to the related descriptions in the foregoing embodiments of the program debugging method, which are not repeated herein.
Example III
Referring now to fig. 3, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to a debugging instruction sent by a first program, and analyzing the debugging instruction to obtain the function name and the parameter of a function to be debugged in a second program; . Acquiring the function according to the function name; the parameters are transmitted into the function, and the function is executed; and sending the execution result of the function to the first program, and displaying the execution result through the first program.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (7)

1. A program debugging method, wherein an execution body of the method is a proxy thread, the method comprising:
responding to a debugging instruction sent by a first program, analyzing the debugging instruction to obtain function names and parameters of functions to be debugged in a second program, wherein the communication modes of the proxy thread and the first program comprise socket communication and remote communication;
obtaining a virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address respectively;
acquiring the function according to the virtual address;
determining a general proxy function corresponding to the function according to the virtual address of the function; the number of parameters of the general agent function is larger than that of all other functions;
executing the generic proxy function to implement execution of the function;
and sending the execution result of the function to the first program, and displaying the execution result through the first program.
2. The method according to claim 1, wherein the obtaining the virtual address corresponding to the function according to the function name includes:
searching a corresponding relation list according to the function name, and searching a virtual address corresponding to the function name from the corresponding relation list; and the corresponding relation list stores the corresponding relation between the function name and the virtual address of each function in the second program.
3. The method according to claim 1, wherein the method further comprises:
acquiring function information of all functions of the second program from a preset file; the function information of all functions is stored in the preset file, and the function information comprises function names and virtual addresses;
combining the function name and the virtual address of each function into a structure;
and constructing a corresponding relation list according to the structural bodies of all the functions.
4. The method of claim 1, wherein the proxy thread communicates with the first program using any one of the following communication means: socket communication, remote communication, named pipe, message queue.
5. A program debugging device, the device being a proxy thread, the device comprising:
the function name and parameter acquisition module is used for responding to a debugging instruction sent by a first program and analyzing the debugging instruction to acquire the function name and parameter of a function to be debugged in a second program, and the communication mode of the proxy thread and the first program comprises socket communication and remote communication;
the function acquisition module is used for acquiring the virtual address corresponding to the function according to the function name; wherein each function in the second program corresponds to a virtual address respectively;
acquiring the function according to the virtual address;
the function execution module determines a general proxy function corresponding to the function according to the virtual address of the function; the number of parameters of the general agent function is larger than that of all other functions;
executing the generic proxy function to implement execution of the function;
and the execution result sending module is used for sending the execution result of the function to the first program and displaying the execution result through the first program.
6. An electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor, when executed, implements the program debugging method according to any one of claims 1-4.
7. A computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the program debugging method of any of claims 1-4.
CN202010139856.2A 2020-03-03 2020-03-03 Program debugging method and device Active CN111400172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010139856.2A CN111400172B (en) 2020-03-03 2020-03-03 Program debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010139856.2A CN111400172B (en) 2020-03-03 2020-03-03 Program debugging method and device

Publications (2)

Publication Number Publication Date
CN111400172A CN111400172A (en) 2020-07-10
CN111400172B true CN111400172B (en) 2023-04-28

Family

ID=71434443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010139856.2A Active CN111400172B (en) 2020-03-03 2020-03-03 Program debugging method and device

Country Status (1)

Country Link
CN (1) CN111400172B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858337A (en) * 2020-07-21 2020-10-30 麒麟软件有限公司 Method for supporting Java application program to debug Native function
CN112631949B (en) * 2020-12-10 2021-09-21 浙江华创视讯科技有限公司 Debugging method and device, computer equipment and storage medium
CN114237837B (en) * 2021-11-12 2024-04-12 中通服创发科技有限责任公司 Program calling method, program calling device, program calling equipment and computer readable storage medium
CN113836046B (en) * 2021-11-29 2022-02-15 武汉天喻信息产业股份有限公司 Debugging method and system for application program of virtual machine on MCU (microprogrammed control Unit)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5968067A (en) * 1982-10-13 1984-04-17 Fujitsu Ltd Specifying system for number of run steps
CN102004692B (en) * 2010-11-25 2015-08-12 中兴通讯股份有限公司 Process debugged method and device
CN109684202B (en) * 2018-11-27 2022-06-17 国电南瑞科技股份有限公司 Method for debugging function in embedded system program in application
CN109634686A (en) * 2018-12-17 2019-04-16 郑州云海信息技术有限公司 A kind of method and system by BMC remote configuration server state

Also Published As

Publication number Publication date
CN111400172A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111400172B (en) Program debugging method and device
CN110489101B (en) Interface simulation method, system, medium and electronic equipment
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN111309304A (en) Method, device, medium and electronic equipment for generating IDL file
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN113282444B (en) Visualization method and device for debugging business process
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN111382058B (en) Service testing method and device, server and storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112084086B (en) Information collection method, device, medium and electronic equipment
CN111338928A (en) Chrome-based browser testing method and device
CN115600964A (en) Voice approval method and device and related equipment
CN112379967B (en) Simulator detection method, device, equipment and medium
CN111382057B (en) Test case generation method, test method and device, server and storage medium
CN113704079A (en) Interface testing method and device based on Protobuf
CN111382056B (en) Service testing method and device, server and storage medium
CN111124907A (en) Mobile phone game testing method and device and server
CN112486826B (en) Test method, test device, electronic equipment and computer readable medium
CN116561015B (en) Map application testing method, electronic device and computer readable medium
CN111708684B (en) Recording method and device for page access and computer system
CN114461416A (en) Automatic test optimization method and device, electronic equipment and readable storage medium
CN113704121A (en) Mobile terminal application software testing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant