CN115408275A - Debugging analysis method and device, computing equipment and storage medium - Google Patents

Debugging analysis method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN115408275A
CN115408275A CN202211033340.5A CN202211033340A CN115408275A CN 115408275 A CN115408275 A CN 115408275A CN 202211033340 A CN202211033340 A CN 202211033340A CN 115408275 A CN115408275 A CN 115408275A
Authority
CN
China
Prior art keywords
application
crashes
stack
memory mapping
mapping file
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.)
Pending
Application number
CN202211033340.5A
Other languages
Chinese (zh)
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.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202211033340.5A priority Critical patent/CN115408275A/en
Publication of CN115408275A publication Critical patent/CN115408275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a debugging analysis method, a debugging analysis device, a computing device and a storage medium, wherein the method is executed in the computing device and comprises the following steps: responding to an event of application crash when an application is directly operated, and acquiring a first memory mapping file and a second memory mapping file corresponding to the application; playing back and analyzing the running state of the application in a crash based on the first memory mapping file and the second memory mapping file respectively, and generating a first stack list and a second stack list; comparing the first stack list with the second stack list to generate a comparison result; and determining whether the positions of the two crashes are the same or not according to the comparison result, and if so, determining the positions of the two crashes as the positions of the application crashes. According to the technical scheme of the invention, the IDE can be integrated with a debugging function, and the debugging function of application crash in a direct running mode is realized. And, the accuracy of locating the collapsed position is improved.

Description

