CN111367796A - Application program debugging method and device - Google Patents

Application program debugging method and device Download PDF

Info

Publication number
CN111367796A
CN111367796A CN202010119893.7A CN202010119893A CN111367796A CN 111367796 A CN111367796 A CN 111367796A CN 202010119893 A CN202010119893 A CN 202010119893A CN 111367796 A CN111367796 A CN 111367796A
Authority
CN
China
Prior art keywords
source code
application program
debugging
product
running
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.)
Granted
Application number
CN202010119893.7A
Other languages
Chinese (zh)
Other versions
CN111367796B (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

Landscapes

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

Abstract

The invention provides an application program debugging method and device. Running an application of an application on a server, wherein the running of the application depends on at least one product, and the construction of the product depends on at least one source code file; if one line 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 line 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 source code file set used when the application program is operated and positioning a specific line source code of a specific source code file in the source code file according to second debugging information of a hyperlink requested to be opened from the outside, wherein the second debugging information points to the specific line source code; and setting a breakpoint at the positioning position, and re-running the application program to provide an external interrupt notification when the interrupt is run to the breakpoint. The scheme can realize debugging when the application program operated by the server side is abnormal.

Description

Application program debugging method and device
Technical Field
The invention relates to the technical field of computers, in particular to an application program debugging method and device.
Background
DevOps (a collective term for processes, methods, and systems, being a combination of Development and Operations) and containerization techniques allow applications to be deployed quickly. An application or application service, and an application program thereof can run on a Web end or a server end. Among them, an interpreted program, such as JavaScript, is usually run on the Web side, and a compiled program, such as Java,. 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 at a Web end is abnormal, a developer can call a stack inlet from the program when the abnormality occurs, directly position a program code causing the abnormality, and start debugging on site.
In view of the problem that an application program is inevitably abnormal during running, it is necessary to provide a server-side application program debugging method to implement debugging when an application program running at a server side is abnormal.
Disclosure of Invention
The invention provides an application program debugging method and device, which can realize debugging when an application program operated by a server side is abnormal.
In order to achieve the 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 at a server, wherein the running of the application program depends on at least one artifact, and the construction of each artifact depends on at least one source code file;
if an exception occurs when a target line instruction of a first product is operated, acquiring first debugging information generated when the first product is constructed, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different pieces of second debugging information point to different source codes, and the running of the target line instruction depends on the source code pointed by each piece of second debugging 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 is made to open 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 a specific line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code;
and setting a breakpoint at the source code of the specific line, and re-running the application program at the server, so that the application program is interrupted when running to the breakpoint, and providing an interruption notification to the outside when the application program is interrupted.
Further, the article version number of any of the articles comprises: an article identification of the article, a fileset version number of a set of source code files used in running a particular application, wherein the running of the particular application is dependent on the article, different article version numbers comprising different article identification and/or fileset version numbers;
the file version number of any source code file comprises: the file identifier of the source code file and the version identifier of the source code file are different, wherein the file identifiers and/or the version identifiers of different file version numbers are different;
the first debug information includes: the product version number of the first product, and the file identifier and the line number corresponding to each line of instructions in the first product.
Further, the generating at least one second debug message corresponding to the target line instruction according to the first debug message includes:
determining an article version number of the first article that the first commissioning information includes;
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 operated according to a file set version number in the product version numbers 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 source code file set, wherein the target line source code is directly or indirectly dependent on each destination line source code when running;
when the number of the source codes of the destination line is not zero, aiming at each source code of the destination line, executing: determining a destination file identifier 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; and 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 a first source code file set used when the application program is run according to second debugging information included in the first hyperlink and locating a specific line source code of a specific source code file in the first source code file set includes:
acquiring second debugging information included by 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 positioning a specific line source code of a specific source code file in the first source code file set according to the file identifier and the line number in the second debugging information, wherein the file identifier of the specific source code file is the file identifier in the second debugging information, and the line number of the specific line source code is the line number in the second debugging information.
Furthermore, each hyperlink points to a preset debugging function;
the application program for running an application at the server side comprises the following steps: running an application program of an application in a first process of a server;
the re-running the application program at the server includes: re-running the application in the first process;
the method further comprises the following steps: starting the debugging function to run a debugging process, and monitoring the first process which has rerun the application program by using the debugging process;
the externally providing the interrupt notification when the operation is interrupted comprises the following steps: and when the debugging process monitors that the first process is interrupted in operation, utilizing the debugging function to externally provide an interruption notice.
Further, 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 externally providing the interrupt notification when the operation is interrupted comprises the following steps: providing an interruption notice to the outside through the integrated development environment when the operation is interrupted;
the loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink comprises:
according to second debugging information included by the first hyperlink, the version number of a file set of a first source code file set used when the application program is operated is traced back;
and starting the integrated development environment to load the first source code file set with the version number of the file set.
Further, the interrupt notification includes: any one or more of a running position, a call stack and a memory report when the application program is interrupted.
In a second aspect, the present invention provides an application program debugging apparatus for executing the application program debugging method in any one of the first aspects, including:
the system 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 used for executing the following operations:
if an exception occurs when a target line instruction of a first product is operated, acquiring first debugging information generated when the first product is constructed, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different pieces of second debugging information point to different source codes, and the running of the target line instruction depends on the source code pointed by each piece of second debugging information; generating at least one hyperlink respectively comprising the at least one second debugging information, and triggering the interaction unit to provide the at least one hyperlink externally; when an external request is made to open 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 a specific line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code; and setting a breakpoint at the source code of the specific line, and triggering the running unit to rerun the application program at the server, so that when the application program is run to the breakpoint, a break is run, and when the application program is broken, triggering the interaction unit to provide a break notification to the outside.
In a third aspect, the present invention provides an apparatus for debugging an application program, including: at least one memory and at least one processor;
the at least one memory to store 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 above 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 of an application on a server, wherein the running of the application depends on at least one product, and the construction of the product depends on at least one source code file; if one line 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 line 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 source code file set used when the application program is operated and positioning a specific line source code of a specific source code file in the source code file according to second debugging information of a hyperlink requested to be opened from the outside, wherein the second debugging information points to the specific line source code; and setting a breakpoint at the positioning position, and re-running the application program to provide an external interrupt notification when the interrupt is run to the breakpoint. The invention can realize debugging when the application program operated by 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 used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of an application program debugging method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an application architecture of an application according to an embodiment of the present invention;
FIG. 3 is a 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 apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope 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: and running an application program of an application at 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.
Step 102: if an exception occurs when a target line instruction of a first product is operated, first debugging information generated when the first product is constructed is obtained, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product.
Step 103: and generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different source codes pointed by different second debugging information are different, and the running of the target line instruction depends on the source code pointed by each piece of second debugging 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 is made to open 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 line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code.
Step 105: and setting a breakpoint at the source code of the specific line, and re-running the application program at the server, so that the application program is interrupted when running to the breakpoint, and providing an interruption notification to the outside when the application program is interrupted.
The embodiment of the invention provides an application program debugging method, which comprises the following steps: running an application of an application on a server, wherein the running of the application depends on at least one product, and the construction of the product depends on at least one source code file; if one line 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 line 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 source code file set used when the application program is operated and positioning a specific line source code of a specific source code file in the source code file according to second debugging information of a hyperlink requested to be opened from the outside, wherein the second debugging information points to the specific line source code; and setting a breakpoint at the positioning position, and re-running the application program to provide an external interrupt notification when the interrupt is run to the breakpoint. The embodiment of the invention can realize debugging when the application program operated by the server side is abnormal.
Referring to the application structure of the application shown in fig. 2, it can be known that the constituent elements involved in the application lifecycle are elements, tasks, and source code files. The elements comprise applications, mirror images and products, and correspondingly, the tasks comprise service arrangement tasks, mirror image construction tasks and product construction tasks. Based on the application structure, a corresponding artifact can be built from a number of source code files, a corresponding image can be built from a number of artifacts, and an application can be built from a number of images.
It should be noted that, for any element, the element in the application structure is a declaration of the element, and the generated element is a real product. When the file contents of source code files on which the same element is generated at different times are different, the generated products are element products of the element, but the element products respectively correspond to different versions. In embodiments of the present invention, the article of manufacture being run may be any article of manufacture that is constructed.
For ease of technical description, the following products will be understood as products of the products and the following applications will be understood as products of the applications.
The product constructed from the source code file is an executable file, and when the application program of the application is run, each related product is run, that is, each line of computer instructions of the product is run. In this way, in order to facilitate tracing and locating of the abnormal information, first debugging information of the product can be generated when the product is built, and the mapping relationship between the product and the corresponding source code file can be recorded in the first debugging information. For example, the first debug information may include a mapping of instructions in the article of manufacture to source code in a source code file.
When any line instruction of any product is abnormal, the source code directly pointed by the abnormal 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 depend on another source code, which may depend on another source code, the loop is repeated, so that each source code to which the exception line instruction indirectly points can be found according to the source code to which the exception line instruction directly points. Typically, these source codes found are located in different source code files, respectively.
Based on the above, the execution of the abnormal line instruction depends on each found source code, and based on the found source codes, the corresponding second debug information can be generated.
For example, the exception line instruction may be mapped 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, so that 3 pieces of second debugging information may be generated according to the first debugging information, where the 3 pieces of second debugging information respectively point to source code 1, source code 2, and source code 3.
Since the abnormal operation of the abnormal line instruction can be caused by an error in any source code pointed by the abnormal line instruction, the identification information of the source codes can be provided to a developer so that the developer can determine which source code to debug according to needs.
Therefore, based on the above, 3 hyperlinks can be generated, where the 3 hyperlinks respectively contain the 3 second debugging information, and each hyperlink contains one second debugging information. Then, the exception information containing the 3 hyperlinks can be provided to the outside so that the developer can view the respective second debugging information.
And the developer can click any hyperlink to request for debugging the source code pointed by the second debugging information in the hyperlink according to the source code pointed by the second debugging information in each hyperlink.
In the embodiment of the invention, the system of the server can provide the debugging inlet, so that when the application program runs abnormally, a developer only needs to operate a mouse to click a certain debugging inlet, the system can automatically start debugging, and the operation of the developer is simple.
Assuming that the hyperlink pointing to the source code 1 is clicked by the developer, the source code file set used when the application program is run can be loaded according to the second debugging information in the hyperlink. Of course, the source code file in which the source code 1 is located should be included in the source code file set, and then the source code 1 is located, so that a breakpoint can be set at the source code 1.
Since the breakpoint is set, when the application program is re-run, the application program will be interrupted when running to the breakpoint, and an interrupt notification is provided to the outside, so that the developer can check the problem. For example, a developer may check a memory report, a call stack, and the like during the interruption of operation, and may also send a debug instruction as needed, thereby completing the debugging operation of the application program.
In summary, the application program debugging method provided in the embodiment of the present invention can automatically start a debugging process when an application program running at a server is abnormal, so as to implement application program debugging, and is simple in manual operation, thereby basically implementing automatic execution of application program debugging, saving the work of developers, and improving the application program debugging efficiency.
As mentioned above, when source code files based on which the same element is generated at different times are not identical, the generated element products correspond to different versions respectively.
Thus, in one embodiment of the present invention, the article version number of any of the articles comprises: an article identification of the article, a fileset version number of a set of source code files used in running a particular application, wherein the running of the particular application is dependent on the article, different article version numbers comprising different article identification and/or fileset version numbers;
the file version number of any source code file comprises: the file identifier of the source code file and the version identifier of the source code file are different, wherein the file identifiers and/or the version identifiers of different file version numbers are different;
the first debug information includes: the product version number of the first product, and the file identifier 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 building of the artifact Z1 depends on the source code file a and the source code file B, and the building of the artifact Z2 depends on the source code file C and the source code file D.
Referring to Table 1 below, when the initial versions of the respective source code files exist, with corresponding file version numbers 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, the source code file set V1 including the source code file A-1, the source code file B-1, the source code file C-1, and the source code file D-1.
According to the source code file set V1 and the application structure of the application Y1, a product Z1-1 and a product Z2-1 can be constructed, and the application Y1-1 is generated. When the server side runs the application program of the application Y1-1, the application program is realized based on the source code file set V1 and depends on the products Z1-1 and Z2-1.
Taking a source code file B-1 as an example, B-1 is the file version number thereof, B is a file identifier, and a suffix 1 is a version identifier. Taking the product Z1-1 as an example, Z1-1 is the product version number, Z1 is the product identification, and the suffix 1 is the file set version number (corresponding to V1).
Assuming that when the artifact 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 artifact Z1-1, in the first debug information of the artifact Z1-1, the file identifier corresponding to the x th line of instructions is A, and the corresponding line number is 10.
TABLE 1
File set version number 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 a developer only modifies the source code file B and provides the source code file B-2 in one source code modification process, please refer to table 1 above, a source code file set V2 with a file set version number V2 may be generated, and 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.
According to the source code file set V2 and the application structure of the application Y1, the artifact Z1-2 can be constructed. Furthermore, since the source code file C and the source code file D are not modified, it is possible to use the product Z2-1 constructed last time without repeating the construction of the product 2, and record the product Z2-2 as the product Z2-1, thereby generating the application Y1-2. When the server side runs the application program of the application Y1-2, the application program is realized based on the source code file set V2 and depends on the artifacts Z1-2 and Z2-2.
Taking the source code file B-2 as an example, B-2 is the file version number thereof, B is the file identifier, and the suffix 2 is the version identifier. Taking the product Z1-2 as an example, Z1-2 is the product version number, Z1 is the product identification, and the suffix 2 is the file set version number (corresponding to V2).
Based on the above, in an embodiment of the present invention, in order to illustrate a possible implementation manner of generating each second debug information according to first debug information, in step 103, 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 that the first commissioning information includes; 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 operated according to a file set version number in the product version numbers 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 source code file set, wherein the target line source code is directly or indirectly dependent on each destination line source code when running; when the number of the source codes of the destination line is not zero, aiming at each source code of the destination line, executing: determining a destination file identifier 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; and generating second debugging information comprising the product version number of the first product, the destination file identification and the destination line number.
For example, if an exception occurs during the operation of the x-th row of instruction of article Z1-1, the first debug information of article Z1-1 may be obtained, and the file identifier a and row number 10 corresponding to the x-th row of instruction in the first debug information are determined. As such, 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. Thereafter, from Z1-1, a set of source code files V1 used in running the application program of application Y1 may be determined.
Assuming that the execution of the 10 th line of source code for source code file A-1 also depends on the 5 th line of source code for source code file C-1 in source code file set V1, and the execution of the 5 th line of source code for source code file C-1 is not dependent on other source code in source code file set V1, second debug information including Z1-1, C, 5 may be generated.
Thus, two hyperlinks can be generated, one hyperlink can show debugging information to developers: z1-1, A, 10, another hyperlink may show debugging information to the developer: z1-1, C, 5.
Based on the above, in an embodiment of the present invention, in order to illustrate a possible implementation manner of locating a specific line of source code, in step 104, the loading a first set of source code files used when the application program is executed according to second debugging 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 by 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 positioning a specific line source code of a specific source code file in the first source code file set according to the file identifier and the line number in the second debugging information, wherein the file identifier of the specific source code file is the file identifier 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, assume that the developer clicks on the above-described display with debugging information: the hyperlinks of Z1-1, A and 10 can be loaded into a source code file set V1 according to the version number of the file set in Z1-1, and 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 line 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 so forth.
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 an article of manufacture from the source code file and deploy an application 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 a product, providing a service to the outside and the like.
The debugging service can be used for being responsible for starting a debugging process, scheduling application configuration, integration and deployment systems, respectively communicating with an integrated development environment and a running environment, and the like;
the debugging service can be used for running a debugging process and monitoring a target process running the application program;
the version control system can be used for version control of source code files, source code file sets, products, applications and the like;
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, 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 service to the outside. For the application deployed to the running environment, the system records the version number of the product used and records the mapping relation between the product instruction and the source code when the product is generated. According to the version number of the product and the mapping relation, the system can trace and locate the source code corresponding to the abnormal product, and further the debugging of the application program is realized.
Based on the above, in an embodiment of the present invention, please refer to fig. 3, each of the hyperlinks points to a preset debugging function;
the application program for running an application at the server side comprises the following steps: running an application program of an application in a first process of a server;
the re-running the application program at the server includes: re-running the application in the first process;
the method further comprises the following steps: starting the debugging function to run a debugging process, and monitoring the first process which has rerun the application program by using the debugging process;
the externally providing the interrupt notification when the operation is interrupted comprises the following steps: and when the debugging process monitors that the first process is interrupted in operation, utilizing the debugging function to externally provide an interruption notice.
Based on the above, in an embodiment of the present invention, please refer to fig. 3, 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 externally providing the interrupt notification when the operation is interrupted comprises the following steps: providing an interruption notice to the outside through the integrated development environment when the operation is interrupted;
the loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink comprises: according to second debugging information included by the first hyperlink, the version number of a file set of a first source code file set used when the application program is operated is traced back; and starting the integrated development environment to load the first source code file set with the version number of the file set.
In the embodiment of the invention, the server side can send the abnormal information to the client browser and provide the hyperlink, and after a developer clicks, the system of the server side starts an automatic debugging step.
In one embodiment of the present invention, the interrupt notification includes: any one or more of a running position, a call stack and a memory report when the application program is interrupted.
In the embodiment of the invention, a developer can access the integrated development environment through a browser to obtain debugging related information including an operation 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 application program debugging apparatus for executing any one of the above application program debugging methods according to an embodiment of the present invention 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 at a server, where the running of the application program depends on at least one artifact, and the construction of each artifact depends on at least one source code file;
the processing unit 402 is configured to perform the following operations:
if an exception occurs when a target line instruction of a first product is operated, acquiring first debugging information generated when the first product is constructed, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different pieces of second debugging information point to different source codes, and the running of the target line instruction depends on the source code pointed by each piece of second debugging information; generating at least one hyperlink respectively including the at least one second debugging information, and triggering the interaction unit 403 to provide the at least one hyperlink externally; when an external request is made to open 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 a specific line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code; a breakpoint is set at the source code of the specific line, and the running unit 401 is triggered to re-run the application program at the server, so that an interrupt is run when the application program is run to the breakpoint, and the interaction unit 403 is triggered to provide an interrupt notification to the outside when the application program is run.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
Embodiments of the present invention also provide a computer-readable medium storing instructions for causing a computer to perform an application program debugging method as described herein. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying 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 via a communications network.
Further, it should be clear that the functions of any one 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 a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described 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 at a server, 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 one line 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 line 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 source code file set used when the application program is operated and positioning a specific line source code of a specific source code file in the source code file according to second debugging information of a hyperlink requested to be opened from the outside, wherein the second debugging information points to the specific line source code; and setting a breakpoint at the positioning position, and re-running the application program to provide an external interrupt notification when the interrupt is run to the breakpoint. The embodiment of the invention can realize debugging when the application program operated by 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 at the server side is abnormal so as to realize application program debugging, is simple in manual operation, basically realizes automatic execution of application program debugging, saves the work of developers and improves the application program debugging efficiency.
It should be noted that not all steps and modules in the above flows and system structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order 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 a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. The application program debugging method is characterized by comprising the following steps:
running an application program of an application at a server, wherein the running of the application program depends on at least one artifact, and the construction of each artifact depends on at least one source code file;
if an exception occurs when a target line instruction of a first product is operated, acquiring first debugging information generated when the first product is constructed, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different pieces of second debugging information point to different source codes, and the running of the target line instruction depends on the source code pointed by each piece of second debugging 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 is made to open 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 a specific line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code;
and setting a breakpoint at the source code of the specific line, and re-running the application program at the server, so that the application program is interrupted when running to the breakpoint, and providing an interruption notification to the outside when the application program is interrupted.
2. The method of claim 1,
the article version number of any of the articles comprises: an article identification of the article, a fileset version number of a set of source code files used in running a particular application, wherein the running of the particular application is dependent on the article, different article version numbers comprising different article identification and/or fileset version numbers;
the file version number of any source code file comprises: the file identifier of the source code file and the version identifier of the source code file are different, wherein the file identifiers and/or the version identifiers of different file version numbers are different;
the first debug information includes: the product version number of the first product, and the file identifier and the line number corresponding to each line of instructions in the first product.
3. The method of claim 2,
the generating at least one second debug message corresponding to the target line instruction according to the first debug message includes:
determining an article version number of the first article that the first commissioning information includes;
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 operated according to a file set version number in the product version numbers 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 source code file set, wherein the target line source code is directly or indirectly dependent on each destination line source code when running;
when the number of the source codes of the destination line is not zero, aiming at each source code of the destination line, executing: determining a destination file identifier 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; and generating second debugging information comprising the product version number of the first product, the destination file identification and the destination line number.
4. The method of claim 2,
the 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 locating a specific line source code of a specific source code file in the first source code file set, including:
acquiring second debugging information included by 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 positioning a specific line source code of a specific source code file in the first source code file set according to the file identifier and the line number in the second debugging information, wherein the file identifier of the specific source code file is the file identifier in the second debugging information, and the line number of the specific line source code is the line number in the second debugging information.
5. The method of claim 1,
each hyperlink points to a preset debugging function;
the application program for running an application at the server side comprises the following steps: running an application program of an application in a first process of a server;
the re-running the application program at the server includes: re-running the application in the first process;
the method further comprises the following steps: starting the debugging function to run a debugging process, and monitoring the first process which has rerun the application program by using the debugging process;
the externally providing the interrupt notification when the operation is interrupted comprises the following steps: and when the debugging process monitors that the first process is interrupted in operation, utilizing the debugging function to externally provide an interruption notice.
6. The method of claim 1,
the externally providing the at least one hyperlink comprises: providing the at least one hyperlink externally through an integrated development environment running on a Web browser;
the externally providing the interrupt notification when the operation is interrupted comprises the following steps: providing an interruption notice to the outside through the integrated development environment when the operation is interrupted;
the loading a first source code file set used when the application program is run according to second debugging information included in the first hyperlink comprises:
according to second debugging information included by the first hyperlink, the version number of a file set of a first source code file set used when the application program is operated is traced back;
and starting the integrated development environment to load the first source code file set with the version number of the file set.
7. The method according to any one of claims 1 to 6,
the interrupt notification includes: any one or more of a running position, a call stack and a memory report when the application program is interrupted.
8. An application program debugging apparatus for executing the application program debugging method according to any one of claims 1 to 7, comprising:
the system 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 used for executing the following operations:
if an exception occurs when a target line instruction of a first product is operated, acquiring first debugging information generated when the first product is constructed, wherein the first product is any one of the at least one product, and the target line instruction is any line instruction of the first product;
generating at least one piece of second debugging information corresponding to the target line instruction according to the first debugging information, wherein different pieces of second debugging information point to different source codes, and the running of the target line instruction depends on the source code pointed by each piece of second debugging information; generating at least one hyperlink respectively comprising the at least one second debugging information, and triggering the interaction unit to provide the at least one hyperlink externally; when an external request is made to open 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 a specific line source code of a specific source code file in the first source code file set, wherein the second debugging information included in the first hyperlink points to the specific line source code; and setting a breakpoint at the source code of the specific line, and triggering the running unit to rerun the application program at the server, so that when the application program is run to the breakpoint, a break is run, and when the application program is broken, triggering the interaction unit to provide a break notification to the outside.
9. An application program debugging apparatus, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program to perform the method of any of claims 1 to 7.
10. 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 7.
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 true CN111367796A (en) 2020-07-03
CN111367796B 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)

