Enhanced thread stepping
First Claim
Patent Images
1. A computer implemented method for debugging a multithreaded program, comprising:
- receiving a first request to execute a current line of code for a first thread of the multithreaded program actively being debugged by a debugging application, wherein executing the current line of code requires access, by the first thread, to a shared resource shared by a plurality of threads of the multithreaded program, and wherein an execution of a second one of the plurality of threads is suspended by the debugging application;
upon determining that a first debug timer did not expire during a previous execution of the current line of code, initiating a second debug timer for a predetermined time limit;
upon determining that the first debug timer did expire during the previous execution of the current line of code, initiating the second debug timer for a reduced amount of time that is less than the predetermined time limit;
initiating an execution of the current line of code by operation of one or more computer processors; and
upon determining that the second debug timer has expired before the execution of the current line of code has completed;
resuming the execution of the suspended second thread of the multithreaded program, andupon detecting that a lock on the shared resource has been released, completing the execution of the current line of code.
1 Assignment
0 Petitions
Accused Products
Abstract
Embodiments of the invention provide debugging techniques for multithreaded programs. For example, a debugger may reduce the time required to release inactive threads that hold resources needed by an active thread. For example, if a timer expires before a line of code finishes executing, the debugger assumes that the active thread requires a resource locked by an inactive thread and releases other threads. During subsequent execution of the line of code, the debugger reduces the timer length of the timer. In doing so, inactive threads are released sooner, thereby reducing the wait time a user experiences when debugging lines of code.
34 Citations
20 Claims
-
1. A computer implemented method for debugging a multithreaded program, comprising:
-
receiving a first request to execute a current line of code for a first thread of the multithreaded program actively being debugged by a debugging application, wherein executing the current line of code requires access, by the first thread, to a shared resource shared by a plurality of threads of the multithreaded program, and wherein an execution of a second one of the plurality of threads is suspended by the debugging application; upon determining that a first debug timer did not expire during a previous execution of the current line of code, initiating a second debug timer for a predetermined time limit; upon determining that the first debug timer did expire during the previous execution of the current line of code, initiating the second debug timer for a reduced amount of time that is less than the predetermined time limit; initiating an execution of the current line of code by operation of one or more computer processors; and upon determining that the second debug timer has expired before the execution of the current line of code has completed; resuming the execution of the suspended second thread of the multithreaded program, and upon detecting that a lock on the shared resource has been released, completing the execution of the current line of code. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer readable medium containing a program, which, when executed performs an operation for debugging a multithreaded program, the operation comprising:
-
receiving a first request to execute a current line of code for a first thread of the multithreaded program actively being debugged by a debugging application, wherein executing the current line of code requires access, by the first thread, to a shared resource shared by a plurality of threads of the multithreaded program, and wherein an execution of a second one of the plurality of threads is suspended by the debugging application; upon determining that a first debug timer did not expire during a previous execution of the current line of code, initiating a second debug timer for a predetermined time limit; upon determining that the first debug timer did expire during the previous execution of the current line of code, initiating the second debug timer for a reduced amount of time that is less than the predetermined time limit; initiating an execution of the current line of code; and upon determining that the second debug timer has expired before the execution of the current line of code has completed; resuming the execution of the suspended second thread of the multithreaded program, and upon detecting that a lock on the shared resource has been released, completing the execution of the current line of code. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A system, comprising:
-
a processor; and a memory containing a debugging program which, when executed by the processor, performs an operation for debugging a multithreaded program, the operation comprising; receiving a first request to execute a current line of code for a first thread of the multithreaded program actively being debugged by a debugging application, wherein executing the current line of code requires access, by the first thread, to a shared resource shared by a plurality of threads of the multithreaded program, and wherein an execution of a second one of the plurality of threads is suspended by the debugging application; upon determining that a first debug timer did not expire during a previous execution of the current line of code, initiating a second debug timer for a predetermined time limit; upon determining that the first debug timer did expire during the previous execution of the current line of code, initiating the second debug timer for a reduced amount of time that is less than the predetermined time limit; initiating an execution of the current line of code; and upon determining that the second debug timer has expired before the execution of the current line of code has completed; resuming the execution of the suspended second thread of the multithreaded program, and upon detecting that a lock on the shared resource has been released, completing the execution of the current line of code. - View Dependent Claims (16, 17, 18, 19)
-
-
20. A computer implemented method for debugging a multithreaded program, comprising:
-
receiving a first request to execute a current line of code for a first thread of the multithreaded program actively being debugged by a debugging application, wherein executing the current line of code requires access, by the first thread, to a shared resource shared by a plurality of threads of the multithreaded program, wherein an execution of a second one of the plurality of threads is suspended by the debugging application, and wherein the suspended second thread has exclusive access to the shared resource; initiating a first debug timer, wherein the first debug timer is set to expire after a reduced period of time upon determining that a previous debug timer expired during a previous execution of the current line of code; initiating an execution of the current line of code by operation of one or more computer processors; and upon determining that the first debug timer has expired before the execution of the current line of code has completed; resuming the execution of the suspended second thread of the multithreaded program until the second thread releases a lock on the shared resource, and upon detecting that the lock on the shared resource has been released, completing the execution of the current line of code.
-
Specification