US20050246691A1 - Debugging tool for debugging multi-threaded programs - Google Patents
Debugging tool for debugging multi-threaded programs Download PDFInfo
- Publication number
- US20050246691A1 US20050246691A1 US10/835,083 US83508304A US2005246691A1 US 20050246691 A1 US20050246691 A1 US 20050246691A1 US 83508304 A US83508304 A US 83508304A US 2005246691 A1 US2005246691 A1 US 2005246691A1
- Authority
- US
- United States
- Prior art keywords
- program
- option
- thread
- program instruction
- user
- 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.)
- Granted
Links
Images
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
Definitions
- debugging tools Software programs known a “debugging tools” are widely used by software developers.
- the purpose of a debugging tool is to allow a software developer to examine for errors a software program that is under development.
- Functions such as “Step Into”, “Step Over”, “Step Out” and “Run to Cursor” allow the user to effectively “freeze” execution of the program under examination at a given program instruction, to allow checking of variable values, memory contents, etc., and to gain insight into the workings of the program under examination.
- Multi-threaded operation can result in significant efficiencies, but conventional debugging tools do not readily allow for tracing of synchronization signals or of data passed across thread boundaries.
- FIG. 1 is block diagram of a computer system according to some embodiments.
- FIG. 2 is a flow chart that illustrates a function of a debugging tool according to some embodiments.
- FIGS. 3 and 4 are example screen displays that may be provided in accordance with the function of FIG. 2 .
- FIG. 5 is a flow chart that illustrates another function of a debugging tool according to some embodiments.
- FIG. 6 is an example screen display that may be provided in accordance with the function of FIG. 5 .
- FIGS. 7A and 7B together form a flow chart that illustrates still other functions of a debugging tool according to some embodiments.
- FIG. 8 is an example screen display that may be provided in accordance with the function of FIGS. 7A and 7B .
- FIG. 1 is a block diagram of a computer system 10 according to some embodiments.
- the computer system 10 may, but need not, be constituted entirely of conventional components.
- the computer system 10 includes a first processor 12 and a second processor 14 coupled to the first processor 12 .
- the processors 12 and 14 may be, in some embodiments, conventional microprocessors.
- the computer system 10 also includes a memory controller 16 coupled to the processors 12 and 14 .
- Also included in the computer system 10 are one or more memory devices 18 coupled to the processors 12 and 14 via the memory controller 16 .
- the memory device(s) 18 may store the program which is to undergo debugging as well as a debugging tool according to some embodiments.
- the program to be debugged may run on the first processor 12 and the debugging tool may run on the second processor 14 , which may control the first processor 12 to periodically interrupt and resume execution of the program to be debugged under control of the debugging tool.
- the memory controller 16 may include a queue accelerator (not separately shown) which may operate to facilitate creation, maintenance and use of one or more data queues in the memory device(s) 18 .
- a queue accelerator (not separately shown) which may operate to facilitate creation, maintenance and use of one or more data queues in the memory device(s) 18 .
- the computer system 10 may also include one or more input/output devices (e.g., a display device 20 and a computer mouse 22 , both coupled to the second processor 14 ) by which the user may provide input to the computer system and may receive output from the computer system.
- input/output devices e.g., a display device 20 and a computer mouse 22 , both coupled to the second processor 14
- Other conventional devices such as a keyboard (not shown) may also be included in the computer system.
- FIG. 2 is a flow chart that illustrates a function of a debugging tool according to some embodiments.
- the debugging tool (also referred to as the “debugger”) is caused to execute (“run”) on the second processor 14 .
- a screen display like that shown in FIG. 3 may be displayed to the user via the display device 20 .
- the screen display of FIG. 3 may include a toolbar 300 which may permit actuation of at least some conventional features of debugging tools.
- the screen display of FIG. 3 may include a source window 302 in which a (e.g., partial) source listing 304 is displayed (as per 202 in FIG. 2 ).
- the source listing 304 lists source code program instructions of the program that is being debugged.
- the program supports multi-threaded operation, either by design or as a result of partitioning by the compiler. It will also be assumed that the “put” instruction 306 included in the source listing 304 is part of a first execution thread of the program and operates to put an item of data (i.e., the value of a variable) to a queue for consumption by another execution thread of the program.
- the “put” instruction 306 may be selected by the user by, for example, using the mouse 22 ( FIG. 1 ) to position a cursor 400 ( FIG. 4 ) adjacent to the “put” instruction 306 and then, e.g., “right-clicking” (i.e., clicking a right-hand button (not separately shown) of the mouse 22 ).
- a context menu 402 is displayed, as indicated at 204 in FIG. 2 .
- the context menu 402 includes a “Step Across” option 404 ( FIG. 4 ) with respect to the “put” instruction 306 .
- the debugger sets conditional breakpoints (as indicated at 208 in FIG. 2 ) at one or more “get” instructions in one or more threads other than the thread of which the “put” instruction 306 is a part and/or in the same thread.
- the condition for the breakpoints is whether the memory location from which the respective get instruction gets the data is the same as the memory location to which the “put” instruction 306 puts the data.
- the memory controller 16 or other hardware aspects of the computer system 10 may operate to expose the “put” and “get” memory locations to the debugger for the purposes of the “Step Across” function illustrated in FIG. 2 .
- the compiler and/or the debugger are operative to determine the “put” and “get” memory locations.
- the debugger causes the program that is being debugged to run (as indicated at 210 ) to the next get instruction in, e.g., a thread other than the thread to which the “put” instruction 306 belongs. It is then determined, at 212 , whether the memory location from which the “get” instruction identified at 210 gets data matches the memory location to which the “put” instruction 306 put data. If there is no match, the process of FIG. 2 loops back to 210 . The loop of 210 , 212 continues until a match is found between the memory address from which the identified “get” instruction operates and the memory address to which the “put” instruction 306 put its data.
- the debugger clears all breakpoints set at 208 .
- the user may proceed to undertake typical diagnostic activities at the “get” instruction stopped at at 214 . These activities may include examining the current values of one or more variables and/or examining the contents of one or more memory locations.
- the debugger may also check for underflow or overflow conditions with respect to the queue to which the “put” instruction put the data. If such a condition is found, the debugger may present an error message to the user.
- the “Step Across” function described with respect to FIG. 2 allows a user to follow data across boundaries between threads, from a producing thread to a consuming thread, so that the user is better able to trace multi-threaded operation of a program that is being debugged.
- FIG. 5 is a flow chart that illustrates another function of a debugging tool according to some embodiments.
- the debugger is caused to execute on the second processor 14 .
- a screen display having a source listing 304 a ( FIG. 6 ) may be displayed to the user via the display device, as per 502 in FIG. 5 .
- the source listing 304 a lists source code program instructions of the program that is being debugged. It will be assumed that the program supports multi-threaded operation, either by design or as a result of partitioning by the compiler. It will also be assumed that the “signal” instruction 600 included in the source listing 304 a is part of a first execution thread of the program and operates to send a synchronization signal to another thread of the program.
- the synchronization signal may be, for example, a bit that is set or cleared in a particular register location.
- the “signal” instruction 600 may be selected by the user by, for example, using the mouse 22 ( FIG. 1 ) to position a cursor 400 ( FIG. 6 ) adjacent to the “signal” instruction 600 and then, e.g., “right-clicking”.
- the context menu 402 is again displayed, as indicated at 504 in FIG. 5 .
- the context menu 402 includes the “Step Across” option 404 ( FIG. 6 ), which is available with respect to the “signal” instruction 600 .
- Step Across works somewhat differently with respect to the “signal” instruction from its operation with respect to a “put” instruction, but to substantially the same effect, in that the user is allowed to easily trace operation of the program that is being debugged across thread boundaries.
- the debugger sets a breakpoint (as indicated at 508 in FIG. 5 ) at the instruction in another thread which receives the signal sent by the “signal” instruction.
- the debugger causes the program that is being debugged to run (as indicated at 510 ) to the instruction (in another thread) that receives the signal sent by the signal instruction 600 of the first thread.
- the debugger then causes ( 512 in FIG. 5 ) the program that is being debugged to stop at the instruction that receives the signal.
- the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 512 . These activities may include examining the current values of one or more variables and/or examining the contents of one or more memory locations.
- the “Step Across” function described with respect to FIG. 5 allows a user (debugging programmer) to more readily trace the interactions between threads of a program that is being debugged, thereby aiding in effective debugging of a multi-threaded program.
- the context menu 402 may also include conventional “Step Over” and “Step Into” options.
- FIGS. 7A and 7B together form a flow chart that illustrates still other functions of a debugging tool according to some embodiments.
- the debugger is caused to run on the second processor 14 .
- a source listing 304 b ( FIG. 8 ) is displayed (as per 702 in FIG. 7A ) that includes source code program instructions of a program that is being debugged.
- the program that is being debugged may or may not be a multi-threaded program.
- a variable 800 in this example indicated as “var 1 ”), in an instruction 801 included in the source listing 304 b , may be selected by the user by, for example, using the mouse 22 ( FIG. 1 ) to position the cursor 400 ( FIG. 8 ) adjacent to the variable 800 and then, e.g., right-clicking.
- a context menu 802 is displayed, as indicated at 704 in FIG. 7A .
- the context menu 802 includes a “Run to First Use” option 804 ( FIG. 8 ) with respect to the selected variable, a “Run to First Def” (run to first definition) option 806 with respect to the selected variable, and a “Run to First Change” option 808 with respect to the selected variable.
- the debugger causes the program that is being debugged to run to the next instruction (after instruction 801 ) in which the selected variable 800 is used. Upon such next instruction (which may or may not be in the same thread with the instruction 801 ) being reached and identified, the execution of the program that is being debugged is stopped.
- next instruction which may or may not be in the same thread with the instruction 801
- the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 708 . These activities may include examining the current values of one or more variables (including, e.g., the selected variable) and/or examining the contents of one or more memory locations.
- the debugger causes the program that is being debugged to run (as indicated at 718 , FIG. 7A ) to the next instruction (after instruction 801 ) in which the selected variable is defined.
- next instruction (which may or may not be in the same thread with the instruction 801 ) being reached and identified, it is determined (as indicated at 720 , FIG. 7B ) whether the definition of the selected variable in the identified next instruction resulted in a change in the value of the variable. If such is the case, execution of the program that is being debugged is stopped, as indicated at 722 . The process then advances to 710 , at which the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 722 . These activities may include examining the current values of one or more variables (including, e.g., the selected variable) and/or examining the contents of one or more memory locations.
- the debugger causes the program that is being debugged to run (as indicated at 724 ) to the next instruction (after the identified instruction) in which the selected variable is defined.
- the process then loops back to 720 , at which it is determined whether the newly identified instruction results in a change in the value of the selected variable.
- the loop of 720 , 724 may continue until an instruction is reached in which the value of the selected variable is changed.
- the debugger may make use of information available from the compiler in regard to uses of the selected variable, and breakpoints may be set accordingly. Upon hitting the first breakpoint required for the “run to” function, all are cleared.
- FIGS. 7A and 7B allows the user (debugging programmer) to trace uses/definitions/changes in value of a variable without resorting to a labor-intensive and time-consuming post-mortem review of a voluminous execution history file.
- FIGS. 7A and 7B may be applied to debugging of single-threaded as well as multi-threaded programs. Particular embodiments may omit, for example, one or two of the three “Run to” options illustrated in FIGS. 7A and 7 B.
- a debugger may include any one or more of the features described herein.
- a debugger having one or more of the features described above may also run on a single-processor system, with the program to be debugged running on the same processor as the debugger.
- a debugger having one or more of the above-described features may run on a system having more than two processors.
- a debugger having one or more of the above-described features may be executed with regard to a network processor that has 8 or 16 processors, for example.
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
Description
- Software programs known a “debugging tools” are widely used by software developers. The purpose of a debugging tool is to allow a software developer to examine for errors a software program that is under development. Functions such as “Step Into”, “Step Over”, “Step Out” and “Run to Cursor” allow the user to effectively “freeze” execution of the program under examination at a given program instruction, to allow checking of variable values, memory contents, etc., and to gain insight into the workings of the program under examination.
- Some programs support multi-threaded operation, either by original design or as a result of being partitioned into threads upon compiling. Multi-threaded operation can result in significant efficiencies, but conventional debugging tools do not readily allow for tracing of synchronization signals or of data passed across thread boundaries.
-
FIG. 1 is block diagram of a computer system according to some embodiments. -
FIG. 2 is a flow chart that illustrates a function of a debugging tool according to some embodiments. -
FIGS. 3 and 4 are example screen displays that may be provided in accordance with the function ofFIG. 2 . -
FIG. 5 is a flow chart that illustrates another function of a debugging tool according to some embodiments. -
FIG. 6 is an example screen display that may be provided in accordance with the function ofFIG. 5 . -
FIGS. 7A and 7B together form a flow chart that illustrates still other functions of a debugging tool according to some embodiments. -
FIG. 8 is an example screen display that may be provided in accordance with the function ofFIGS. 7A and 7B . -
FIG. 1 is a block diagram of acomputer system 10 according to some embodiments. In its hardware aspects, thecomputer system 10 may, but need not, be constituted entirely of conventional components. - The
computer system 10 includes afirst processor 12 and asecond processor 14 coupled to thefirst processor 12. The 12 and 14 may be, in some embodiments, conventional microprocessors. Theprocessors computer system 10 also includes amemory controller 16 coupled to the 12 and 14. Also included in theprocessors computer system 10 are one ormore memory devices 18 coupled to the 12 and 14 via theprocessors memory controller 16. The memory device(s) 18 may store the program which is to undergo debugging as well as a debugging tool according to some embodiments. The program to be debugged may run on thefirst processor 12 and the debugging tool may run on thesecond processor 14, which may control thefirst processor 12 to periodically interrupt and resume execution of the program to be debugged under control of the debugging tool. - The
memory controller 16 may include a queue accelerator (not separately shown) which may operate to facilitate creation, maintenance and use of one or more data queues in the memory device(s) 18. - The
computer system 10 may also include one or more input/output devices (e.g., adisplay device 20 and acomputer mouse 22, both coupled to the second processor 14) by which the user may provide input to the computer system and may receive output from the computer system. Other conventional devices such as a keyboard (not shown) may also be included in the computer system. -
FIG. 2 is a flow chart that illustrates a function of a debugging tool according to some embodiments. - At 200 in
FIG. 2 , the debugging tool (also referred to as the “debugger”) is caused to execute (“run”) on thesecond processor 14. As part of the operation of the computer system under (at least partial) control of the debugger, a screen display like that shown inFIG. 3 may be displayed to the user via thedisplay device 20. The screen display ofFIG. 3 may include atoolbar 300 which may permit actuation of at least some conventional features of debugging tools. In addition, the screen display ofFIG. 3 may include asource window 302 in which a (e.g., partial)source listing 304 is displayed (as per 202 inFIG. 2 ). Thesource listing 304 lists source code program instructions of the program that is being debugged. It will be assumed that the program supports multi-threaded operation, either by design or as a result of partitioning by the compiler. It will also be assumed that the “put”instruction 306 included in thesource listing 304 is part of a first execution thread of the program and operates to put an item of data (i.e., the value of a variable) to a queue for consumption by another execution thread of the program. - The “put”
instruction 306 may be selected by the user by, for example, using the mouse 22 (FIG. 1 ) to position a cursor 400 (FIG. 4 ) adjacent to the “put”instruction 306 and then, e.g., “right-clicking” (i.e., clicking a right-hand button (not separately shown) of the mouse 22). In response to the “right-clicking” (i.e., in response to the selecting of the “put” instruction), acontext menu 402 is displayed, as indicated at 204 inFIG. 2 . Thecontext menu 402 includes a “Step Across” option 404 (FIG. 4 ) with respect to the “put”instruction 306. - At 206 in
FIG. 2 , it is determined whether the user has selected the “Step Across”option 404. Selection of the “Step Across” option may occur by, e.g., the user operating themouse 22 and/or the keyboard. If it is determined that the user has selected the “Step Across” option, the debugger sets conditional breakpoints (as indicated at 208 inFIG. 2 ) at one or more “get” instructions in one or more threads other than the thread of which the “put”instruction 306 is a part and/or in the same thread. The condition for the breakpoints is whether the memory location from which the respective get instruction gets the data is the same as the memory location to which the “put”instruction 306 puts the data. - In some embodiments, the
memory controller 16 or other hardware aspects of thecomputer system 10 may operate to expose the “put” and “get” memory locations to the debugger for the purposes of the “Step Across” function illustrated inFIG. 2 . In other embodiments, the compiler and/or the debugger are operative to determine the “put” and “get” memory locations. - Following 208 in
FIG. 2 , the debugger causes the program that is being debugged to run (as indicated at 210) to the next get instruction in, e.g., a thread other than the thread to which the “put”instruction 306 belongs. It is then determined, at 212, whether the memory location from which the “get” instruction identified at 210 gets data matches the memory location to which the “put”instruction 306 put data. If there is no match, the process ofFIG. 2 loops back to 210. The loop of 210, 212 continues until a match is found between the memory address from which the identified “get” instruction operates and the memory address to which the “put”instruction 306 put its data. On the occasion of a match, 214 follows 212, and the debugger causes the program that is being debugged to stop at the “get” instruction which operates with respect to the matching memory address. It may be presumed that this “get” instruction is in a thread that is different from the thread of the “put”instruction 306. - At this time, as indicated at 216, the debugger clears all breakpoints set at 208. Next, as indicated at 218, the user may proceed to undertake typical diagnostic activities at the “get” instruction stopped at at 214. These activities may include examining the current values of one or more variables and/or examining the contents of one or more memory locations.
- In some embodiments, the debugger may also check for underflow or overflow conditions with respect to the queue to which the “put” instruction put the data. If such a condition is found, the debugger may present an error message to the user.
- The “Step Across” function described with respect to
FIG. 2 allows a user to follow data across boundaries between threads, from a producing thread to a consuming thread, so that the user is better able to trace multi-threaded operation of a program that is being debugged. -
FIG. 5 is a flow chart that illustrates another function of a debugging tool according to some embodiments. - At 500 in
FIG. 5 , the debugger is caused to execute on thesecond processor 14. As part of operation of the computer system under (at least partial control) of the debugger, a screen display having asource listing 304 a (FIG. 6 ) may be displayed to the user via the display device, as per 502 inFIG. 5 . The source listing 304 a lists source code program instructions of the program that is being debugged. It will be assumed that the program supports multi-threaded operation, either by design or as a result of partitioning by the compiler. It will also be assumed that the “signal”instruction 600 included in thesource listing 304 a is part of a first execution thread of the program and operates to send a synchronization signal to another thread of the program. The synchronization signal may be, for example, a bit that is set or cleared in a particular register location. - The “signal”
instruction 600 may be selected by the user by, for example, using the mouse 22 (FIG. 1 ) to position a cursor 400 (FIG. 6 ) adjacent to the “signal”instruction 600 and then, e.g., “right-clicking”. In response to the “right-clicking” (i.e., in response to the selecting of the “signal” instruction), thecontext menu 402 is again displayed, as indicated at 504 inFIG. 5 . Thecontext menu 402 includes the “Step Across” option 404 (FIG. 6 ), which is available with respect to the “signal”instruction 600. As will be seen, the “Step Across” option works somewhat differently with respect to the “signal” instruction from its operation with respect to a “put” instruction, but to substantially the same effect, in that the user is allowed to easily trace operation of the program that is being debugged across thread boundaries. - At 506 in
FIG. 5 , it is determined whether the user has selected the “Step Across”option 404 presented with respect to the “signal” instruction. As before, selection of the “Step Across” option may occur by, e.g., the user operating themouse 22 and/or the keyboard. If it is determined that the user has selected the “Step Across” option with respect to the “signal” instruction, the debugger sets a breakpoint (as indicated at 508 inFIG. 5 ) at the instruction in another thread which receives the signal sent by the “signal” instruction. - Following 508 in
FIG. 5 , the debugger causes the program that is being debugged to run (as indicated at 510) to the instruction (in another thread) that receives the signal sent by thesignal instruction 600 of the first thread. The debugger then causes (512 inFIG. 5 ) the program that is being debugged to stop at the instruction that receives the signal. Next, as indicated at 514, the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 512. These activities may include examining the current values of one or more variables and/or examining the contents of one or more memory locations. - The “Step Across” function described with respect to
FIG. 5 , and applied to a synchronizing signal passed between execution threads of a multi-threaded program, allows a user (debugging programmer) to more readily trace the interactions between threads of a program that is being debugged, thereby aiding in effective debugging of a multi-threaded program. - Although not shown in
FIG. 6 , thecontext menu 402 may also include conventional “Step Over” and “Step Into” options. -
FIGS. 7A and 7B together form a flow chart that illustrates still other functions of a debugging tool according to some embodiments. - At 700 in
FIG. 7A , the debugger is caused to run on thesecond processor 14. As part of the operation of the computer system under (at least partial) control of the debugger, a source listing 304 b (FIG. 8 ) is displayed (as per 702 inFIG. 7A ) that includes source code program instructions of a program that is being debugged. In various embodiments of the invention, the program that is being debugged may or may not be a multi-threaded program. - A variable 800 (in this example indicated as “var1”), in an
instruction 801 included in the source listing 304 b, may be selected by the user by, for example, using the mouse 22 (FIG. 1 ) to position the cursor 400 (FIG. 8 ) adjacent to the variable 800 and then, e.g., right-clicking. In response to the selection of the variable 800 (whether by right-clicking or, in some embodiments, simply by placement of thecursor 400 on the variable) acontext menu 802 is displayed, as indicated at 704 inFIG. 7A . Thecontext menu 802 includes a “Run to First Use” option 804 (FIG. 8 ) with respect to the selected variable, a “Run to First Def” (run to first definition)option 806 with respect to the selected variable, and a “Run to First Change”option 808 with respect to the selected variable. - It is then determined, at 706 in
FIG. 7A , whether the user has selected the “Run to First Use”option 804. If such is the case, then, as indicated at 708, the debugger causes the program that is being debugged to run to the next instruction (after instruction 801) in which the selected variable 800 is used. Upon such next instruction (which may or may not be in the same thread with the instruction 801) being reached and identified, the execution of the program that is being debugged is stopped. Next, as indicated at 710 (FIG. 7B ), the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 708. These activities may include examining the current values of one or more variables (including, e.g., the selected variable) and/or examining the contents of one or more memory locations. - Referring again to 706 in
FIG. 7A , if the “Run to First Use”option 804 is not selected, it is next determined, at 712 inFIG. 7A , whether the user has selected the “Run to First Def”option 806. If such is the case, then, as indicated at 714, the debugger causes the program that is being debugged to run to the next instruction (after instruction 801) in which the selected variable is defined. Upon such next instruction (which may or may not be in the same thread with the instruction 801) being reached and identified, the execution of the program that is being debugged is stopped. The process ofFIGS. 7A and 7B then advances to 710 (FIG. 7B ), at which the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 714. These activities may include examining the current values of one or more variables (including, e.g., the selected variable) and/or examining the contents of one or more memory locations. - Referring again to 712 in
FIG. 7A , if the “Run to First Def”option 806 is not selected, it is next determined, at 716 inFIG. 7A , whether the user has selected the “Run to First Change”option 808. (It is noted that not every definition of the value of a variable results in a change in the value of the variable.) If a positive determination is made at 716 (i.e., if the “Run to First Change”option 808 was selected), the debugger causes the program that is being debugged to run (as indicated at 718,FIG. 7A ) to the next instruction (after instruction 801) in which the selected variable is defined. Upon such next instruction (which may or may not be in the same thread with the instruction 801) being reached and identified, it is determined (as indicated at 720,FIG. 7B ) whether the definition of the selected variable in the identified next instruction resulted in a change in the value of the variable. If such is the case, execution of the program that is being debugged is stopped, as indicated at 722. The process then advances to 710, at which the user may proceed to undertake typical diagnostic activities at the instruction stopped at at 722. These activities may include examining the current values of one or more variables (including, e.g., the selected variable) and/or examining the contents of one or more memory locations. - Referring again to 720, if it is determined that the definition of the selected variable in the identified next instruction did not result in a change in the value of the variable, then the debugger causes the program that is being debugged to run (as indicated at 724) to the next instruction (after the identified instruction) in which the selected variable is defined. The process then loops back to 720, at which it is determined whether the newly identified instruction results in a change in the value of the selected variable. The loop of 720, 724 may continue until an instruction is reached in which the value of the selected variable is changed.
- In connection with all of these options, the debugger may make use of information available from the compiler in regard to uses of the selected variable, and breakpoints may be set accordingly. Upon hitting the first breakpoint required for the “run to” function, all are cleared.
- The process of
FIGS. 7A and 7B allows the user (debugging programmer) to trace uses/definitions/changes in value of a variable without resorting to a labor-intensive and time-consuming post-mortem review of a voluminous execution history file. - The process of
FIGS. 7A and 7B may be applied to debugging of single-threaded as well as multi-threaded programs. Particular embodiments may omit, for example, one or two of the three “Run to” options illustrated inFIGS. 7A and 7 B. - More generally, a debugger according to some embodiments may include any one or more of the features described herein.
- Although the embodiments described above have been illustrated in conjunction with a multi-processor system, in other embodiments a debugger having one or more of the features described above may also run on a single-processor system, with the program to be debugged running on the same processor as the debugger. Moreover, in some embodiments a debugger having one or more of the above-described features may run on a system having more than two processors.
- In some embodiments, a debugger having one or more of the above-described features may be executed with regard to a network processor that has 8 or 16 processors, for example.
- The several embodiments described herein are solely for the purpose of illustration. The various features described herein need not all be used together, and any one or more of those features may be incorporated in a single embodiment. Therefore, persons skilled in the art will recognize from this description that other embodiments may be practiced with various modifications and alterations.
Claims (52)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US10/835,083 US7945900B2 (en) | 2004-04-29 | 2004-04-29 | Debugging tool for debugging multi-threaded programs |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US10/835,083 US7945900B2 (en) | 2004-04-29 | 2004-04-29 | Debugging tool for debugging multi-threaded programs |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| US20050246691A1 true US20050246691A1 (en) | 2005-11-03 |
| US7945900B2 US7945900B2 (en) | 2011-05-17 |
Family
ID=35188533
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US10/835,083 Active 2030-03-17 US7945900B2 (en) | 2004-04-29 | 2004-04-29 | Debugging tool for debugging multi-threaded programs |
Country Status (1)
| Country | Link |
|---|---|
| US (1) | US7945900B2 (en) |
Cited By (19)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080115113A1 (en) * | 2006-11-15 | 2008-05-15 | Lucian Codrescu | Non-intrusive, thread-selective, debugging method and system for a multi-thread digital signal processor |
| US20080127113A1 (en) * | 2006-11-27 | 2008-05-29 | International Business Machines Corporation | Method and system for implementing watchpoints |
| US20080127117A1 (en) * | 2006-09-08 | 2008-05-29 | Panchamukhi Prasanna S | Method and apparatus for instrumentation in a multiprocessing environment |
| US20080235668A1 (en) * | 2007-03-21 | 2008-09-25 | Luke Matthew Browning | Operating system support for thread-level breakpoints |
| WO2007143012A3 (en) * | 2006-05-31 | 2008-10-02 | Univ Columbia | Systems, methods, and media for testing software patches |
| US20090164976A1 (en) * | 2007-12-21 | 2009-06-25 | International Business Machines Corporation | Multi-threaded debugger support |
| US20100049956A1 (en) * | 2008-08-20 | 2010-02-25 | Moyer William C | Debug instruction for use in a multi-threaded data processing system |
| US20100049955A1 (en) * | 2008-08-20 | 2010-02-25 | Moyer William C | Debug instruction for use in a multi-threaded data processing system |
| US20110154310A1 (en) * | 2009-12-23 | 2011-06-23 | Cormack Christopher J | Performance Analysis Of Software Executing In Different Sessions |
| CN101295279B (en) * | 2007-04-29 | 2012-05-09 | 国际商业机器公司 | Method and system for debugging program in multi-thread environment |
| US20120210305A1 (en) * | 2011-02-16 | 2012-08-16 | International Business Machines Corporation | Event Management In A Non-Stop Debugging Environment |
| US8341604B2 (en) | 2006-11-15 | 2012-12-25 | Qualcomm Incorporated | Embedded trace macrocell for enhanced digital signal processor debugging operations |
| US8380966B2 (en) | 2006-11-15 | 2013-02-19 | Qualcomm Incorporated | Method and system for instruction stuffing operations during non-intrusive digital signal processor debugging |
| US8484516B2 (en) * | 2007-04-11 | 2013-07-09 | Qualcomm Incorporated | Inter-thread trace alignment method and system for a multi-threaded processor |
| US8533530B2 (en) | 2006-11-15 | 2013-09-10 | Qualcomm Incorporated | Method and system for trusted/untrusted digital signal processor debugging operations |
| US8661413B2 (en) | 2011-04-13 | 2014-02-25 | International Business Machines Corporation | Impact indication of thread-specific events in a non-stop debugging environment |
| US8701093B2 (en) | 2011-04-13 | 2014-04-15 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US8752022B2 (en) | 2011-02-24 | 2014-06-10 | International Business Machines Corporation | Thread-specific event management in a non-stop debugging environment |
| CN119902968A (en) * | 2025-04-01 | 2025-04-29 | 上海壁仞科技股份有限公司 | Multi-threaded bundle debugging method, device and artificial intelligence chip |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| DE102004062852A1 (en) * | 2004-12-27 | 2006-07-06 | Siemens Ag | Control of a machine with debugging functionality |
| US8423970B2 (en) * | 2008-09-09 | 2013-04-16 | International Business Machines Corporation | Method, computer program product, and hardware product for handling breakpoints in an asynchronous debug model |
| EP2244143B1 (en) * | 2009-04-20 | 2014-07-16 | Pilz GmbH & Co. KG | Method and device for programming an industrial controller of an automated installation |
| US9507691B2 (en) * | 2014-01-10 | 2016-11-29 | International Business Machines Corporation | Conditional component breakpoint setting system and method |
| US9886365B2 (en) * | 2016-01-07 | 2018-02-06 | Ca, Inc. | Transactional boundaries for software system debugging |
| US10154098B2 (en) | 2016-01-07 | 2018-12-11 | Ca, Inc. | Transactional boundaries for software system profiling |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5632032A (en) * | 1994-02-07 | 1997-05-20 | International Business Machines Corporation | Cross address space thread control in a multithreaded environment |
| US5953530A (en) * | 1995-02-07 | 1999-09-14 | Sun Microsystems, Inc. | Method and apparatus for run-time memory access checking and memory leak detection of a multi-threaded program |
| US6378125B1 (en) * | 1999-02-22 | 2002-04-23 | International Business Machines Corporation | Debugger thread identification points |
| US6823518B1 (en) * | 2000-10-17 | 2004-11-23 | Microsoft Corporation | Threading and communication architecture for a graphical user interface |
| US7328429B2 (en) * | 2003-11-13 | 2008-02-05 | Intel Corporation | Instruction operand tracing for software debug |
-
2004
- 2004-04-29 US US10/835,083 patent/US7945900B2/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5632032A (en) * | 1994-02-07 | 1997-05-20 | International Business Machines Corporation | Cross address space thread control in a multithreaded environment |
| US5953530A (en) * | 1995-02-07 | 1999-09-14 | Sun Microsystems, Inc. | Method and apparatus for run-time memory access checking and memory leak detection of a multi-threaded program |
| US6378125B1 (en) * | 1999-02-22 | 2002-04-23 | International Business Machines Corporation | Debugger thread identification points |
| US6823518B1 (en) * | 2000-10-17 | 2004-11-23 | Microsoft Corporation | Threading and communication architecture for a graphical user interface |
| US7328429B2 (en) * | 2003-11-13 | 2008-02-05 | Intel Corporation | Instruction operand tracing for software debug |
Cited By (37)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100031239A1 (en) * | 2006-05-31 | 2010-02-04 | Keromytis Angelos D | Systems, Methods, and Media for Testing Software Patches |
| US8683450B2 (en) | 2006-05-31 | 2014-03-25 | The Trustees Of Columbia University In The City Of New York | Systems, methods, and media for testing software patches |
| US9606905B2 (en) | 2006-05-31 | 2017-03-28 | The Trustees Of Columbia University In The City Of New York | Systems, methods, and media for testing software patches |
| WO2007143012A3 (en) * | 2006-05-31 | 2008-10-02 | Univ Columbia | Systems, methods, and media for testing software patches |
| US20080127117A1 (en) * | 2006-09-08 | 2008-05-29 | Panchamukhi Prasanna S | Method and apparatus for instrumentation in a multiprocessing environment |
| US7950001B2 (en) * | 2006-09-08 | 2011-05-24 | International Business Machines Corporation | Method and apparatus for instrumentation in a multiprocessing environment |
| US20080115113A1 (en) * | 2006-11-15 | 2008-05-15 | Lucian Codrescu | Non-intrusive, thread-selective, debugging method and system for a multi-thread digital signal processor |
| US8341604B2 (en) | 2006-11-15 | 2012-12-25 | Qualcomm Incorporated | Embedded trace macrocell for enhanced digital signal processor debugging operations |
| US8533530B2 (en) | 2006-11-15 | 2013-09-10 | Qualcomm Incorporated | Method and system for trusted/untrusted digital signal processor debugging operations |
| US8380966B2 (en) | 2006-11-15 | 2013-02-19 | Qualcomm Incorporated | Method and system for instruction stuffing operations during non-intrusive digital signal processor debugging |
| US8370806B2 (en) | 2006-11-15 | 2013-02-05 | Qualcomm Incorporated | Non-intrusive, thread-selective, debugging method and system for a multi-thread digital signal processor |
| US20080127113A1 (en) * | 2006-11-27 | 2008-05-29 | International Business Machines Corporation | Method and system for implementing watchpoints |
| US20080235668A1 (en) * | 2007-03-21 | 2008-09-25 | Luke Matthew Browning | Operating system support for thread-level breakpoints |
| US7941788B2 (en) * | 2007-03-21 | 2011-05-10 | International Business Machines Corporation | Operating system support for thread-level breakpoints |
| US8484516B2 (en) * | 2007-04-11 | 2013-07-09 | Qualcomm Incorporated | Inter-thread trace alignment method and system for a multi-threaded processor |
| CN101295279B (en) * | 2007-04-29 | 2012-05-09 | 国际商业机器公司 | Method and system for debugging program in multi-thread environment |
| US10191835B2 (en) | 2007-12-21 | 2019-01-29 | International Business Machines Corporation | Multi-threaded debugger support |
| US8739133B2 (en) * | 2007-12-21 | 2014-05-27 | International Business Machines Corporation | Multi-threaded debugger support |
| US20090164976A1 (en) * | 2007-12-21 | 2009-06-25 | International Business Machines Corporation | Multi-threaded debugger support |
| US9417989B2 (en) | 2007-12-21 | 2016-08-16 | International Business Machines Corporation | Multi-threaded debugger support |
| US20100049956A1 (en) * | 2008-08-20 | 2010-02-25 | Moyer William C | Debug instruction for use in a multi-threaded data processing system |
| WO2010021778A1 (en) * | 2008-08-20 | 2010-02-25 | Freescale Semiconductor Inc. | Debug instruction for use in a multi-threaded data processing system |
| US20100049955A1 (en) * | 2008-08-20 | 2010-02-25 | Moyer William C | Debug instruction for use in a multi-threaded data processing system |
| US9395983B2 (en) | 2008-08-20 | 2016-07-19 | Freescale Semiconductor, Inc. | Debug instruction for execution by a first thread to generate a debug event in a second thread to cause a halting operation |
| US20110154310A1 (en) * | 2009-12-23 | 2011-06-23 | Cormack Christopher J | Performance Analysis Of Software Executing In Different Sessions |
| US8671400B2 (en) * | 2009-12-23 | 2014-03-11 | Intel Corporation | Performance analysis of software executing in different sessions |
| US20130074044A1 (en) * | 2011-02-16 | 2013-03-21 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US8762954B2 (en) * | 2011-02-16 | 2014-06-24 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US8762955B2 (en) * | 2011-02-16 | 2014-06-24 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US20120210305A1 (en) * | 2011-02-16 | 2012-08-16 | International Business Machines Corporation | Event Management In A Non-Stop Debugging Environment |
| US8752022B2 (en) | 2011-02-24 | 2014-06-10 | International Business Machines Corporation | Thread-specific event management in a non-stop debugging environment |
| US8756583B2 (en) | 2011-02-24 | 2014-06-17 | International Business Machines Corporation | Thread-specific event management in a non-stop debugging environment |
| US8756578B2 (en) | 2011-04-13 | 2014-06-17 | International Business Machines Corporation | Impact indication of thread-specific events in a non-stop debugging environment |
| US8701094B2 (en) | 2011-04-13 | 2014-04-15 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US8701093B2 (en) | 2011-04-13 | 2014-04-15 | International Business Machines Corporation | Event management in a non-stop debugging environment |
| US8661413B2 (en) | 2011-04-13 | 2014-02-25 | International Business Machines Corporation | Impact indication of thread-specific events in a non-stop debugging environment |
| CN119902968A (en) * | 2025-04-01 | 2025-04-29 | 上海壁仞科技股份有限公司 | Multi-threaded bundle debugging method, device and artificial intelligence chip |
Also Published As
| Publication number | Publication date |
|---|---|
| US7945900B2 (en) | 2011-05-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7945900B2 (en) | Debugging tool for debugging multi-threaded programs | |
| US12001316B2 (en) | Systems, methods, and devices for vertically integrated instrumentation and trace reconstruction | |
| US8219980B2 (en) | Identifying a potential breakpoint location in a code path in a computer program based upon the frequency of execution of the code path as identified in collected profile data | |
| US9111038B2 (en) | Integrated debugger and code coverage tool | |
| US6026362A (en) | Tool and method for diagnosing and correcting errors in a computer program | |
| US7770155B2 (en) | Debugger apparatus and method for indicating time-correlated position of threads in a multi-threaded computer program | |
| US9152531B2 (en) | Post-compile instrumentation of object code for generating execution trace data | |
| US6550056B1 (en) | Source level debugger for debugging source programs | |
| US6981248B2 (en) | Conditional breakpoint encountered indication | |
| US20120317551A1 (en) | Post-compile instrumentation of object code for generating execution trace data | |
| US7950001B2 (en) | Method and apparatus for instrumentation in a multiprocessing environment | |
| US6707469B1 (en) | Synchronous execution in a medical imaging system | |
| JP2003131902A (en) | Software debugger, system level debugger, debugging method, and debugging program | |
| US9361205B2 (en) | Code coverage framework | |
| US8533683B2 (en) | Stack walking enhancements using sensorpoints | |
| US20030110476A1 (en) | Source code debugger, debugging method and debugging program | |
| US8108840B2 (en) | Method for enhancing debugger performance of hardware assisted breakpoints | |
| Hoffman et al. | Aspect-Based Introspection and Change Analysis for Evolving Programs. | |
| Cahir et al. | Parallel programming tools |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| AS | Assignment |
Owner name: INTEL CORPORATION, CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HSIEH, CHENG-HSUEH;REEL/FRAME:014869/0564 Effective date: 20040707 Owner name: INTEL CORPORATION, CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:DAI, JASON;REEL/FRAME:014869/0561 Effective date: 20040716 Owner name: INTEL CORPORATION, CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BEYLIN, BORIS;REEL/FRAME:014869/0875 Effective date: 20040709 |
|
| AS | Assignment |
Owner name: MARVELL INTERNATIONAL LTD.,BERMUDA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTEL CORPORATION;REEL/FRAME:018515/0817 Effective date: 20061108 Owner name: MARVELL INTERNATIONAL LTD., BERMUDA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTEL CORPORATION;REEL/FRAME:018515/0817 Effective date: 20061108 |
|
| STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
| FPAY | Fee payment |
Year of fee payment: 4 |
|
| MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 8TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1552); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 8 |
|
| AS | Assignment |
Owner name: CAVIUM INTERNATIONAL, CAYMAN ISLANDS Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MARVELL INTERNATIONAL LTD.;REEL/FRAME:052918/0001 Effective date: 20191231 |
|
| AS | Assignment |
Owner name: MARVELL ASIA PTE, LTD., SINGAPORE Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:CAVIUM INTERNATIONAL;REEL/FRAME:053475/0001 Effective date: 20191231 |
|
| MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 12 |