Debugging analysis method and device, computing equipment and storage medium
Technical Field
The present invention relates to the field of application development technologies, and in particular, to a debugging analysis method, a debugging analysis apparatus, a computing device, and a storage medium.
Background
An Integrated Development Environment (IDE) is an application program for providing a program Development Environment, and generally includes tools such as a code editor, a compiler, a debugger, and a graphical user interface. The integrated development software service set integrates a code compiling function, an analyzing function, a compiling function, a debugging function and the like. All software or software suites (sets) with this feature can be called integrated development environments, such as Microsoft Visual Studio series, borland C + + Builder, delphi series, etc.
At present, the mainstream IDE used in a domestic platform includes a Qt Creator, which provides many functions such as syntax highlighting, compiling and debugging, version management, and the like. The IDE is used as tool software for debugging analysis, and can provide two running modes of direct running and debugging running in application debugging service. The 'debugging operation' means that the operation of the program is controlled by the IDE, a series of operations such as starting, single step execution and stack checking of the program can be realized through the IDE, and a stack list is displayed to check the crash reason when the program crashes. The "direct run" is off the IDE, so that the above operations cannot be performed, and there is no way to locate the problem after the program crashes.
It should be noted that although the debug mode of operation can locate the crash location, in some scenarios (such as multi-thread, random code), the debug mode of operation and the direct mode of operation may produce different results, so the crash problem analysis for the direct mode of operation is also important. Therefore, how to analyze the problem after the program crash in the direct running mode to assist the user in locating the problem position is urgently needed to be solved.
In the prior art, on a Linux platform, after an application crashes, a system stores current running information of the application to a specified position to form coredump files, and a research and development worker can view the coredump files by using a coredump command and finish scene reproduction when the program crashes by combining an adapter (such as gdb), such as view of stack information, register information and the like. However, this method has the following drawbacks: the user needs to be familiar with relevant commands of coredump and debugger commands, and the command using mode is not intuitive enough, so that the usability is low and the interactivity is poor; after the program in the IDE crashes, the crash information can not be seen immediately, and subsequent operations such as coredump searching, analyzing and the like must be executed, so that the instantaneity is poor; program crashes caused by multiple threads often cause different crash stacks, i.e., the same operation causes the program to crash on different codes, while the coredump analysis is only directed to a single crash analysis, lacking joint analysis and comparison; the IDE is tool software for debugging analysis, and the analysis after program crash is realized by means of terminal operation command, which causes the debugging function to be dispersed and not centralized and unified.
In view of the above, a debugging analysis method is needed to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present invention provides a debug analysis method and a debug analysis apparatus, which solve or at least alleviate the above-mentioned problems.
According to an aspect of the invention, there is provided a debug analysis method, adapted to be executed in a computing device, the method comprising: responding to an event that the application crashes when the application is directly operated, and acquiring a first memory mapping file and a second memory mapping file corresponding to the application; playing back and analyzing the running state of the application in a crash based on the first memory mapping file and the second memory mapping file respectively, and generating a first stack list and a second stack list; comparing the first stack list with the second stack list to generate a comparison result; and determining whether the positions of the two crashes are the same or not according to the comparison result, and if so, determining the positions of the two crashes as the positions of the application crashes.
Optionally, according to the debugging analysis method of the present invention, playing back and analyzing the running state of the application when the application crashes includes: calling and executing an analysis command; and acquiring output information of the analysis command, and playing back the running state of the application when the application crashes based on the output information.
Optionally, according to the debugging analysis method of the present invention, after obtaining the output information of the analysis command, the method includes: displaying the output information on a debugging output panel, wherein the debugging output panel comprises an expansion button; playing back the running state of the application when the application crashes based on the output information, wherein the playing back comprises the following steps: and responding to the triggering operation of the expansion button, and playing back the running state when the application crashes based on the output information.
Optionally, according to the debugging analysis method of the present invention, generating the first stack list and the second stack list includes: acquiring first stack frame information of the analysis command based on the first memory mapping file, and generating a first stack list based on the first stack frame information; and acquiring second stack frame information of the analysis command based on the second memory mapping file, and generating a second stack list based on the second stack frame information.
Optionally, according to the debugging analysis method of the present invention, the obtaining a first memory mapping file and a second memory mapping file corresponding to the application includes: acquiring a process identifier of the application; and acquiring a first memory mapping file and a second memory mapping file corresponding to the application based on the process identifier.
Optionally, according to the debugging analysis method of the present invention, obtaining the process identifier of the application includes: acquiring a full path of the application; and acquiring an entry matched with the full path from a memory mapping file information list, and acquiring a process identifier in the entry.
Optionally, according to the debugging analysis method of the present invention, the memory map file includes application running information, and the application running information includes running information of the application in multiple time periods.
Optionally, the debugging analysis method according to the present invention further includes: and the operating system responds to the event that the application crashes when the application is directly operated, acquires the operation information of the application and stores the operation information as a memory mapping file.
According to an aspect of the present invention, there is provided a debug analysis apparatus, residing in a computing device, the apparatus comprising: the obtaining module is suitable for responding to an event that the application crashes when the application is directly operated, and obtaining a first memory mapping file and a second memory mapping file corresponding to the application; the debugging module is suitable for playing back and analyzing the running state of the application in a crash based on the first memory mapping file and the second memory mapping file respectively, and generating a first stack list and a second stack list; the comparison module is suitable for comparing the first stack list with the second stack list to generate a comparison result; and the determining module is suitable for determining whether the positions of the two crashes are the same or not according to the comparison result, and if the positions of the two crashes are the same, determining the positions of the two crashes as the positions of the application crashes.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the debug analysis method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform a debug analysis method as described above.
According to the technical scheme of the invention, a debugging analysis method and a debugging analysis device are provided, wherein after an application is crashed when the application is directly run, the running state of the application in crash is played back and analyzed based on a first memory mapping file and a second memory mapping file respectively by obtaining the first memory mapping file and the second memory mapping file corresponding to the application, and a first stack list and a second stack list are generated. By comparing the first stack list with the second stack list, if the position of the application crash is the same according to the comparison result, the position of the application crash can be determined. Thus, the integrated development application such as the IDE can integrate the debugging function by deploying the debugging analysis device, provide a uniform interface of the debugging function and enable the IDE to realize the debugging function of application breakdown in a direct operation mode. Moreover, by comparing stack information generated before and after the collapse of the application, the random collapse condition can be avoided, and the accuracy of locating the collapse position is improved.
In addition, according to the debugging analysis method and the debugging analysis device, all operations can be realized through an interface, a user does not need to input commands, playback operation can be performed after an expansion button is clicked, and the interactive experience is better.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention;
fig. 2 and fig. 3 respectively show a flow chart of a debugging analysis method 200 according to an embodiment of the present invention;
FIG. 4 shows a schematic diagram of a debug output panel, according to one embodiment of the present invention;
FIG. 5 shows a schematic diagram of a playback interface 500 according to one embodiment of the invention;
fig. 6 shows a schematic diagram of a commissioning analysis apparatus 600 according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention. As shown in FIG. 1, in a basic configuration, computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, the processing unit 102 may be implemented as a processor depending on the configuration and type of computing device. The system memory 104 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories. In accordance with one aspect, an operating system 105 is included in system memory 104.
According to one aspect, the operating system 105 is, for example, adapted to control the operation of the computing device 100. Further, the examples are practiced in conjunction with a graphics library, other operating systems, or any other application program, and are not limited to any particular application or system. This basic configuration is illustrated in fig. 1 by those components within the dashed line. According to one aspect, the computing device 100 has additional features or functionality. For example, according to one aspect, computing device 100 includes additional data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Such additional storage is illustrated in FIG. 1 by removable storage device 109 and non-removable storage device 110.
As stated hereinabove, according to one aspect, program module 103 is stored in system memory 104. According to one aspect, the program modules 103 may include one or more applications, the invention not being limited to the type of application, for example, the applications may include: email and contacts applications, word processing applications, spreadsheet applications, database applications, slide show applications, drawing or computer-aided applications, web browser applications, and the like.
According to one aspect, the program module 103 may include a debug analysis apparatus 600, the debug analysis apparatus 600 being configured to perform the debug analysis method 200 of the present invention.
According to one aspect, examples may be practiced in a circuit comprising discrete electronic elements, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic elements or microprocessors. For example, an example may be practiced via a system on a chip (SOC) in which each or many of the components shown in fig. 1 may be integrated on a single integrated circuit. According to one aspect, such SOC devices may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or "burned") onto a chip substrate as a single integrated circuit. When operating via an SOC, the functionality described herein may be operated via application-specific logic integrated with other components of the computing device 100 on the single integrated circuit (chip). Embodiments of the invention may also be practiced using other technologies capable of performing logical operations (e.g., AND, OR, AND NOT), including but NOT limited to mechanical, optical, fluidic, AND quantum technologies. In addition, embodiments of the invention may be practiced within a general purpose computer or in any other circuits or systems.
According to one aspect, computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, or the like. Output device(s) 114 such as a display, speakers, printer, etc. may also be included. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver and/or transceiver circuitry; universal Serial Bus (USB), parallel, and/or serial ports.
The term computer readable media as used herein includes computer storage media. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, or program modules 103. System memory 104, removable storage 109, and non-removable storage 110 are all examples of computer storage media (i.e., memory storage). Computer storage media may include Random Access Memory (RAM), read Only Memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and that can be accessed by the computer device 100. In accordance with one aspect, any such computer storage media may be part of computing device 100. Computer storage media does not include a carrier wave or other propagated data signal.
In accordance with one aspect, communication media is embodied by computer readable instructions, data structures, program modules 103, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism) and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more feature sets or that has been altered in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio Frequency (RF), infrared, and other wireless media.
In an embodiment in accordance with the invention, computing device 100 is configured to perform a debug analysis method 200 in accordance with the invention. Computing device 100 includes one or more processors, and one or more readable storage media storing program instructions that, when configured to be executed by the one or more processors, cause the computing device to perform debug analysis method 200 in embodiments of the present invention.
According to an embodiment of the present invention, a debugging analysis apparatus 600 resides in the computing device 100, the debugging analysis apparatus 600 being configured to execute the debugging analysis method 200 of the present invention.
Fig. 2 and fig. 3 respectively show a flowchart of a debugging analysis method 200 according to an embodiment of the present invention. The method 200 is suitable for execution in a commissioning analysis apparatus 600 of a computing device (the aforementioned computing device 100).
It should be noted that the debugging analysis apparatus 600 may reside in an integrated development application, for example, may reside in an IDE. In this way, when the integrated development application such as IDE directly runs an application (application to be debugged), the debugging analysis apparatus 600 can perform debugging analysis for an application collapse phenomenon occurring when the application is directly run.
As shown in fig. 2 and 3, method 200 includes steps 210-230.
First, in step 210, when the application is directly run, if the application crashes, the debugging analysis apparatus 600 may obtain the first memory image file and the second memory image file corresponding to the application in response to an event that the application crashes when the application is directly run.
Here, the second memory map file may be a memory map file adjacent to the first memory map file.
In one embodiment, when the application crashes during the direct running of the application, the operating system of the computing device may obtain running information of the application in response to an event that the application crashes when the application is directly run, and store (core dump) the running information of the application as a memory map file. The memory mapping file is a coredump file.
It should be noted that the memory image file (coredump file) includes running information of the application, and the application running information specifically includes running information of the application in multiple time periods.
In one implementation, the memory map file list may be obtained by executing the duplicate list-r command, and the memory map file list may include attribute information of all memory map files (duplicate files). The memory map file (coredump file) may contain various attribute information including, for example, events, process identification (PID values), EXE paths, and the like.
According to an embodiment of the present invention, the first memory map file and the second memory map file corresponding to the application may be obtained by:
first, a process identification (PID value) of an application is acquired. In one implementation, the full path of the application is obtained, and then the full path is compared with the EXE field in the memory map file list, so as to obtain an entry matching the full path from the memory map file information list, and obtain a process identifier (PID value) in the entry. Here, the process identifier in the entry is the process identifier (PID value) of the application, so that the process identifier (PID value) of the application can be acquired.
Next, a first memory map file and a second memory map file corresponding to the application may be obtained based on a process identifier (PID value) of the application. Specifically, the memory map file may be stored in a predetermined directory of the operating system, so that the first memory map file and the second memory map file corresponding to the application may be obtained from the predetermined directory based on the process identifier of the application.
Subsequently, in step 220, the running state of the application in the crash (first crash, second crash) is played back and analyzed based on the first memory image file and the second memory image file, respectively, and a first stack list and a second stack list are generated.
Specifically, based on that the first memory mapping file is used for playing back and analyzing the running state of the application when the application crashes for the first time, a first stack list corresponding to the first memory mapping file is generated correspondingly. The stack information of the first stack list includes crash information related to a first crash of the application.
And based on the fact that the second memory mapping file is used for playing back and analyzing the running state of the application during the second collapse, a second stack list corresponding to the second memory mapping file is correspondingly generated. The stack information of the second stack list includes crash information associated with the second crash of the application.
It should be noted that the same operation may cause the application to crash into different code segments, and different crash points may generate different stack information, which may cause the stack information generated by the application to be different in multiple crashes. Based on this, according to the embodiment of the present invention, when the application is directly run, the running state of the application when the application crashes twice before and after the application is played back and analyzed, and the stack list when the application crashes twice is generated, so that the location of the application crash can be located by combining the stack information (crash information) in the two stack lists, and the cause of the application crash can be determined.
In step 230, a comparison result is generated by comparing the first stack list with the second stack list.
Finally, in step 240, it is determined whether the location of the application crash is the same according to the comparison result, and if the location of the application crash is the same, the location of the application crash can be determined as the location of the application crash.
It should be noted that, by comparing the stack information (crash information) in the first stack list and the second stack list, it can be determined whether the location of the application (the code segment causing the application crash) is the same when the application crashes twice. If the location of the application crashes twice is the same, it indicates that the location (code segment) is the location of the application crash.
According to an embodiment of the present invention, when the running state of the application in a crash is played back and analyzed based on the first memory map file and the second memory map file, the running state of the application in a crash can be played back and analyzed according to the following steps for each memory map file:
first, the analysis command is executed by a process calling the analysis command. Here, the analysis command may be implemented as a coreductctl command, for example. It should be appreciated that the present invention implements the analysis command by way of a process call.
Subsequently, output information (response) of the analysis command is acquired, and the running state at the time of application collapse is played back based on the output information of the analysis command. In one implementation, the debug analysis apparatus 600 includes a debug module. The output information is analyzed and processed, and the analyzed and processed output information is sent to the debugging module based on the type. Through the debugging module, the running state of the application when the application crashes can be played back based on the output information.
In one embodiment, after obtaining the output information of the analysis command, the output information may be displayed on a debug output panel. FIG. 4 shows a schematic diagram of a debug output panel, according to one embodiment of the present invention. The debug output panel displays output information of the analysis command.
Here, as shown in fig. 4, the debug output panel further includes an extension button thereon, and in particular, the extension button may be disposed at the bottom of the debug output panel. The user can request playback of the running state when the application crashes based on the output information by triggering the expansion button. After the user triggers the expansion button, the debugging analysis apparatus 600 may play back the running state when the application crashes based on the output information in response to the user's trigger operation on the expansion button. In one implementation, a user may request playback of the running state of the application when it crashes by clicking an expand button. That is, the user triggers the playback operation after clicking the expand button, so that the original operation logic is not affected.
In one embodiment, for both the first memory image file and the second memory image file, all stack frame information of the analysis command may be obtained, and the corresponding stack list may be generated based on the stack frame information, where the first stack list is generated based on the first memory image file, and the second stack list is generated based on the second memory image file.
Specifically, the first stack list and the second stack list may be generated according to the following method:
based on the first memory image file (that is, when the running state of the application is crashed is played back and analyzed based on the first memory image file), first stack frame information of the analysis command is obtained, and a first stack list is generated based on the first stack frame information.
Based on the second memory mapping file (that is, when the running state of the application in the crash is played back and analyzed based on the second memory mapping file), second stack frame information of the analysis command is obtained, and a second stack list is generated based on the second stack frame information.
In the present invention, the analysis command is executed by means of a process call, so that the call analysis apparatus 600 can acquire all the print information of the analysis command.
In one embodiment, all print information of the analysis command is acquired by executing the backtrace command. The print information includes all stack frame information of the analysis command, and the stack frame information may include information of a stack level, an address, a function, a path of a file where the stack is located, and the like. It is understood that the print information is output information of the backup command. The following shows an example of print information:
(gdb)backtrace
#0 0x00000000012b4860 in xxFunction at xxFile
#1 0x00007fff884d0d65 in xxFunction at xxFile
#2 0x00007fff884cf191 in xxFunction at xxFile
...
after all stack frame information of the analysis command is acquired, the info args command and the info locals command are executed, so that the function parameters and the local variables of the selected stack frame can be acquired, and the values are finally sent to the variable display module of the debugging analysis module. In addition, the register information of the application can be acquired by executing the info args command.
In this embodiment, the debug analysis apparatus 600 may execute the analysis command, start an analysis operation on a memory map file (coredump), and obtain all stack frame information of the analysis command by calling a coredump + debugger + PID command through a process. By sending the stack frame information to the stack list module of the debug analysis device 600, the stack list module may generate a corresponding stack list based on the stack frame information.
Specifically, when the running state of the application is crashed is played back and analyzed based on the first memory map file, the first stack frame information of the analysis command can be acquired by executing the analysis command and starting the analysis operation on the first memory map file, and the corresponding first stack list can be generated by sending the first stack frame information to the stack list module.
When the running state of the application in a crash is played back and analyzed based on the second memory mapping file, the second stack frame information of the analysis command may be acquired by executing the analysis command and starting the analysis operation on the second memory mapping file, and the corresponding second stack list may be generated by sending the second stack frame information to the stack list module.
Further, step 230 may be performed to compare the stack information in the first stack list and the second stack list to determine the location of the application crash. That is, each first stack frame information in the first stack list is compared with the corresponding second stack frame information in the second stack list to determine a difference frame where there is a difference between the first stack list and the second stack list.
Here, since the information such as the address stored in the memory image file coredump collapsed twice is different, only the Function fields of the stack frames may be compared, that is, the Function field of each first stack frame may be compared with the Function field of the corresponding second stack frame.
In one embodiment, the first stack list may be compared to the second stack list by a third party comparison tool (e.g., diff) and a comparison result may be generated. Subsequently, the comparison result may be displayed. Specifically, the comparison result may be displayed on the playback interface.
FIG. 5 shows a schematic diagram of a playback interface 500 according to one embodiment of the invention. As shown in fig. 5, a contrast panel 510 is included in the lower right corner of the playback interface 500, and a contrast result is displayed on the contrast panel 510. The comparison result includes a plurality of difference frames having differences in the first stack list and the second stack list, and the plurality of difference frames of the comparison result may be displayed on the comparison panel 510 of the playback interface in a list form, in other words, a comparison result list may be presented on the comparison panel 510, and the comparison result list includes the plurality of difference frames.
In one embodiment, the difference frame in the contrast list may also implement associated refreshing of information, and update of the interface information may be implemented by obtaining a coredump session (process call) corresponding to the difference frame.
In one embodiment, the contrast panel 510 has a start button 511 for starting the stack list contrast (top left corner). It should be noted that, since it takes much time to compare the stack frame information in the stack list, in the default state, the comparison function for the stack list is in the off state, and when the user needs to compare the stack list, the start button 511 may be triggered to start the comparison between the first stack list and the second stack list.
In addition, in order to save space of the playback interface, the contrast panel 510 has a folding function, and the contrast panel 510 may be folded. In addition, the folding bar of the comparison panel 510 is displayed with a start button 511 and a comparison status indicator light 513. The comparison status indicator light 513 is used to inform the user of the comparison result, for example, red may be used to indicate that the comparison has a difference, and green may be used to indicate that the comparison has no difference. The user can expand the contrast panel only when the contrast state indicator light displays red to check the detailed information of the contrast result, so that the utilization efficiency of the interface space is improved.
Fig. 6 shows a schematic diagram of a debug analysis apparatus 600 according to an embodiment of the present invention. The debugging analysis apparatus 600 resides in a computing device (such as the computing device 100 described above) and is adapted to perform the debugging analysis method 200 of the present invention.
As shown in fig. 6, the debugging analysis apparatus 600 includes an obtaining module 610, a debugging module 620, a comparing module 630, and a determining module 640, which are coupled in sequence.
The obtaining module 610 is adapted to obtain the first memory image file and the second memory image file corresponding to the application in response to the application crash when the application is directly run. The debugging module 620 plays back and analyzes the running state of the application in a crash based on the first memory image file and the second memory image file, and generates a first stack list and a second stack list. The comparing module 630 is adapted to compare the first stack list with the second stack list to generate a comparison result. The determining module 640 is adapted to determine whether the locations of the two crashes applied are the same according to the comparison result, and if so, determine the locations of the two crashes as the locations of the application crashes.
It should be noted that the obtaining module 610 is configured to perform the foregoing step 210, the debugging module 620 is configured to perform the foregoing step 220, the comparing module 630 is configured to perform the foregoing step 230, and the determining module 640 is configured to perform the foregoing step 240. Here, for the specific execution logic of the obtaining module 610, the debugging module 620, the comparing module 630, and the determining module 640, reference is made to the description of the steps 210 to 240 in the method 200, and details are not described here.
It should be noted that the debugging analysis apparatus 600 may reside in an integrated development application, for example, may reside in an IDE. In this way, when the integrated development application such as IDE directly runs an application (an application to be debugged), the debugging analysis apparatus 600 can perform debugging analysis for an application collapse phenomenon occurring when the application is directly run. Therefore, the debugging function can be integrated into integrated development application such as IDE, and a uniform interface of the debugging function is provided.
According to the debugging analysis method and device, after an application is crashed when the application is directly operated, the operation state of the application when the application is crashed is played back and analyzed on the basis of the first memory mapping file and the second memory mapping file by obtaining the first memory mapping file and the second memory mapping file corresponding to the application, and a first stack list and a second stack list are generated. By comparing the first stack list with the second stack list, if the position of the application crashing twice can be determined to be the same according to the comparison result, the position of the application crashing can be determined. In this way, the integrated development application such as IDE can integrate the debugging function by deploying the debugging analysis apparatus 600, and provide a uniform interface of the debugging function, so that the IDE can implement the debugging function for application crash in the direct operation mode. Moreover, by comparing stack information generated before and after the collapse of the application, the random collapse condition can be avoided, and the accuracy of locating the collapse position is improved.
In addition, according to the debugging analysis method and device, all operations can be realized through an interface, a user does not need to input commands, playback operation can be performed after the expansion button is clicked, and the interactive experience is better.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the debug analysis method of the present invention according to instructions in said program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system is apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may additionally be divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the devices in an embodiment may be adaptively changed and arranged in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the means for performing the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense with respect to the scope of the invention, as defined in the appended claims.

