A debugger or debugging tool is a computer program that is used to test and debug other programs (e.g., the target program). A “crash” happens when the program cannot normally continue because it has encountered a programming bug. When the program crashes or reaches a preset condition, the debugger typically identifies the location in the original code that caused the crash if it is a source-level debugger or symbolic debugger. If it is a low-level debugger or a machine-language debugger it identifies the line in the disassembly (unless it also has online access to the original source code and can display the appropriate section of code from the assembly or compilation).
Modern day processors have to be debugged in a system in a lab setting. Debug architecture requires that for an invasive debug operation, debugger software be executed by the processor under debug (PUD). If the functionality of processor under debug is compromised such that the processor is unable to run even the debugger software itself, then debug of such processor is impossible. Consequently, conventional approaches that rely on a potentially compromised PUD to execute debug instructions are inadequate.
A shortcoming of some conventional debugging tools is that they rely on potentially compromised processors to execute their own debug instructions. A method for invasive debug of a processor without processor execution of instructions is disclosed that addresses these shortcomings. As a part of a method, a memory mapped I/O of the processor is accessed via a debug bus and an operation is initiated that causes a debug port to gain access to registers of the processor using the memory mapped I/O. The invasive debug of the processor is executed from the debug port via registers of the processor. Accordingly, the debug port is able to execute an invasive debug of the processor that could otherwise only be performed through execution of instructions by the processor itself.
The invention, together with further advantages thereof, may best be understood by reference to the following description taken in conjunction with the accompanying drawings in which:
It should be noted that like reference numbers refer to like elements in the figures.
Although the present invention has been described in connection with one embodiment, the invention is not intended to be limited to the specific forms set forth herein. On the contrary, it is intended to cover such alternatives, modifications, and equivalents as can be reasonably included within the scope of the invention as defined by the appended claims.
In the following detailed description, numerous specific details such as specific method orders, structures, elements, and connections have been set forth. It is to be understood however that these and other specific details need not be utilized to practice embodiments of the present invention. In other circumstances, well-known structures, elements, or connections have been omitted, or have not been described in particular detail in order to avoid unnecessarily obscuring this description.
References within the specification to “one embodiment” or “an embodiment” are intended to indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. The appearance of the phrase “in one embodiment” in various places within the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Moreover, various features are described which may be exhibited by some embodiments and not by others. Similarly, various requirements are described which may be requirements for some embodiments but not other embodiments.
Some portions of the detailed descriptions, which follow, are presented in terms of procedures, steps, logic blocks, processing, and other symbolic representations of operations on data bits within a computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, computer executed step, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals of a computer readable storage medium and are capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as “accessing” or “initiating” or “executing” or the like, refer to the action and processes of a computer system, or similar electronic computing device that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories and other computer readable media into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Referring to
MMIO 105 is configured to initiate a process that makes debug port 109 the master component in debug operations. At this point, debug port 109 gains access to all of the registers of PUD 103. In one embodiment, when debug port 109 becomes master, it can initiate debug functions and features which are invasive in nature and that otherwise can only be performed by the execution of instructions by PUD 103.
Processor registers 103a-103n are system registers of PUD 103 into which data can be loaded and used for arithmetic, manipulated, or tested, by machine instruction. In one embodiment, system registers can include but are not limited to registers that are associated with PUD 103 memory management unit (MMU), front end components, cache components, etc. In one embodiment, when debug port 109 becomes the master component of the processor debug process, it gains access to all of the processor's system registers.
Referring to
Debugger 111 is a computer program that is used to test and debug PUD 103. In one embodiment, debugger 111 accesses MMIO 105 via debug bus 107 in order to trigger a mode of operation that is referred to herein as debug port control mode. In one embodiment, debugger 111 can indicate specific diagnostic operations that debug port 109 is to perform.
Referring to
At B, using MMIO 105, an operation that causes debug port 109 to gain access to system registers of PUD 103 is performed.
At C, an invasive debug of PUD 103 is caused to be executed from debug port 109, based on the aforementioned access to system registers 103a-103n of PUD 103.
MMIO accessing component 201 causes a memory mapped I/O (MMIO) of a PUD (e.g., 103 in
Register access initiating component 203 initiates an operation that causes the debug port to gain access to system registers of the PUD using the memory mapped I/O. In one embodiment, system registers of the PUD (e.g., processor registers 103a-103n in
Invasive debug executing component 205 causes the execution of an invasive debug of the PUD from the debug port based on the aforementioned access to the system registers of the PUD. In one embodiment, when the debug interface becomes master, invasive debug executing component 205 can initiate debug functions and features which are invasive in nature and that otherwise can only be performed by the execution of instructions by the PUD.
It should be appreciated that the aforementioned components of system 101 can be implemented in hardware or software or in a combination of both. In one embodiment, components and operations of system 101 can be encompassed by components and operations of one or more computer components or programs (such as debug port 109 of
Referring to
At 303, using the memory mapped I/O, an operation is initiated that causes the debug port to gain access to registers of the PUD.
At 305, from the debug port, and based on access to registers of the PUD, an invasive debug of the PUD is executed at the behest of a system for invasive debug of a processor (e.g., system 101 in
With regard to exemplary embodiments thereof, systems and methods for invasive debug of a processor without processor execution of instructions are disclosed. As a part of the method, a memory mapped I/O of the processor is accessed using a debug interface and an operation is initiated that causes the debug interface to gain access to registers of the processor using the memory mapped I/O. The invasive debug of the processor is executed from the debug interface via registers of the processor.
Although many of the components and processes are described above in the singular for convenience, it will be appreciated by one of skill in the art that multiple components and repeated processes can also be used to practice the techniques of the present invention. Further, while the invention has been particularly shown and described with reference to specific embodiments thereof, it will be understood by those skilled in the art that changes in the form and details of the disclosed embodiments may be made without departing from the spirit or scope of the invention. For example, embodiments of the present invention may be employed with a variety of components and should not be restricted to the ones mentioned above. It is therefore intended that the invention be interpreted to include all variations and equivalents that fall within the true spirit and scope of the present invention.