# US 11,307,965 B2 · Managing and maintaining multiple debug contexts in a debug execution mode for real-time processors

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,307,965 B2
- Document ID: US11307965B2
- Status: Granted
- Kind: B2
- Application number: 17/011,829
- Filed: 2020-09-03
- Published: 2020-12-24
- Granted: 2022-04-19
- Earliest claimed: 2018-05-16
- Assignees: Texas Instruments Incorporated
- Applicants: Texas Instruments Incorporated
- Inventors: Jason Lynn Peck; Gary A. Cooper; Markus Koesler
- Web page: https://patentgrep.com/patent/US11307965B2

## CPC

- G06F 11/3656: {using a specific debug interface}
- G06F 9/4812: {by interrupt, e.g. masked}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F 11/3644: {by instrumenting at runtime}
- G06F 11/3632: {of specific synchronisation aspects}
- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 2201/805: Real-time
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A real-time debugger implementation maintains and manages multiple debug contexts allowing developers to interact with real-time applications without “breaking” the system in which the debug application is executing. The debugger allows multiple debug contexts to exist and allows break points in real-time and non-real-time code portions of one or more applications executing on a debug enabled core of a processor. A debug monitor function may be implemented as a hardware logic module on the same integrated circuit as the processor. Higher priority interrupt service requests may be serviced while otherwise maintaining a context for the debug session (e.g., stopped at a developer defined breakpoint). Accordingly, the application developer executing the debugger may not have to be concerned with processing occurring on the processor that may be unrelated to the current debug session.

## Claims

### Claim 1

A computing device comprising:
a processing unit; and
a debug controller communicatively coupled to the processing unit and including an input/output interface,
wherein the debug controller contains logic that causes the debug controller to perform a debug monitor function, the debug monitor function configured to:
in response to a first debug event associated with a first code section having a first execution priority, pause the processing unit and establish a first debug context;
receive an indication that a second code section of a higher execution priority than the first execution priority requires servicing while the processing unit is paused at the first debug event;
allow the processing unit to resume execution to service the second code section while maintaining the first debug context, wherein at least one information access request received via the input/output interface of the debug controller is held while executing the second code section; and
return to an execution state consistent with the first debug context, in part, by pausing the processing unit in the first code section upon completion of servicing the second code section.

### Claim 2 (depends on 1)

The computing device of claim 1, wherein:
the first debug event includes one of a breakpoint in the first code section, a trigger received at the input/output interface, a user command received at the input/output interface, and a watch-point in the first code section.

### Claim 3 (depends on 1)

The computing device of claim 1, wherein:
the indication that the second code section is the higher execution priority than the first execution priority is received via the input/output interface.

### Claim 4 (depends on 1)

The computing device of claim 1, wherein:
the debug monitor function is further configured to set a flag upon completion of servicing the second code section.

### Claim 5 (depends on 1)

The computing device of claim 1, wherein:
the at least one information access request received via the input/output interface of the debug controller is serviced before servicing the second code section.

### Claim 6 (depends on 1)

The computing device of claim 1, wherein:
the at least one information access request received via the input/output interface of the debug controller is serviced after completion of servicing the second code section.

### Claim 7 (depends on 1)

The computing device of claim 1, wherein:
the input/output interface includes at least one of a keyboard, a mouse, a touchpad, a biometric scanner, an input communication port, a display, an audio speaker, a printer, and an output communication port.

### Claim 8 (depends on 1)

The computing device of claim 1, wherein:
the debug controller is configured for real-time debugging.

### Claim 9 (depends on 8)

The computing device of claim 8, wherein:
a register bit field configures the debug controller for real-time debugging.

### Claim 10 (depends on 1)

The computing device of claim 1, wherein:
the processing unit includes a plurality of cores, wherein each of the plurality of cores is coupled to an instance of the debug monitor function.

### Claim 11

A method comprising:
receiving, at an input/output interface of a debug controller coupled to a processor, a user command to halt the processor executing a first code section having a first priority;
in response to the user command:
establishing, by the debug controller, a first debug context for the first code section; and
halting, by the debug controller, execution of the first code section by the processor at a point in the first code section;
while the processor is halted, receiving, by the debug controller, an indication associated with a second code section of a higher execution priority than the first code section that the second code section requires servicing;
in response to the indication associated with the second code section:
resuming, by the debug controller, execution by the processor of the second code section, wherein at least one information access request is held while executing the second code section; and
upon completion of execution of the second code section:
returning, by the debug controller, to the first debug context; and
halting, by the debug controller, execution of the processor at the point in the first code section.

### Claim 12 (depends on 11)

The method of claim 11, wherein:
the at least one information access request is serviced during the servicing of the second code section.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
the at least one information access requests is serviced before or after the servicing of the second code section.

### Claim 14 (depends on 11)

The method of claim 11, wherein:
the processor includes a plurality of cores.

### Claim 15 (depends on 14)

The method of claim 14, wherein:
each one of the plurality of cores is coupled to a respective one of a plurality of debug monitors.

### Claim 16 (depends on 11)

The method of claim 11, further comprising:
the second code section having a breakpoint;
upon the processor reaching the breakpoint:
establishing, by the debug controller, a second debug context for the breakpoint; and
halting, by the debug controller, execution of the processor at the breakpoint;
while the processor is halted at the breakpoint, receiving, by the debug controller, an indication associated with a third code section of a higher execution priority than the second code section that the third code section requires servicing;
in response to the indication associated with the third code section:
resuming, by the debug controller, execution by the processor of the third code section, wherein at least two information access requests are held while executing the third code section; and
upon completion of execution of the third code section:
returning, by the debug controller, to the second debug context; and
halting, by the debug controller, execution of the processor at the breakpoint.

### Claim 17 (depends on 16)

The method of claim 16, further comprising:
receiving, by the debug controller at the input/output interface, a first resume command to resume the processor executing the second code section;
executing, by the debug controller, the first resume command to resume execution of the processor at the breakpoint;
receiving, by the debug controller at the input/output interface, a second resume command to resume the processor executing the first code section; and
executing, by the debug controller, the second resume command to resume execution of the processor at the point in the first code section.

### Claim 18 (depends on 16)

The method of claim 16, further comprising:
setting, by the debug controller, a first flag in response to establishing the first debug context; and
setting, by the debug controller, a second flag in response to establishing the second debug context.

### Claim 19

A method comprising:
executing, by a processing unit, a first code section having a first execution priority;
pausing, by the processing unit, in response to a first debug event associated with the first code section;
in response to pausing in response to the first debug event, retrieving, by the processing unit, a first debug context;
receiving, by the processing unit, an indication that a second code section of a higher execution priority than the first execution priority requires servicing while the processing unit is paused at the first debug event;
in response to a second debug event, resuming, by the processing unit, execution to service the second code section while maintaining the first debug context, wherein at least one information access request is held while executing the second code section; and
pausing the processing unit in the first code section upon completion of servicing the second code section to return to an execution state consistent with the first debug context.

### Claim 20 (depends on 19)

The method of claim 19, wherein:
the first debug event includes one of a breakpoint in the first code section, a trigger received at an input/output interface, a user command received at the input/output interface, and a watch-point in the first code section.