Claims (11)

1. A debug analysis method, adapted to be executed in a computing device, the method comprising:
responding to an event that the application crashes when the application is directly operated, and acquiring a first memory mapping file and a second memory mapping file corresponding to the application;
playing back and analyzing the running state of the application when the application crashes respectively based on the first memory mapping file and the second memory mapping file, and generating a first stack list and a second stack list;
comparing the first stack list with the second stack list to generate a comparison result;
and determining whether the positions of the two crashes are the same or not according to the comparison result, and if so, determining the positions of the two crashes as the positions of the application crashes.
2. The method of claim 1, wherein playing back and analyzing the running state of the application when it crashes comprises:
calling and executing an analysis command;
and acquiring output information of the analysis command, and playing back the running state of the application when the application crashes based on the output information.
3. The method of claim 2, wherein after obtaining the output information of the analysis command, comprising:
displaying the output information on a debugging output panel, wherein the debugging output panel comprises an expansion button;
playing back the running state of the application when the application crashes based on the output information, wherein the playing back comprises the following steps:
and responding to the triggering operation of the expansion button, and playing back the running state when the application crashes based on the output information.
4. The method of claim 2 or 3, wherein generating the first stack list, the second stack list comprises:
acquiring first stack frame information of the analysis command based on the first memory mapping file, and generating a first stack list based on the first stack frame information;
and acquiring second stack frame information of the analysis command based on the second memory mapping file, and generating a second stack list based on the second stack frame information.
5. The method of any of claims 1-4, wherein obtaining the first memory image file and the second memory image file corresponding to the application comprises:
acquiring a process identifier of the application;
and acquiring a first memory mapping file and a second memory mapping file corresponding to the application based on the process identifier.
6. The method of claim 5, wherein obtaining the process identification of the application comprises:
acquiring a full path of the application;
and acquiring an entry matched with the full path from a memory mapping file information list, and acquiring a process identifier in the entry.
7. The method of any one of claims 1-6, wherein the memory map file includes application execution information, the application execution information including execution information for the application over a plurality of time periods.
8. The method of any of claims 1-7, further comprising:
and the operating system responds to the event that the application crashes when the application is directly operated, acquires the operation information of the application and stores the operation information as a memory mapping file.
9. A debug analysis apparatus residing in a computing device, the apparatus comprising:
the obtaining module is suitable for responding to an event that the application crashes when the application is directly operated, and obtaining a first memory mapping file and a second memory mapping file corresponding to the application;
the debugging module is suitable for playing back and analyzing the running state of the application in a crash based on the first memory mapping file and the second memory mapping file respectively, and generating a first stack list and a second stack list;
the comparison module is suitable for comparing the first stack list with the second stack list to generate a comparison result;
and the determining module is suitable for determining whether the positions of two crashes applied are the same according to the comparison result, and if so, determining the positions of the two crashes as the positions of the application crashes.
10. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-8.
11. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-8.
CN202211033340.5A 2022-08-26 2022-08-26 Debugging analysis method and device, computing equipment and storage medium Pending CN115408275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211033340.5A CN115408275A (en) 2022-08-26 2022-08-26 Debugging analysis method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211033340.5A CN115408275A (en) 2022-08-26 2022-08-26 Debugging analysis method and device, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115408275A true CN115408275A (en) 2022-11-29

