CN111367796B - Application program debugging method and device - Google Patents

Application program debugging method and device Download PDF

Info

Publication number
CN111367796B
CN111367796B CN202010119893.7A CN202010119893A CN111367796B CN 111367796 B CN111367796 B CN 111367796B CN 202010119893 A CN202010119893 A CN 202010119893A CN 111367796 B CN111367796 B CN 111367796B
Authority
CN
China
Prior art keywords
source code
product
running
application program
debugging
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
CN202010119893.7A
Other languages
Chinese (zh)
Other versions
CN111367796A (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.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software 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 Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN202010119893.7A priority Critical patent/CN111367796B/en
Publication of CN111367796A publication Critical patent/CN111367796A/en
Application granted granted Critical
Publication of CN111367796B publication Critical patent/CN111367796B/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/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • 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/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • 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/366Software debugging using diagnostics
    • 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 invention provides an application program debugging method and device. Running an application program of an application at a server, wherein the running depends on at least one product, and the construction of the product depends on at least one source code file; if a row of instructions of a product is abnormal during running, generating second debugging information according to first debugging information generated during building the product, wherein the running of the abnormal row of instructions depends on source codes pointed by the second debugging information; providing each hyperlink respectively comprising each second debugging information to the outside; loading a specific line source code of a specific source code file of which the source code file set is used when the application program is run and is positioned therein according to second debug information of an externally requested hyperlink, the second debug information pointing to the specific line source code; setting a breakpoint at the location, and rerun the application program to provide an interrupt notification to the outside when running an interrupt to the breakpoint. According to the scheme, debugging can be realized when the application program running on the server side is abnormal.

Description

Application program debugging method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for debugging an application program.
Background
The DevOps (a collective term for processes, methods and systems, which is a combination of Development and Operations) and containerization techniques allow for rapid deployment of applications. An application or application service, the application program of which can run on the Web side or the service side. Among them, an interpreter program such as JavaScript is usually run on the Web side, and a compiler program such as Java and Net is usually run on the server side.
Based on the real-time debugging function provided by the modern browser, when an application program running on the Web end is abnormal, a developer can directly locate program codes causing the abnormality from a program call stack entry when the abnormality occurs and start debugging in situ.
In view of the fact that an application is inevitably abnormal during running, it is necessary to provide a debugging mode of a server application to realize debugging when an application running on a server is abnormal.
Disclosure of Invention
The invention provides an application program debugging method and device, which can realize debugging when an application program running on a server side is abnormal.
In order to achieve the above purpose, the invention is realized by the following technical scheme:
in a first aspect, the present invention provides an application program debugging method, including:
Running an application program of an application on a server side, wherein the running of the application program depends on at least one product, and the construction of each product depends on at least one source code file;
if an abnormality occurs in running a target line instruction of a first product, acquiring first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information;
generating at least one hyperlink respectively comprising the at least one second debugging information, and providing the at least one hyperlink externally; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes;
Setting a breakpoint at the specific line source code, and re-running the application program at the server, so that the operation is interrupted when the operation is performed to the breakpoint, and an interruption notification is provided when the operation is interrupted.
Further, the article version number of any of the articles includes: the method comprises the steps of identifying the product of the product, and a file set version number of a source code file set used when a specific application program runs, wherein the running of the specific application program depends on the product, and the product identification and/or the file set version number included in different product version numbers are different;
the file version number of any of the source code files includes: the file identification of the source code file and the version identification of the source code file, wherein the file identifications and/or the version identifications included in different file version numbers are different;
the first debug information includes: the product version number of the first product, the file identification and the line number corresponding to each line of instructions in the first product.
Further, the generating at least one second debug information corresponding to the target line instruction according to the first debug information includes:
determining an article version number of the first article included in the first debug information;
Determining a target file identifier and a target line number corresponding to the target line instruction in the first debugging information;
generating second debugging information comprising the product version number of the first product, the target file identification and the target line number;
determining a first source code file set used when the application program is run according to the file set version number in the product version number of the first product;
determining a target line source code of a target source code file in the first source code file set, wherein a file identifier of the target source code file is the target file identifier, and a line number of the target line source code is the target line number;
determining each destination line source code in the first set of source code files, wherein each of the destination line source codes is directly or indirectly relied upon when running the destination line source code;
the number of the destination line source codes is not zero, and for each destination line source code, the method is executed: determining a destination file identification of a destination source code file comprising the destination line source code in the first source code file set, and determining a destination line number of the destination line source code in the destination source code file; generating second debugging information comprising the product version number of the first product, the destination file identification and the destination line number.
Further, the loading the first source code file set used when running the application program according to the second debug information included in the first hyperlink and locating the specific line source code of the specific source code file in the first source code file set includes:
acquiring second debugging information included in the first hyperlink;
loading a first source code file set used when the application program is operated according to a file set version number in the product version number included in the second debugging information;
and locating the specific line source code of the specific source code file in the first source code file set according to the file identification and the line number in the second debugging information, wherein the file identification of the specific source code file is the file identification in the second debugging information, and the line number of the specific line source code is the line number in the second debugging information.
Further, each hyperlink points to a preset debugging function;
the application program for running an application on the server side comprises the following steps: running an application program of an application in a first process of a server side;
the re-running the application program at the server side comprises the following steps: re-running the application in the first process;
The method further comprises the steps of: starting the debugging function to run a debugging process, and monitoring the first process of the application program which is restarted by using the debugging process;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: and when the debugging process monitors the running interrupt of the first process, providing interrupt notification by utilizing the debugging function.
Further, the providing the at least one hyperlink to the outside includes: providing the at least one hyperlink externally through an integrated development environment running on a Web browser;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: providing interrupt notification to the outside through the integrated development environment when the operation is broken;
the loading the first source code file set used in running the application program according to the second debugging information included in the first hyperlink includes:
according to the second debugging information included in the first hyperlink, tracing back to a file set version number of the first source code file set used when the application program is operated;
and starting the integrated development environment to load the first source code file set with the file set version number.
Further, the interrupt notification includes: any one or more of an operation position, a call stack and a memory report when the operation of the application program is interrupted.
In a second aspect, the present invention provides an application debugging device for executing the application debugging method of any one of the first aspects, including:
the device comprises an operation unit, a processing unit and an interaction unit;
the running unit is used for running an application program of an application at a server, wherein the running of the application program depends on at least one product, and the construction of each product depends on at least one source code file;
the processing unit is configured to perform the following operations:
if an abnormality occurs in running a target line instruction of a first product, acquiring first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information; generating at least one hyperlink respectively comprising the at least one second debugging information, and triggering the interaction unit to externally provide the at least one hyperlink; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes; setting a breakpoint at the specific line source code, triggering the running unit to re-run the application program at the server, enabling the running to be interrupted when running to the breakpoint, and triggering the interaction unit to provide interrupt notification when running to the breakpoint.
In a third aspect, the present invention provides an application program debugging apparatus, comprising: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
the at least one processor is configured to invoke the machine readable program to perform the method of any of the first aspects.
In a fourth aspect, the present invention provides a computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the method of any of the first aspects above.
The invention provides an application program debugging method and device. Running an application program of an application at a server, wherein the running depends on at least one product, and the construction of the product depends on at least one source code file; if a row of instructions of a product is abnormal during running, generating second debugging information according to first debugging information generated during building the product, wherein the running of the abnormal row of instructions depends on source codes pointed by the second debugging information; providing each hyperlink respectively comprising each second debugging information to the outside; loading a specific line source code of a specific source code file of which the source code file set is used when the application program is run and is positioned therein according to second debug information of an externally requested hyperlink, the second debug information pointing to the specific line source code; setting a breakpoint at the location, and rerun the application program to provide an interrupt notification to the outside when running an interrupt to the breakpoint. The invention can realize debugging when the application program running on the server side is abnormal.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an application program debugging method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an application structure of an application according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an application debugging system according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an application program debugging device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
As shown in fig. 1, an embodiment of the present invention provides an application program debugging method, which may include the following steps:
step 101: an application program of an application is run on a server side, wherein the application program runs on at least one product, and the construction of each product depends on at least one source code file.
Step 102: if an abnormality occurs in running a target line instruction of a first product, obtaining first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product.
Step 103: generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information.
Step 104: generating at least one hyperlink respectively comprising the at least one second debugging information, and providing the at least one hyperlink externally; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes.
Step 105: setting a breakpoint at the specific line source code, and re-running the application program at the server, so that the operation is interrupted when the operation is performed to the breakpoint, and an interruption notification is provided when the operation is interrupted.
The embodiment of the invention provides an application program debugging method, which comprises the following steps: running an application program of an application at a server, wherein the running depends on at least one product, and the construction of the product depends on at least one source code file; if a row of instructions of a product is abnormal during running, generating second debugging information according to first debugging information generated during building the product, wherein the running of the abnormal row of instructions depends on source codes pointed by the second debugging information; providing each hyperlink respectively comprising each second debugging information to the outside; loading a specific line source code of a specific source code file of which the source code file set is used when the application program is run and is positioned therein according to second debug information of an externally requested hyperlink, the second debug information pointing to the specific line source code; setting a breakpoint at the location, and rerun the application program to provide an interrupt notification to the outside when running an interrupt to the breakpoint. The embodiment of the invention can realize debugging when the application program running on the server side is abnormal.
Referring to the application structure of the application shown in fig. 2, the constituent elements, tasks and source code files involved in the application lifecycle can be known. The elements include applications, mirror images and products, and the tasks include service scheduling tasks, mirror image construction tasks and product construction tasks. Based on the application structure, corresponding artifacts can be built from several source code files, corresponding images can be built from several artifacts, and applications can be built from several images.
For any element, the element in the application structure is a statement on the element, and the generated element is a real product. When the file content of the source code file based on which the same element is generated at different times is different, the generated products are the element products of the element, but the element products respectively correspond to different versions. In the embodiment of the invention, the running product can be any product.
For ease of description of the technology, the following articles may be understood as article products and the following applications may be understood as application products.
The product constructed by the source code file is an executable file, and when an application program of an application is run, each relevant product is run, namely, each row of computer instructions of the product is run. In this way, in order to facilitate the tracing and positioning of the abnormal information, the first debugging information can be generated when the product is constructed, and the mapping relation between the product and the corresponding source code file can be recorded in the first debugging information. For example, the first debug information may comprise a mapping of instructions in the article of manufacture to source code in the source code file.
When any line instruction of any product is run, an exception occurs, and the source code pointed by the exception line instruction can be found according to the mapping relation in the first debugging information of the product.
In addition, since the execution of one line of source code may also depend on another source code, which may in turn depend on yet another source code, and so on, each source code pointed to indirectly by the exception line instruction may be found based on the source code pointed to directly by the exception line instruction. Typically, these source codes are found in different source code files, respectively.
Based on the above, the execution of the abnormal line instruction depends on each source code found, and based on the source codes found, the second debug information corresponding to each source code can be generated.
For example, an exception line instruction may map to source code 1, the execution of source code 1 depends on source code 2, the execution of source code 2 depends on source code 3, and the execution of source code 3 does not depend on other source codes, then 3 second debug information may be generated from the first debug information, which 3 second debug information point to source code 1, source code 2, and source code 3, respectively.
Since the abnormal operation of the abnormal line instruction may be caused by the error of any source code pointed by the abnormal line instruction, the identification information of the source codes may be provided to the developer, so that the developer may determine which source code to debug for according to the need.
Thus, based on the above, 3 hyperlinks may be generated, the 3 hyperlinks containing the 3 pieces of second debug information, respectively, each hyperlink containing one piece of second debug information. Then, the abnormal information including the 3 hyperlinks can be provided to the outside so that the developer can view the respective second debug information.
The developer can request to debug the source code pointed to by the second debug information in each hyperlink by clicking on any hyperlink according to the source code pointed to by the second debug information in that hyperlink.
In the embodiment of the invention, the system of the server can provide a debugging inlet, so that when the application program runs abnormally, a developer can automatically start debugging by only operating a mouse to click a certain debugging inlet, and the operation of the developer is simple.
Assuming that the developer clicks on a hyperlink pointing to source code 1, the set of source code files used when running the application may be loaded based on the second debug information in the hyperlink. Of course, the source code file set should include the source code file in which the source code 1 is located, and further locate the source code 1, so that a breakpoint can be set at the source code 1.
Because the breakpoint is set, when the application program is rerun, the application program is interrupted when the application program is run to the breakpoint, and an interruption notification is provided to the outside, so that a developer can check the problem. For example, a developer can check a memory report, a call stack and the like when running is interrupted, and can send a debugging instruction according to needs, so that the application program debugging operation is completed.
In summary, the application program debugging method provided by the embodiment of the invention can automatically start the debugging process when the application program running on the server side is abnormal, so that the application program debugging is realized, the manual operation is simple, the automatic execution of the application program debugging is basically realized, the work of a developer is saved, and the application program debugging efficiency is improved.
As mentioned above, when the source code files on which the same element is generated at different times are not exactly the same, the generated element products respectively correspond to different versions.
Thus, in one embodiment of the invention, the article version number of any of the articles comprises: the method comprises the steps of identifying the product of the product, and a file set version number of a source code file set used when a specific application program runs, wherein the running of the specific application program depends on the product, and the product identification and/or the file set version number included in different product version numbers are different;
The file version number of any of the source code files includes: the file identification of the source code file and the version identification of the source code file, wherein the file identifications and/or the version identifications included in different file version numbers are different;
the first debug information includes: the product version number of the first product, the file identification and the line number corresponding to each line of instructions in the first product.
For example, according to the application structure of the application Y1, it is known that the running of the application program of the application Y1 depends on the artifact Z1 and the artifact Z2, the construction of the artifact Z1 depends on the source code file a and the source code file B, and the construction of the artifact Z2 depends on the source code file C and the source code file D.
Referring to the following Table 1, when there are initial versions of the source code files, the corresponding file version numbers are A-1, B-1, C-1, and D-1, respectively, a source code file set V1 with a file set version number V1 may be generated, where the source code file set V1 includes a source code file A-1, a source code file B-1, a source code file C-1, and a source code file D-1.
According to the application structure of the source code file set V1 and the application Y1, a product Z1-1 and a product Z2-1 can be constructed, and then the application Y1-1 is generated. When the application program of the application Y1-1 is run on the server side, the application program is realized based on the source code file set V1 and depends on the product Z1-1 and the product Z2-1.
Taking a source code file B-1 as an example, B-1 is a file version number, B is a file identifier, and suffix 1 is a version identifier. Taking the product Z1-1 as an example, Z1-1 is its product version number, Z1 is the product identifier, and suffix 1 is the file set version number (corresponding to V1).
Assuming that when the product Z1-1 is constructed according to the source code file a-1 and the source code file B-1, the 10 th line in the source code file a-1 corresponds to the x-th line of computer instructions in the product Z1-1, in the first debug information of the product Z1-1, the file identifier corresponding to the x-th line of instructions is a, and the corresponding line number is 10.
TABLE 1
Version number of file set File version number Product version number Application version number
V1 A-1、B-1、C-1、D-1 Z1-1、Z2-1 Y1-1
V2 A-1、B-2、C-1、D-1 Z1-2、Z2-2 Y1-2
If the developer modifies only the source code file B and provides the source code file B-2 in one source code modification process, please refer to the above table 1, a source code file set V2 with a file set version number V2 may be generated, where the source code file set V2 includes a source code file a-1, a source code file B-2, a source code file C-1, and a source code file D-1.
From the source code file set V2 and the application structure of the application Y1, the artifacts Z1-2 can be constructed. In addition, since the source code file C and the source code file D are not modified, it is unnecessary to repeatedly construct the product 2, the product Z2-1 constructed last time is still used, and the product Z2-2=the product Z2-1 is recorded, thereby generating the application Y1-2. The application program of the application Y1-2 is executed on the server side, is realized based on the source code file set V2, and depends on the product Z1-2 and the product Z2-2.
Taking a source code file B-2 as an example, B-2 is a file version number, B is a file identifier, and suffix 2 is a version identifier. Taking the product Z1-2 as an example, Z1-2 is its product version number, Z1 is the product identifier, and suffix 2 is the file set version number (corresponding to V2).
Based on the foregoing, in one embodiment of the present invention, to illustrate a possible implementation manner of generating each second debug information according to the first debug information, so in step 103, generating at least one second debug information corresponding to the target line instruction according to the first debug information includes:
determining an article version number of the first article included in the first debug information; determining a target file identifier and a target line number corresponding to the target line instruction in the first debugging information; generating second debugging information comprising the product version number of the first product, the target file identification and the target line number; determining a first source code file set used when the application program is run according to the file set version number in the product version number of the first product; determining a target line source code of a target source code file in the first source code file set, wherein a file identifier of the target source code file is the target file identifier, and a line number of the target line source code is the target line number; determining each destination line source code in the first set of source code files, wherein each of the destination line source codes is directly or indirectly relied upon when running the destination line source code; the number of the destination line source codes is not zero, and for each destination line source code, the method is executed: determining a destination file identification of a destination source code file comprising the destination line source code in the first source code file set, and determining a destination line number of the destination line source code in the destination source code file; generating second debugging information comprising the product version number of the first product, the destination file identification and the destination line number.
For example, assuming that an exception occurs when the x-th line instruction of the product Z1-1 is executed, the first debug information of the product Z1-1 may be obtained, and the file identifier a and the line number 10 corresponding to the x-th line instruction in the first debug information may be determined. In this manner, second debug information including Z1-1, A, 10 may be generated. The second debug information points to line 10 source code of source code file A-1. Then, from Z1-1, the set of source code files V1 used when running the application program of application Y1 can be determined.
Assuming that the execution of the 10 th line source code of source code file A-1 also depends on the 5 th line source code of source code file C-1 in source code file set V1, and that the execution of the 5 th line source code of source code file C-1 does not depend on other source codes in source code file set V1, then second debug information including Z1-1, C, 5 may be generated.
In this manner, two hyperlinks may be generated, one of which may expose debug information to a developer: z1-1, A, 10, another hyperlink may present debug information to the developer: z1-1, C, 5.
Based on the foregoing, in one embodiment of the present invention, to illustrate a possible implementation manner of locating a specific line of source code, in step 104, loading a first set of source code files used when running the application according to the second debug information included in the first hyperlink and locating the specific line of source code of a specific source code file in the first set of source code files includes:
Acquiring second debugging information included in the first hyperlink; loading a first source code file set used when the application program is operated according to a file set version number in the product version number included in the second debugging information; and locating the specific line source code of the specific source code file in the first source code file set according to the file identification and the line number in the second debugging information, wherein the file identification of the specific source code file is the file identification in the second debugging information, and the line number of the specific line source code is the line number in the second debugging information.
For example, suppose that the developer clicks on the above-described presentation with debug information: the hyperlinks of Z1-1, A and 10 can be loaded into the source code file set V1 according to the version number of the file set in Z1-1, wherein the source code file set V1 comprises a source code file A-1, a source code file B-1, a source code file C-1 and a source code file D-1, and further can be positioned to the 10 th row of the source code file A-1 according to A and 10.
In one embodiment of the invention, there may be an application debugging system as shown in FIG. 3, which may include an application configuration, integration, and deployment system, as well as components or functions including an integrated development environment, a runtime environment, a debugging service, a version control system, an artifact library, a mirror library, and the like.
Wherein the integrated development environment can be used for loading a source code file set, modifying a source code file and the like;
the application configuration, integration and deployment system may be used to generate artifacts from the source code files and deploy applications to the runtime environment;
the operation environment can be divided into a development environment, a test environment and a production environment, and the operation environment can be used for starting a server process, loading and operating products, providing services to the outside and the like.
The debugging service can be used for starting a debugging process, scheduling application configuration, integration and deployment systems, respectively communicating with an integrated development environment and an operation environment, and the like;
the debugging service can be used for running a debugging process and monitoring a target process running an application program;
the version control system can be used for version control of source code files, source code file sets, artifacts, applications, etc.;
the file server may be used to store source code files, etc.
In the embodiment of the invention, the application operated by the operation environment can be generated by an application configuration, integration and deployment system, and the system can be responsible for organizing a source code file into a source code project, then generating a product by the source code project, constructing a mirror image by the product and deploying the mirror image to the operation environment to become the application capable of providing services to the outside. For an application deployed to a running environment, the system records the version number of the artifact used, and records the mapping relationship between the artifact instructions and the source code when the artifact is generated. According to the product version number and the mapping relation, the system can trace and locate the source code corresponding to the abnormal product, so that the debugging of the application program is realized.
Based on the foregoing, in one embodiment of the present invention, please refer to fig. 3, wherein each of the hyperlinks points to a preset debug function;
the application program for running an application on the server side comprises the following steps: running an application program of an application in a first process of a server side;
the re-running the application program at the server side comprises the following steps: re-running the application in the first process;
the method further comprises the steps of: starting the debugging function to run a debugging process, and monitoring the first process of the application program which is restarted by using the debugging process;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: and when the debugging process monitors the running interrupt of the first process, providing interrupt notification by utilizing the debugging function.
Based on the foregoing, in one embodiment of the present invention, please refer to fig. 3, the providing the at least one hyperlink includes: providing the at least one hyperlink externally through an integrated development environment running on a Web browser;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: providing interrupt notification to the outside through the integrated development environment when the operation is broken;
The loading the first source code file set used in running the application program according to the second debugging information included in the first hyperlink includes: according to the second debugging information included in the first hyperlink, tracing back to a file set version number of the first source code file set used when the application program is operated; and starting the integrated development environment to load the first source code file set with the file set version number.
In the embodiment of the invention, the server can send the abnormal information to the client browser and provide the hyperlink, and after the developer clicks, the system of the server starts an automatic debugging step.
In one embodiment of the invention, the interrupt notification includes: any one or more of an operation position, a call stack and a memory report when the operation of the application program is interrupted.
In the embodiment of the invention, a developer can access the integrated development environment through a browser to obtain relevant debugging information, such as a running position, a call stack, a memory report and the like, and can send a debugging instruction to a debugging process.
As shown in fig. 4, an embodiment of the present invention provides an application debugging device for executing any one of the above application debugging methods, which may include: an operation unit 401, a processing unit 402, and an interaction unit 403;
The running unit 401 is configured to run an application program of an application on a server, where the running of the application program depends on at least one product, and each product is constructed by at least one source code file;
the processing unit 402 is configured to perform the following operations:
if an abnormality occurs in running a target line instruction of a first product, acquiring first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information; generating at least one hyperlink including the at least one second debug information, respectively, and triggering the interaction unit 403 to provide the at least one hyperlink externally; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes; a breakpoint is set at the specific line source code, and the running unit 401 is triggered to re-run the application program at the server, so that the running is interrupted when the running is performed to the breakpoint, and the interaction unit 403 is triggered to provide an interrupt notification to the outside when the running is interrupted.
The content of information interaction and execution process between the units in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
Embodiments of the present invention also provide a computer readable medium storing instructions for causing a computer to perform an application debugging method as described herein. Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion unit connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion unit is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
In summary, the embodiments of the present invention have at least the following advantages:
1. in the embodiment of the invention, an application program of an application is run on a server side, the running of the application program depends on at least one product, and the construction of the product depends on at least one source code file; if a row of instructions of a product is abnormal during running, generating second debugging information according to first debugging information generated during building the product, wherein the running of the abnormal row of instructions depends on source codes pointed by the second debugging information; providing each hyperlink respectively comprising each second debugging information to the outside; loading a specific line source code of a specific source code file of which the source code file set is used when the application program is run and is positioned therein according to second debug information of an externally requested hyperlink, the second debug information pointing to the specific line source code; setting a breakpoint at the location, and rerun the application program to provide an interrupt notification to the outside when running an interrupt to the breakpoint. The embodiment of the invention can realize debugging when the application program running on the server side is abnormal.
2. The application program debugging method provided by the embodiment of the invention can automatically start the debugging process when the application program running on the server side is abnormal, so that the application program debugging is realized, the manual operation is simple, the automatic execution of the application program debugging is basically realized, the work of a developer is saved, and the application program debugging efficiency is improved.
It should be noted that not all the steps and modules in the above flowcharts and the system configuration diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution sequence of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented jointly by some components in multiple independent devices.
In the above embodiments, the hardware unit may be mechanically or electrically implemented. For example, a hardware unit may include permanently dedicated circuitry or logic (e.g., a dedicated processor, FPGA, or ASIC) to perform the corresponding operations. The hardware unit may also include programmable logic or circuitry (e.g., a general-purpose processor or other programmable processor) that may be temporarily configured by software to perform the corresponding operations. The particular implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
It is noted that relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of additional identical elements in a process, method, article or apparatus that comprises the element.
While the invention has been illustrated and described in detail in the drawings and in the preferred embodiments, the invention is not limited to the disclosed embodiments, and it will be appreciated by those skilled in the art that the code audits of the various embodiments described above may be combined to produce further embodiments of the invention, which are also within the scope of the invention.

Claims (8)

1. The application program debugging method is characterized by comprising the following steps:
running an application program of an application on a server side, wherein the running of the application program depends on at least one product, and the construction of each product depends on at least one source code file;
if an abnormality occurs in running a target line instruction of a first product, acquiring first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information;
generating at least one hyperlink respectively comprising the at least one second debugging information, and providing the at least one hyperlink externally; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes;
Setting a breakpoint at the specific line source code, and re-running the application program at the server so as to ensure that the operation is interrupted when the operation is performed to the breakpoint, and providing an interruption notification when the operation is interrupted;
the article version number of any of the articles includes: the method comprises the steps of identifying the product of the product, and a file set version number of a source code file set used when a specific application program runs, wherein the running of the specific application program depends on the product, and the product identification and/or the file set version number included in different product version numbers are different;
the file version number of any of the source code files includes: the file identification of the source code file and the version identification of the source code file, wherein the file identifications and/or the version identifications included in different file version numbers are different;
the first debug information includes: the product version number of the first product, the file identification and the line number corresponding to each line of instructions in the first product;
the generating at least one second debug information corresponding to the target line instruction according to the first debug information includes:
determining an article version number of the first article included in the first debug information;
Determining a target file identifier and a target line number corresponding to the target line instruction in the first debugging information;
generating second debugging information comprising the product version number of the first product, the target file identification and the target line number;
determining a first source code file set used when the application program is run according to the file set version number in the product version number of the first product;
determining a target line source code of a target source code file in the first source code file set, wherein a file identifier of the target source code file is the target file identifier, and a line number of the target line source code is the target line number;
determining each destination line source code in the first set of source code files, wherein each of the destination line source codes is directly or indirectly relied upon when running the destination line source code;
the number of the destination line source codes is not zero, and for each destination line source code, the method is executed: determining a destination file identification of a destination source code file comprising the destination line source code in the first source code file set, and determining a destination line number of the destination line source code in the destination source code file; generating second debugging information comprising the product version number of the first product, the destination file identification and the destination line number.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the loading a first set of source code files used in running the application program according to second debugging information included in the first hyperlink and locating a specific row of source code of a specific source code file in the first set of source code files includes:
acquiring second debugging information included in the first hyperlink;
loading a first source code file set used when the application program is operated according to a file set version number in the product version number included in the second debugging information;
and locating the specific line source code of the specific source code file in the first source code file set according to the file identification and the line number in the second debugging information, wherein the file identification of the specific source code file is the file identification in the second debugging information, and the line number of the specific line source code is the line number in the second debugging information.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
each hyperlink points to a preset debugging function;
the application program for running an application on the server side comprises the following steps: running an application program of an application in a first process of a server side;
The re-running the application program at the server side comprises the following steps: re-running the application in the first process;
the method further comprises the steps of: starting the debugging function to run a debugging process, and monitoring the first process of the application program which is restarted by using the debugging process;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: and when the debugging process monitors the running interrupt of the first process, providing interrupt notification by utilizing the debugging function.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the externally providing the at least one hyperlink includes: providing the at least one hyperlink externally through an integrated development environment running on a Web browser;
the step of providing an interrupt notification to the outside when the operation is interrupted comprises the following steps: providing interrupt notification to the outside through the integrated development environment when the operation is broken;
the loading the first source code file set used in running the application program according to the second debugging information included in the first hyperlink includes:
according to the second debugging information included in the first hyperlink, tracing back to a file set version number of the first source code file set used when the application program is operated;
And starting the integrated development environment to load the first source code file set with the file set version number.
5. The method according to any one of claim 1 to 4, wherein,
the interrupt notification includes: any one or more of an operation position, a call stack and a memory report when the operation of the application program is interrupted.
6. An application debugging device for executing the application debugging method according to any one of claims 1 to 5, comprising:
the device comprises an operation unit, a processing unit and an interaction unit;
the running unit is used for running an application program of an application at a server, wherein the running of the application program depends on at least one product, and the construction of each product depends on at least one source code file;
the processing unit is configured to perform the following operations:
if an abnormality occurs in running a target line instruction of a first product, acquiring first debugging information generated in building the first product, wherein the first product is any product in the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one second debug information corresponding to the target line instruction according to the first debug information, wherein source codes pointed by different second debug information are different, and the running of the target line instruction depends on the source code pointed by each second debug information; generating at least one hyperlink respectively comprising the at least one second debugging information, and triggering the interaction unit to externally provide the at least one hyperlink; when an external request opens any first hyperlink in the at least one hyperlink, loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink, and positioning specific row source codes of specific source code files in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific row source codes; setting a breakpoint at the specific line source code, triggering the running unit to re-run the application program at the server, enabling the running to be interrupted when running to the breakpoint, and triggering the interaction unit to provide interrupt notification when running to the breakpoint.
7. An application program debugging device, comprising: at least one memory and at least one processor;
the at least one memory for storing a machine readable program;
the at least one processor being configured to invoke the machine readable program to perform the method of any of claims 1 to 5.
8. A computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1 to 5.
CN202010119893.7A 2020-02-26 2020-02-26 Application program debugging method and device Active CN111367796B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010119893.7A CN111367796B (en) 2020-02-26 2020-02-26 Application program debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010119893.7A CN111367796B (en) 2020-02-26 2020-02-26 Application program debugging method and device

Publications (2)

Publication Number Publication Date
CN111367796A CN111367796A (en) 2020-07-03
CN111367796B true CN111367796B (en) 2023-06-16

Family

ID=71206569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010119893.7A Active CN111367796B (en) 2020-02-26 2020-02-26 Application program debugging method and device

Country Status (1)

Country Link
CN (1) CN111367796B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527546A (en) * 2020-12-14 2021-03-19 携程旅游网络技术(上海)有限公司 Application exception rapid positioning method, system, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6804813B1 (en) * 2000-11-03 2004-10-12 Hewlett-Packard Development Company, L.P. System and method for remote and local diagnosis using automatically identified symbol libraries to create record based requests with tag lists of data to be collected from an operating system
CN106294134A (en) * 2016-07-29 2017-01-04 腾讯科技(深圳)有限公司 The collapse localization method of code and device
CN109783342A (en) * 2017-11-10 2019-05-21 华为技术有限公司 Script debugging method, equipment and computer storage medium
CN109947641A (en) * 2019-02-20 2019-06-28 北京百佑科技有限公司 Automated testing method and device
CN110569044A (en) * 2019-09-09 2019-12-13 山东浪潮通软信息科技有限公司 method, device and system for deploying application to running environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446723B (en) * 2014-09-02 2018-11-23 国际商业机器公司 Method and apparatus for identifying the semantic differential between source code version
US10521329B2 (en) * 2015-05-08 2019-12-31 Intergral GmbH Debugging system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6804813B1 (en) * 2000-11-03 2004-10-12 Hewlett-Packard Development Company, L.P. System and method for remote and local diagnosis using automatically identified symbol libraries to create record based requests with tag lists of data to be collected from an operating system
CN106294134A (en) * 2016-07-29 2017-01-04 腾讯科技(深圳)有限公司 The collapse localization method of code and device
CN109783342A (en) * 2017-11-10 2019-05-21 华为技术有限公司 Script debugging method, equipment and computer storage medium
CN109947641A (en) * 2019-02-20 2019-06-28 北京百佑科技有限公司 Automated testing method and device
CN110569044A (en) * 2019-09-09 2019-12-13 山东浪潮通软信息科技有限公司 method, device and system for deploying application to running environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种获取Web结构切片的方法及其应用;吴军华;汪婷婷;;南京工业大学学报(自然科学版)(第04期);全文 *

Also Published As

Publication number Publication date
CN111367796A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
EP3769223B1 (en) Unified test automation system
US9465725B2 (en) Software defect reporting
CN108399132B (en) Scheduling test method, device and storage medium
CN106844136B (en) Method and system for collecting program crash information
US10067855B2 (en) Error developer association
CN110187914B (en) Application development method, system and device
US20120159443A1 (en) System and method for reducing test effort by object risk analysis
US7512933B1 (en) Method and system for associating logs and traces to test cases
US9983979B1 (en) Optimized dynamic matrixing of software environments for application test and analysis
CN112395202B (en) Interface automation test method and device, computer equipment and storage medium
CN103186463B (en) Determine the method and system of the test specification of software
CN108595319B (en) Function selection method and server
US9779014B2 (en) Resilient mock object creation for unit testing
CN115391228A (en) Precise test method, device, equipment and medium
CN111367796B (en) Application program debugging method and device
CN112579099A (en) Code deployment method and device, storage medium and electronic equipment
US11755458B2 (en) Automatic software behavior identification using execution record
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN114328168A (en) Anomaly detection method and device, computer equipment and storage medium
CN110471828B (en) Operating system testing method, device and equipment thereof
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN110928777A (en) Test case processing method, device, equipment and storage medium
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
Winzinger et al. Automatic test case generation for serverless applications
US9792202B2 (en) Identifying a configuration element value as a potential cause of a testing operation failure

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