CN106294175A - A kind of program performs behavior method for visualizing and system - Google Patents
A kind of program performs behavior method for visualizing and system Download PDFInfo
- Publication number
- CN106294175A CN106294175A CN201610694677.9A CN201610694677A CN106294175A CN 106294175 A CN106294175 A CN 106294175A CN 201610694677 A CN201610694677 A CN 201610694677A CN 106294175 A CN106294175 A CN 106294175A
- Authority
- CN
- China
- Prior art keywords
- program
- execution
- event
- fault
- information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3636—Debugging of software by tracing the execution of the program
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3644—Debugging of software by instrumenting at runtime
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/366—Debugging of software using diagnostics
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)
- Debugging And Monitoring (AREA)
Abstract
本申请公开了一种程序执行行为可视化方法,包括:利用程序调试器,对程序源代码的执行过程进行监控;若监控到程序源代码在执行过程中发生与预设监控目标对应的执行事件,则在程序源代码上标示出与执行事件对应的代码行;若执行事件为故障类事件,则对栈跟踪信息进行解析,得到相应的故障原因,然后在本地终端屏幕上对栈帧、栈跟踪信息和故障原因进行显示。本申请可以让软件开发人员直观地获知造成故障类事件的原因,而无需软件开发人员采取人工分析源代码的方式来获知故障原因。可见,本申请减少了程序源代码的调试过程中所需的人力。另外,本申请还相应公开了一种程序执行行为可视化系统。
The present application discloses a method for visualizing program execution behavior, including: using a program debugger to monitor the execution process of the program source code; if an execution event corresponding to a preset monitoring target occurs during the execution of the program source code, Then mark the code line corresponding to the execution event on the source code of the program; if the execution event is a fault event, analyze the stack trace information to obtain the corresponding fault cause, and then analyze the stack frame and stack trace information on the local terminal screen The message and the cause of the fault are displayed. The application allows software developers to intuitively know the causes of fault events without the need for software developers to manually analyze source codes to know the causes of faults. It can be seen that the present application reduces the manpower required in the debugging process of the program source code. In addition, the present application also correspondingly discloses a program execution behavior visualization system.
Description
技术领域technical field
本发明涉及程序代码监管技术领域,特别涉及一种程序执行行为可视化方法及系统。The invention relates to the technical field of program code monitoring, in particular to a method and system for visualizing program execution behavior.
背景技术Background technique
当前,随着计算机技术的快速发展,人们能够享受到越来越多应用软件所带来的便捷服务,人们的衣食住行越来越离不开各种各样应用软件所提供的服务。At present, with the rapid development of computer technology, people can enjoy more and more convenient services brought by application software, and people's basic necessities of life are increasingly inseparable from the services provided by various application software.
软件开发人员在开发应用软件时,需要对相应程序源代码的执行过程进行频繁地调试,只有在确保程序源代码具有足够的可靠性的基础上,企业才会将相应的应用软件投入市场。When software developers develop application software, they need to frequently debug the execution process of the corresponding program source code. Only after ensuring that the program source code has sufficient reliability, the enterprise will put the corresponding application software into the market.
然而,在对程序源代码的执行过程进行调试时,如果发生故障类事件,软件开发人员无法直观地获知造成故障类事件的原因,需要软件开发人员通过对相关代码行进行人工分析,方可确定相应的故障类型。对于动辄就具有十几万行代码的应用软件来说,上述的调试过程无疑需要耗费大量的人力。However, when debugging the execution process of the program source code, if a fault event occurs, the software developer cannot intuitively know the cause of the fault event, and the software developer needs to manually analyze the relevant code lines to determine corresponding fault type. For application software with more than 100,000 lines of codes at every turn, the above-mentioned debugging process undoubtedly requires a lot of manpower.
综上所述可以看出,如何减少程序源代码的调试过程中所需的人力是目前有待解决的问题。From the above, it can be seen that how to reduce the manpower required in the debugging process of the program source code is a problem to be solved at present.
发明内容Contents of the invention
有鉴于此,本发明的目的在于提供一种程序执行行为可视化方法及系统,减少了程序源代码的调试过程中所需的人力。其具体方案如下:In view of this, the object of the present invention is to provide a method and system for visualizing program execution behavior, which reduces the manpower required in the debugging process of program source codes. The specific plan is as follows:
一种程序执行行为可视化方法,包括:A method for visualizing program execution behavior, comprising:
利用程序调试器,对程序源代码的执行过程进行监控;Use the program debugger to monitor the execution process of the program source code;
若监控到所述程序源代码在执行过程中发生与预设监控目标对应的执行事件,则暂停所述程序源代码的执行过程,并在所述程序源代码上标示出与所述执行事件对应的代码行;其中,所述预设监控目标为预先在所述程序调试器上设定的监控目标;If it is monitored that an execution event corresponding to a preset monitoring target occurs during the execution of the program source code, the execution process of the program source code is suspended, and a mark corresponding to the execution event is marked on the program source code line of code; wherein, the preset monitoring target is a monitoring target set in advance on the program debugger;
若所述执行事件为故障类事件,则利用所述程序调试器获取与所述执行事件对应的栈帧和栈跟踪信息,并对所述栈跟踪信息进行解析,得到相应的故障原因,然后在本地终端屏幕上对所述栈帧、所述栈跟踪信息和所述故障原因进行显示。If the execution event is a fault event, then use the program debugger to obtain the stack frame and stack trace information corresponding to the execution event, and analyze the stack trace information to obtain the corresponding fault cause, and then The stack frame, the stack trace information, and the cause of the failure are displayed on the screen of the local terminal.
优选的,所述程序调试器为GDB调试器。Preferably, the program debugger is a GDB debugger.
优选的,所述预设监控目标为栈溢出事件、程序中断事件或内存访问错误事件。Preferably, the preset monitoring target is a stack overflow event, a program interruption event or a memory access error event.
优选的,所述程序中断事件为由行断点、函数断点、条件断点或事件断点引起的中断事件。Preferably, the program interruption event is an interruption event caused by a line breakpoint, a function breakpoint, a conditional breakpoint or an event breakpoint.
优选的,对所述栈跟踪信息进行解析,得到相应的故障原因的过程之后,还包括:Preferably, after the process of parsing the stack trace information to obtain the corresponding fault cause, it also includes:
根据所述故障原因,确定所述执行事件对应的故障严重等级;determining a fault severity level corresponding to the execution event according to the fault cause;
若所述故障严重等级大于预设等级,则将所述栈帧、所述栈跟踪信息和所述故障原因发送至预先指定的目标设备终端。If the fault severity level is greater than a preset level, the stack frame, the stack trace information and the fault cause are sent to a pre-designated target device terminal.
优选的,所述将所述栈帧、所述栈跟踪信息和所述故障原因发送至预先指定的目标设备终端的过程,包括:Preferably, the process of sending the stack frame, the stack trace information and the failure cause to a pre-specified target device terminal includes:
对所述本地终端屏幕上显示所述栈帧、所述栈跟踪信息和所述故障原因的显示区域进行截屏,得到相应的截屏画面信息;Taking a screenshot of the display area displaying the stack frame, the stack trace information and the cause of the failure on the local terminal screen to obtain corresponding screenshot information;
将所述截屏画面信息发送至所述目标设备终端。Send the screenshot information to the target device terminal.
优选的,所述方法,还包括:Preferably, the method also includes:
获取所述目标设备终端在接收到所述栈帧、所述栈跟踪信息和所述故障原因后反馈的信息,并在所述本地终端屏幕上对所述反馈的信息进行实时显示。Acquiring information fed back by the target device terminal after receiving the stack frame, the stack trace information, and the cause of the failure, and displaying the fed back information in real time on the screen of the local terminal.
本发明还公开了一种程序执行行为可视化系统,包括:The invention also discloses a program execution behavior visualization system, including:
执行过程监控模块,用于利用程序调试器,对程序源代码的执行过程进行监控;The execution process monitoring module is used to monitor the execution process of the program source code by using the program debugger;
执行过程暂停模块,用于当监控到所述程序源代码在执行过程中发生与预设监控目标对应的执行事件,则暂停所述程序源代码的执行过程;其中,所述预设监控目标为预先在所述程序调试器上设定的监控目标;The execution process suspending module is used to suspend the execution process of the program source code when it is monitored that an execution event corresponding to a preset monitoring target occurs during the execution of the program source code; wherein, the preset monitoring target is A monitoring target pre-set on the program debugger;
代码标示模块,用于在所述程序源代码上标示出与所述执行事件对应的代码行;a code marking module, configured to mark the code line corresponding to the execution event on the program source code;
信息获取模块,用于当所述执行事件为故障类事件,则利用所述程序调试器获取与所述执行事件对应的栈帧和栈跟踪信息;An information acquisition module, configured to use the program debugger to obtain stack frames and stack trace information corresponding to the execution event when the execution event is a fault event;
信息解析模块,用于对所述栈跟踪信息进行解析,得到相应的故障原因;An information parsing module, configured to parse the stack trace information to obtain corresponding fault causes;
信息显示模块,用于在本地终端屏幕上对所述栈帧、所述栈跟踪信息和所述故障原因进行显示。The information display module is used to display the stack frame, the stack trace information and the fault cause on the local terminal screen.
优选的,所述系统,还包括:Preferably, the system also includes:
故障严重等级确定模块,用于在所述信息解析模块得到所述故障原因后,根据所述故障原因,确定所述执行事件对应的故障严重等级;A fault severity level determination module, configured to determine the fault severity level corresponding to the execution event according to the fault cause after the information analysis module obtains the fault cause;
信息发送模块,用于当所述故障严重等级大于预设等级,则将所述栈帧、所述栈跟踪信息和所述故障原因发送至预先指定的目标设备终端。An information sending module, configured to send the stack frame, the stack trace information, and the cause of the fault to a pre-designated target device terminal when the fault severity level is greater than a preset level.
优选的,所述信息发送模块包括:Preferably, the information sending module includes:
截屏单元,用于对所述本地终端屏幕上显示所述栈帧、所述栈跟踪信息和所述故障原因的显示区域进行截屏,得到相应的截屏画面信息;A screenshot unit, configured to take a screenshot of the display area displaying the stack frame, the stack trace information, and the cause of the failure on the local terminal screen, to obtain corresponding screenshot information;
信息发送单元,用于将所述截屏画面信息发送至所述目标设备终端。An information sending unit, configured to send the screenshot information to the target device terminal.
本发明中,程序执行行为可视化方法,包括:利用程序调试器,对程序源代码的执行过程进行监控;若监控到程序源代码在执行过程中发生与预设监控目标对应的执行事件,则暂停程序源代码的执行过程,并在程序源代码上标示出与执行事件对应的代码行;其中,预设监控目标为预先在程序调试器上设定的监控目标;若执行事件为故障类事件,则利用程序调试器获取与执行事件对应的栈帧和栈跟踪信息,并对栈跟踪信息进行解析,得到相应的故障原因,然后在本地终端屏幕上对栈帧、栈跟踪信息和故障原因进行显示。可见,本发明中,在监控到程序源代码在执行过程中发生特定的执行事件,则会标识出与该执行事件对应的代码行,并且,当上述特定的执行事件为故障类事件时,会对栈跟踪信息进行解析,从而得到相应的故障原因,最后还会在本地终端屏幕上对上述故障类事件所对应的栈帧、栈跟踪信息以及故障原因进行显示,从而可以让软件开发人员直观地获知造成故障类事件的原因,而无需软件开发人员采取人工分析源代码的方式来获知故障原因。可见,本发明减少了程序源代码的调试过程中所需的人力。In the present invention, the program execution behavior visualization method includes: using a program debugger to monitor the execution process of the program source code; if it is monitored that an execution event corresponding to a preset monitoring target occurs during the execution of the program source code, then suspend The execution process of the program source code, and mark the code line corresponding to the execution event on the program source code; where the preset monitoring target is the monitoring target set in advance on the program debugger; if the execution event is a fault event, Use the program debugger to obtain the stack frame and stack trace information corresponding to the execution event, and analyze the stack trace information to obtain the corresponding fault cause, and then display the stack frame, stack trace information, and fault cause on the local terminal screen . It can be seen that in the present invention, when a specific execution event occurs during the execution of the program source code, the code line corresponding to the execution event will be identified, and when the above-mentioned specific execution event is a fault event, the code line will be identified. Analyze the stack trace information to obtain the corresponding fault cause, and finally display the stack frame, stack trace information, and fault cause corresponding to the above fault events on the local terminal screen, so that software developers can intuitively Know the cause of failure-like events without requiring software developers to manually analyze the source code to learn the cause of the failure. It can be seen that the present invention reduces the manpower required in the debugging process of the program source code.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本发明实施例公开的一种程序执行行为可视化方法流程图;FIG. 1 is a flow chart of a method for visualizing program execution behavior disclosed in an embodiment of the present invention;
图2为本发明实施例公开的一种程序执行行为可视化系统结构示意图。FIG. 2 is a schematic structural diagram of a program execution behavior visualization system disclosed in an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明实施例公开了一种程序执行行为可视化方法,参见图1所示,该方法包括:The embodiment of the present invention discloses a method for visualizing program execution behavior, as shown in FIG. 1 , the method includes:
步骤S11:利用程序调试器,对程序源代码的执行过程进行监控。Step S11: Using a program debugger to monitor the execution process of the program source code.
可以理解的是,本实施例中的程序调试器可以是现有技术中已有的程序调试器,例如,本实施例中的程序调试器可以采用由GUN开源组织发布的GDB调试器。当然,本实施例中的程序调试器也可以是新开发的程序调试器。It can be understood that the program debugger in this embodiment may be an existing program debugger in the prior art. For example, the program debugger in this embodiment may use the GDB debugger released by the GUN open source organization. Of course, the program debugger in this embodiment may also be a newly developed program debugger.
另外,本实施例中,程序源代码的执行过程是指在对程序源代码进行调试时程序源代码的运行过程。In addition, in this embodiment, the execution process of the program source code refers to the running process of the program source code when the program source code is debugged.
步骤S12:若监控到程序源代码在执行过程中发生与预设监控目标对应的执行事件,则暂停程序源代码的执行过程,并在程序源代码上标示出与执行事件对应的代码行;其中,预设监控目标为预先在程序调试器上设定的监控目标。Step S12: If it is monitored that an execution event corresponding to a preset monitoring target occurs during the execution of the program source code, then suspend the execution process of the program source code, and mark the code line corresponding to the execution event on the program source code; , the preset monitoring target is the monitoring target set in advance on the program debugger.
可以理解的是,上述预设监控目标可以为故障类事件,当然,也可以是人为特意需要关注的非故障类事件。It can be understood that the above-mentioned preset monitoring target may be a fault event, and of course, it may also be a non-fault event that needs attention.
步骤S13:若上述执行事件为故障类事件,则利用程序调试器获取与执行事件对应的栈帧和栈跟踪信息,并对栈跟踪信息进行解析,得到相应的故障原因,然后在本地终端屏幕上对栈帧、栈跟踪信息和故障原因进行显示。Step S13: If the above-mentioned execution event is a fault event, use the program debugger to obtain the stack frame and stack trace information corresponding to the execution event, and analyze the stack trace information to obtain the corresponding fault cause, and then display the error on the local terminal screen Display stack frames, stack trace information, and fault causes.
本实施例在与上述预设监控目标对应的执行事件为故障类事件的情况下,会利用程序调试器获取相应的栈帧和栈跟踪信息,然后通过对栈跟踪信息进行解析,以得到相应的故障原因。In this embodiment, when the execution event corresponding to the above preset monitoring target is a fault event, the program debugger will be used to obtain the corresponding stack frame and stack trace information, and then the stack trace information will be parsed to obtain the corresponding cause of issue.
可见,本发明实施例中,在监控到程序源代码在执行过程中发生特定的执行事件,则会标识出与该执行事件对应的代码行,并且,当上述特定的执行事件为故障类事件时,会对栈跟踪信息进行解析,从而得到相应的故障原因,最后还会在本地终端屏幕上对上述故障类事件所对应的栈帧、栈跟踪信息以及故障原因进行显示,从而可以让软件开发人员直观地获知造成故障类事件的原因,而无需软件开发人员采取人工分析源代码的方式来获知故障原因。可见,本发明实施例减少了程序源代码的调试过程中所需的人力。It can be seen that in the embodiment of the present invention, when a specific execution event occurs during the execution of the program source code, the code line corresponding to the execution event will be identified, and when the above-mentioned specific execution event is a fault event , the stack trace information will be analyzed to obtain the corresponding fault cause, and finally the stack frame, stack trace information and fault cause corresponding to the above fault events will be displayed on the local terminal screen, so that software developers can Intuitively learn the cause of failure events without requiring software developers to manually analyze the source code to learn the cause of the failure. It can be seen that the embodiment of the present invention reduces the manpower required in the debugging process of the program source code.
本发明实施例公开了一种具体的程序执行行为可视化方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:The embodiment of the present invention discloses a specific method for visualizing program execution behavior. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. specific:
上一实施例中的预设监控目标具体可以为栈溢出事件、程序中断事件或内存访问错误事件。The preset monitoring target in the previous embodiment may specifically be a stack overflow event, a program interruption event or a memory access error event.
其中,上述程序中断事件为由行断点、函数断点、条件断点或事件断点引起的中断事件。可以理解的是,上述行断点是指在程序源代码执行到指定行时便暂停执行程序的断点,上述函数断点是指在程序源代码执行到指定函数对应的第一行代码时便暂停执行程序的断点,上述条件断点是指在程序源代码执行过程中如果特定条件为真则暂停执行程序的断点,上述时间断点是指在程序源代码执行过程中如果发生特定事件则暂停执行代码的断点。Wherein, the above-mentioned program interruption event is an interruption event caused by a line breakpoint, a function breakpoint, a conditional breakpoint or an event breakpoint. It can be understood that the above-mentioned line breakpoint refers to a breakpoint that suspends the execution of the program when the program source code executes to a specified line, and the above-mentioned function breakpoint refers to a breakpoint that stops when the program source code executes to the first line of code corresponding to the specified function. The breakpoint that suspends the execution of the program. The above-mentioned conditional breakpoint refers to the breakpoint that suspends the execution of the program if a specific condition is true during the execution of the program source code. The above-mentioned time breakpoint refers to that if a specific event occurs during the execution of the program source code. A breakpoint that suspends execution of code.
上一实施例步骤S13中,在与上述预设监控目标对应的执行事件为故障类事件的情况下,会对栈跟踪信息进行解析,得到相应的故障原因。其中,在对栈跟踪信息进行解析,得到相应的故障原因的过程之后,还包括:In step S13 of the previous embodiment, if the execution event corresponding to the aforementioned preset monitoring target is a fault event, the stack trace information is analyzed to obtain the corresponding fault cause. Among them, after analyzing the stack trace information to obtain the corresponding fault cause, it also includes:
根据故障原因,确定上述执行事件对应的故障严重等级,若该故障严重等级大于预设等级,则将栈帧、栈跟踪信息和故障原因发送至预先指定的目标设备终端。According to the cause of the failure, determine the failure severity level corresponding to the above execution event, and if the failure severity level is greater than the preset level, send the stack frame, stack trace information and failure cause to the pre-designated target device terminal.
也即,当上述执行事件对应的故障程度较高时,会将相应的栈帧、栈跟踪信息以及故障原因发送至预先指定的目标设备终端上,这样有利于汇集其他软件开发人员的智慧来共同解决上述故障类事件。可以理解的是,上述目标设备终端可以是个人计算机,也可以智能移动终端等。That is to say, when the fault level corresponding to the above-mentioned execution event is high, the corresponding stack frame, stack trace information and fault cause will be sent to the pre-designated target device terminal, which is beneficial to pool the wisdom of other software developers to jointly Solve the above fault events. It can be understood that the above-mentioned target device terminal may be a personal computer, or may be an intelligent mobile terminal or the like.
更具体的,上述将栈帧、栈跟踪信息和故障原因发送至预先指定的目标设备终端的过程,可以包括:More specifically, the above-mentioned process of sending the stack frame, stack trace information and fault cause to the pre-specified target device terminal may include:
对本地终端屏幕上显示栈帧、栈跟踪信息和故障原因的显示区域进行截屏,得到相应的截屏画面信息,然后将截屏画面信息发送至目标设备终端。Take a screenshot of the display area displaying the stack frame, stack trace information and fault cause on the local terminal screen to obtain the corresponding screenshot information, and then send the screenshot information to the target device terminal.
也即,本实施例可以通过截屏的方式将上述栈帧、栈跟踪信息和故障原因发送至目标设备终端。That is to say, in this embodiment, the above stack frame, stack trace information, and fault cause may be sent to the target device terminal by way of screenshot.
进一步的,本实施例中的方法,还可以包括:获取目标设备终端在接收到栈帧、栈跟踪信息和故障原因后反馈的信息,并在本地终端屏幕上对反馈的信息进行实时显示。Further, the method in this embodiment may also include: acquiring the information fed back by the target device terminal after receiving the stack frame, stack trace information and fault cause, and displaying the fed back information on the local terminal screen in real time.
相应的,本发明实施例还公开了一种程序执行行为可视化系统,参见图2所示,该系统包括:Correspondingly, the embodiment of the present invention also discloses a program execution behavior visualization system, as shown in Figure 2, the system includes:
执行过程监控模块21,用于利用程序调试器,对程序源代码的执行过程进行监控;The execution process monitoring module 21 is used to monitor the execution process of the program source code by using a program debugger;
执行过程暂停模块22,用于当监控到程序源代码在执行过程中发生与预设监控目标对应的执行事件,则暂停程序源代码的执行过程;其中,预设监控目标为预先在程序调试器上设定的监控目标;Execution process suspends module 22, is used for when the execution event corresponding to preset monitor target occurs during monitoring program source code, then suspends the execution process of program source code; Wherein, preset monitor target is in advance Monitoring objectives set on the above;
代码标示模块23,用于在程序源代码上标示出与执行事件对应的代码行;The code marking module 23 is used to mark the code line corresponding to the execution event on the program source code;
信息获取模块24,用于当上述执行事件为故障类事件,则利用程序调试器获取与执行事件对应的栈帧和栈跟踪信息;The information acquisition module 24 is used to obtain the stack frame and stack trace information corresponding to the execution event by using a program debugger when the above-mentioned execution event is a fault event;
信息解析模块25,用于对栈跟踪信息进行解析,得到相应的故障原因;The information analysis module 25 is used to analyze the stack trace information to obtain the corresponding fault cause;
信息显示模块26,用于在本地终端屏幕上对栈帧、栈跟踪信息和故障原因进行显示。The information display module 26 is configured to display stack frames, stack trace information and failure reasons on the local terminal screen.
其中,关于上述各个模块更加详细的工作过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。For more detailed working processes of the above-mentioned modules, reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
可见,本发明实施例中,在监控到程序源代码在执行过程中发生特定的执行事件,则会标识出与该执行事件对应的代码行,并且,当上述特定的执行事件为故障类事件时,会对栈跟踪信息进行解析,从而得到相应的故障原因,最后还会在本地终端屏幕上对上述故障类事件所对应的栈帧、栈跟踪信息以及故障原因进行显示,从而可以让软件开发人员直观地获知造成故障类事件的原因,而无需软件开发人员采取人工分析源代码的方式来获知故障原因。可见,本发明实施例减少了程序源代码的调试过程中所需的人力。It can be seen that in the embodiment of the present invention, when a specific execution event occurs during the execution of the program source code, the code line corresponding to the execution event will be identified, and when the above-mentioned specific execution event is a fault event , the stack trace information will be analyzed to obtain the corresponding fault cause, and finally the stack frame, stack trace information and fault cause corresponding to the above fault events will be displayed on the local terminal screen, so that software developers can Intuitively learn the cause of failure events without requiring software developers to manually analyze the source code to learn the cause of the failure. It can be seen that the embodiment of the present invention reduces the manpower required in the debugging process of the program source code.
进一步的,本实施例中的系统,还可以包括故障严重等级确定模块和信息发送模块;其中,Further, the system in this embodiment may also include a fault severity determination module and an information sending module; wherein,
故障严重等级确定模块,用于在信息解析模块得到故障原因后,根据故障原因,确定执行事件对应的故障严重等级;The fault severity determination module is used to determine the fault severity level corresponding to the execution event according to the fault cause after the information analysis module obtains the fault cause;
信息发送模块,用于当故障严重等级大于预设等级,则将栈帧、栈跟踪信息和故障原因发送至预先指定的目标设备终端。The information sending module is used to send the stack frame, stack trace information and fault reason to a pre-designated target device terminal when the fault severity level is greater than the preset level.
其中,上述信息发送模块可以包括截屏单元和信息发送单元;其中,Wherein, the above-mentioned information sending module may include a screenshot unit and an information sending unit; wherein,
截屏单元,用于对本地终端屏幕上显示栈帧、栈跟踪信息和故障原因的显示区域进行截屏,得到相应的截屏画面信息;A screen capture unit, configured to capture a screen of a display area displaying stack frames, stack trace information and failure causes on the local terminal screen, to obtain corresponding screen capture information;
信息发送单元,用于将截屏画面信息发送至目标设备终端。The information sending unit is used for sending the screenshot information to the target device terminal.
最后,还需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements not only includes those elements, but also other elements not expressly listed, or elements inherent in the process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上对本发明所提供的一种程序执行行为可视化方法及系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and system for visualizing program execution behavior provided by the present invention are described above in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the present invention. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood as Limitations on the Invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610694677.9A CN106294175A (en) | 2016-08-19 | 2016-08-19 | A kind of program performs behavior method for visualizing and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610694677.9A CN106294175A (en) | 2016-08-19 | 2016-08-19 | A kind of program performs behavior method for visualizing and system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106294175A true CN106294175A (en) | 2017-01-04 |
Family
ID=57661824
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610694677.9A Pending CN106294175A (en) | 2016-08-19 | 2016-08-19 | A kind of program performs behavior method for visualizing and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106294175A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021139469A1 (en) * | 2020-08-07 | 2021-07-15 | 平安科技(深圳)有限公司 | Gdb-based opencv program visualization method and apparatus, and device and storage medium |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6219782B1 (en) * | 1997-04-29 | 2001-04-17 | Microsoft Corporation | Multiple user software debugging system |
| US20020095660A1 (en) * | 1998-03-02 | 2002-07-18 | O'brien Stephen Caine | Method and apparatus for analyzing software in a language-independent manner |
| CN101261603A (en) * | 2008-04-09 | 2008-09-10 | 中兴通讯股份有限公司 | Method and device for fault location |
| CN101739333A (en) * | 2008-11-25 | 2010-06-16 | 国际商业机器公司 | Method, tool and device for debugging application program |
| CN102053906A (en) * | 2009-10-30 | 2011-05-11 | 国际商业机器公司 | System and method for collecting program runtime information |
| CN102214137A (en) * | 2010-04-06 | 2011-10-12 | 华为技术有限公司 | Debugging method and debugging equipment |
| CN102262584A (en) * | 2010-05-24 | 2011-11-30 | 北大方正集团有限公司 | Method and device for checking program operation error |
| CN102902620A (en) * | 2011-12-23 | 2013-01-30 | 同济大学 | GDB (genome database) based heterogeneous computing and debugging environment realizing system |
| CN105302732A (en) * | 2015-12-10 | 2016-02-03 | 广东欧珀移动通信有限公司 | Automatic mobile terminal testing method and device |
-
2016
- 2016-08-19 CN CN201610694677.9A patent/CN106294175A/en active Pending
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6219782B1 (en) * | 1997-04-29 | 2001-04-17 | Microsoft Corporation | Multiple user software debugging system |
| US20020095660A1 (en) * | 1998-03-02 | 2002-07-18 | O'brien Stephen Caine | Method and apparatus for analyzing software in a language-independent manner |
| CN101261603A (en) * | 2008-04-09 | 2008-09-10 | 中兴通讯股份有限公司 | Method and device for fault location |
| CN101739333A (en) * | 2008-11-25 | 2010-06-16 | 国际商业机器公司 | Method, tool and device for debugging application program |
| CN102053906A (en) * | 2009-10-30 | 2011-05-11 | 国际商业机器公司 | System and method for collecting program runtime information |
| CN102214137A (en) * | 2010-04-06 | 2011-10-12 | 华为技术有限公司 | Debugging method and debugging equipment |
| CN102262584A (en) * | 2010-05-24 | 2011-11-30 | 北大方正集团有限公司 | Method and device for checking program operation error |
| CN102902620A (en) * | 2011-12-23 | 2013-01-30 | 同济大学 | GDB (genome database) based heterogeneous computing and debugging environment realizing system |
| CN105302732A (en) * | 2015-12-10 | 2016-02-03 | 广东欧珀移动通信有限公司 | Automatic mobile terminal testing method and device |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021139469A1 (en) * | 2020-08-07 | 2021-07-15 | 平安科技(深圳)有限公司 | Gdb-based opencv program visualization method and apparatus, and device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10606731B2 (en) | Code component debugging in an application program | |
| US8448142B2 (en) | Incremental runtime compliance validation of renderable objects | |
| US10013332B2 (en) | Monitoring mobile application performance | |
| CN104123219B (en) | Method and device for testing software | |
| US9244815B2 (en) | Integrated debugger and code coverage tool | |
| CN109388537B (en) | Operation information tracking method and device and computer readable storage medium | |
| CN102053906A (en) | System and method for collecting program runtime information | |
| CN105745626A (en) | Diagnostic production application based on process snapshot | |
| CN1959653A (en) | Apparatus and method for debugging computer program | |
| US10528456B2 (en) | Determining idle testing periods | |
| US9361206B2 (en) | Code coverage framework | |
| CN111506470A (en) | Browser error detection and alarm method, device, equipment and storage medium | |
| CN110688173B (en) | Positioning method and device of components in cross-platform interface framework and electronic equipment | |
| CN104426945A (en) | Method and system for acquiring application performance data, and device | |
| TW201413443A (en) | System and method for displaying test status and marking abnormalities | |
| WO2021056913A1 (en) | Fault locating method, apparatus and system based on i2c communication | |
| CN106294132B (en) | A kind of method and device managing log | |
| CN106294175A (en) | A kind of program performs behavior method for visualizing and system | |
| WO2021139469A1 (en) | Gdb-based opencv program visualization method and apparatus, and device and storage medium | |
| CN112740187B (en) | Methods and systems for debugging programs | |
| CN116909904A (en) | Software function automatic test method based on high-flow high-concurrency condition | |
| CN112925700A (en) | Program debugging method, device and system and embedded equipment | |
| CN114706744A (en) | Method for calling out debugging tool in production environment | |
| CN119440997A (en) | Method, device, equipment, medium and product for debugging embedded frame pages | |
| CN114116468A (en) | Application testing method and device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170104 |
|
| RJ01 | Rejection of invention patent application after publication |