Existing kernel debugger systems debug an operating system or application program executing on a target device connected to a host device. In some systems, as exceptions occur, a developer is prompted on the host device to manually break into a debug session or continue execution. Further, developers have limited ability to automate the exception filtering (e.g., ignore or only break on specific exceptions). For example, in existing systems, the developer can only specify to ignore or allow exceptions of a certain type or exception code, or to ignore exceptions from certain processes.
When the developer is debugging in a kernel debugger, however, the developer typically wants to ignore or allow exceptions matching specific scenarios. Additionally, the limited exception filtering in existing systems fails if the operating system being debugged uses processes to host code from other parties. Further, existing solutions perform the filtering logic on the host device, which causes the operating system real-time scheduling to halt while the host device is notified of the exception.
Embodiments of the invention provide selective exception filtering based on rules stored on a target computing device coupled to a host computing device. One or more rules are defined to have one or more criteria and a break decision. The target computing device executes instructions, and receives notification of an exception resulting from the execution. The rules are evaluated to select one of the rules with criteria met by information about the exception, without notifying the host computing device. The break decision associated with the selected rule (e.g., continue execution, or break and notify the host computing device) is applied.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
Corresponding reference characters indicate corresponding parts throughout the drawings.
Referring to the figures, embodiments of the invention provide exception filtering based on rules 206 describing scenarios of interest to a developer. In some embodiments, the developer or other user 106 interacts with a host computing device 104 to debug instructions executing on a target computing device 102. A kernel debugger, or other debugger, also executes on the target computing device 102 and communicates with a debugger executing on the host computing device 104. In some embodiments (not shown), a network communicatively couples the target computing device 102 and the host computing device 104. The kernel debugger executing on the target computing device 102 evaluates the rules 206 entirely on the target computing device 102 side (e.g., without invoking the host computing device 104). This enables the filtering of exceptions deemed non-important by the user 106. Further, processing the rules 206 on the target computing device 102 reduces the interruption time caused by exceptions that the user 106 deems not important. Aspects of the invention are applicable to debugging real-time operating systems, among other instructions.
In some embodiments, the target computing device 102 is a mobile telephone and the host computing device 104 is a personal computer. However, while some embodiments of the invention are applicable to the mobile telephone, aspects of the invention are operable with other computing devices. For example, the target computing device 102 and/or the host computing device 104 include, but are not limited to, personal computers, server computers, digital cameras, portable music players, gaming consoles, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network computers, minicomputers, mainframe computers, and distributed computing environments that include any of the above systems or devices, and the like.
Referring next to
If one of the rules 206 has most of the fields completed, this rule 206 describes a very specific exception scenario. If one of the rules 206 has few of the fields completed, this rule 206 describes a general exception scenario. In an example scenario, the user 106 wants to break as follows: “do not break on handled exceptions unless the exception is a stack overflow caused by myapp.exe or the exception was generated while inside mymodule.dll.” This example scenario maps to the following rules: 1. Do not break on any handled exceptions; 2. Break if the exception is a stack overflow in myapp.exe; and 3. Break if the exception was generated from mymodule.dll. The first rule is generic as it is applicable to all handled exceptions. The other two rules are more specific. Embodiments of the invention enable a set of the rules 206 with varying specificity or generality to be evaluated together to describe the exception that has occurred.
The memory area 204 further stores computer-executable components including a debug component 212, an interface component 214, a filter component 216, and a runtime component 218, which are described below with reference to
In an embodiment, the processor 202 is transformed into a special purpose microprocessor by executing computer-executable instructions or by otherwise being programmed. For example, the processor 202 executes computer-executable instructions for performing the operations illustrated in
Referring next to
The break decision 210 associated with the selected rule 206 is then applied, performed, or otherwise implemented. If a break should not occur at 306, the exception is ignored and execution of the instructions continues at 302 without interrupting the real-time scheduling on the host computing device 104. If a break should occur at 306 based on the break decision 210 associated with the selected rule 206, the target computing device 102 halts at 308 and the host computing device 104 is notified that an exception has occurred. The host computing device 104 initiates a debug session at 310 based on the exception.
Referring next to
In the example of
For example, the calculation is performed by summing values associated with each of the criteria 208 matching the exception information. The score represents how specifically the rule 206 matches the encountered exception. If the calculated score of the rule 206 is greater than a currently-stored highest score at 410, the highest score is replaced with the calculated score, and the determined break decision 210 is updated with the break decision 210 associated with the rule 206 at 412. If the calculated score of the rule 206 is not greater than the currently-stored highest score at 410, the next rule 206 is accessed at 404. If all the rules 206 have been evaluated at 404, the determined break decision 210 is passed to the kernel debugger executing on the target computing device 102 at 406. The kernel debugger applies the determined break decision 210.
In an embodiment, if two or more rules 206 have the same score, the rule 206 that is first declared within the set of the rules 206 takes precedence. In this way, the user 106 can prioritize the rules 206 based on the completed fields within each rule 206.
In an example application of the operations in
In some embodiments, if all the rules 206 have a score of zero, the default behavior is to break into the debugger.
Referring next to
The target computing device 102 executes a plurality of instructions at 504. If an exception is detected or notification of an exception is received at 506 by the interface component 214 (e.g., from a kernel executing on the target computing device 102), the rules 206 are evaluated at 508 by the filter component 216 based on exception information associated with the exception. For example, the criteria 208 associated with each of the rules 206 are compared to the exception information. Based on the evaluation at 508, one of the rules 206 is selected. The break decision associated with the selected rule 206 is determined without notifying the host computing device 104 and applied at 510.
The runtime component 218 interacts with the user 106 to receive modifications to the rules 206 from the user 106 or developer at 512. If modifications are received at 512, the user 106 dynamically modifies the rules 206 stored on the target computing device 102 at 514. The runtime component 218 enables the modification without notifying the host computing device 104. For example, the runtime component 218 includes a user interface for presenting the rules 206 and associated criteria 208, and receiving the modifications from the user 106. The modifications include, but are not limited to, adding a rule 206, deleting a rule 206, editing a rule 206, adding criteria 208 to a rule 206, removing criteria 208 from a rule 206, or editing the criteria 208 associated with a rule 206.
A computer or computing device such as described herein has one or more processors or processing units, system memory, and some form of computer readable media. By way of example and not limitation, computer readable media comprise computer storage media and communication media. Computer storage media 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, program modules or other data. Communication media typically embody 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 include any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
Although described in connection with an exemplary computing system environment, embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. The computing system environment is not intended to suggest any limitation as to the scope of use or functionality of any aspect of the invention.
Embodiments of the invention may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. The computer-executable instructions may be organized into one or more computer-executable components or modules. Generally, program modules include, but are not limited to, routines, programs, objects, components, and data structures that perform particular tasks or implement particular abstract data types. Aspects of the invention may be implemented with any number and organization of such components or modules. For example, aspects of the invention are not limited to the specific computer-executable instructions or the specific components or modules illustrated in the figures and described herein. Other embodiments of the invention may include different computer-executable instructions or components having more or less functionality than illustrated and described herein.
The embodiments illustrated and described herein as well as embodiments not specifically described herein but within the scope of aspects of the invention constitute exemplary means for selectively notifying the host computing device 104 of the exception based on the rules 206, and exemplary means for defining the criteria 208 in the rules 206 to describe exceptions of interest to the user 106 of the target computing device 102.
The order of execution or performance of the operations in embodiments of the invention illustrated and described herein is not essential, unless otherwise specified. That is, the operations may be performed in any order, unless otherwise specified, and embodiments of the invention may include additional or fewer operations than those disclosed herein. For example, it is contemplated that executing or performing a particular operation before, contemporaneously with, or after another operation is within the scope of aspects of the invention.
When introducing elements of aspects of the invention or the embodiments thereof, the articles “a,” “an,” “the,” and “said” are intended to mean that there are one or more of the elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that there may be additional elements other than the listed elements.
Having described aspects of the invention in detail, it will be apparent that modifications and variations are possible without departing from the scope of aspects of the invention as defined in the appended claims. As various changes could be made in the above constructions, products, and methods without departing from the scope of aspects of the invention, it is intended that all matter contained in the above description and shown in the accompanying drawings shall be interpreted as illustrative and not in a limiting sense.