Family

ID=84161357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211033340.5A Pending CN115408275A (en) 2022-08-26 2022-08-26 Debugging analysis method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408275A (en)

Similar Documents

Publication Publication Date Title
US11561887B2 (en) Test script debugging using an automated testing framework and UI rendering tree
US9336123B1 (en) Method and system for automatically establishing a component description format (CDF) debugging environment
US5926638A (en) Program debugging system for debugging a program having graphical user interface
CN108319575B (en) Page component checking method, device, server and storage medium
CN113742119A (en) Call stack backtracking method and device of embedded system and computer equipment
CN109766139B (en) Configuration method and device of configuration file
CN110990274A (en) Data processing method, device and system for generating test case
CN106970870B (en) Webpage test platform, webpage test method and webpage test system
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN115599618B (en) Register dynamic change-allocation verification method and device, storage medium and processor
CN114546823B (en) Method for reproducing debug scenario of logic system design and related equipment
CN115408275A (en) Debugging analysis method and device, computing equipment and storage medium
CN115269285A (en) Test method and device, equipment and computer readable storage medium
CN113778460A (en) Production environment deployment method and device
CN112162743A (en) Driver generation method, device, computer equipment and storage medium
JP2016126700A (en) Program verification device, program verification method, and program verification program
JP2005174045A (en) Source program conversion device, source program conversion method, source program conversion program and program recording medium
CN110968342B (en) Version comparison method, device and system
CN115982018B (en) UI test method, system, computer device and storage medium based on OCR
CN113626332B (en) Debugging method, device, equipment, storage medium and computer program product
CN117215725A (en) Script generation method and device, electronic equipment and storage medium
CN115757346A (en) Data migration method and device, electronic equipment and storage medium
CN117908955A (en) Interface document generation method, device, computing equipment and storage medium
CN117909207A (en) Method and device for debugging cloud service application program interface API and related equipment
CN115237813A (en) Script generation and test method, electronic device and computer storage medium

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