Cited By (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 (7)

* 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
US20160062765A1 (en) * 2014-09-02 2016-03-03 International Business Machines Corporation Identifying semantic differences between source code versions
US20160328308A1 (en) * 2015-05-08 2016-11-10 Intergral GmbH Debugging 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

Patent Citations (7)

* 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
US20160062765A1 (en) * 2014-09-02 2016-03-03 International Business Machines Corporation Identifying semantic differences between source code versions
US20160328308A1 (en) * 2015-05-08 2016-11-10 Intergral GmbH Debugging 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 (2)

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

Cited By (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

Also Published As

Publication number Publication date
CN111367796B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
EP3769223B1 (en) Unified test automation system
US8813037B2 (en) Debugging a high performance computing program
US9740594B2 (en) Automated debug trace specification
US20200250070A1 (en) Techniques for evaluating collected build metrics during a software build process
US9465725B2 (en) Software defect reporting
KR100868762B1 (en) Method of error detecting method for embedded sofeware
US8954930B2 (en) System and method for reducing test effort by object risk analysis
CN106844136B (en) Method and system for collecting program crash information
WO2016177124A1 (en) Method and device for implementing continuous integration test
WO2014120192A1 (en) Error developer association
US10255158B2 (en) Monitoring and diagnostics of business transaction failures
US9983979B1 (en) Optimized dynamic matrixing of software environments for application test and analysis
US10083029B2 (en) Detect application defects by correlating contracts in application dependencies
US9779014B2 (en) Resilient mock object creation for unit testing
CN109558318B (en) Code management method and code warehouse distributed system
US20210089297A1 (en) Automated check for ticket status of merged code
CN115220863A (en) Operation and maintenance method and device for container application, computer equipment and storage medium
US11755458B2 (en) Automatic software behavior identification using execution record
CN111367796B (en) Application program debugging method and device
CN116578282A (en) Code generation method, device, electronic equipment and medium
Ma et al. Analyzing distributed Java applications by automatic centralization
Winzinger et al. Automatic test case generation for serverless applications
CN110275710B (en) Java local interface consistency checking method and system, storage medium and terminal
US20240192974A1 (en) Simulation of one or more pipeline jobs in a software deployment pipeline
CN117742783B (en) Cross-language automatic log data recording method for software system

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