# DEBUGGING CODE # #------------------ # Perhaps you have been working on d0mino up until now. # Debugger licenses exist only on d0tvs, a scaled-down # version of d0mino. The same disk drives should be # visible on both machines, including home areas, but sometimes # the /prj_root upper directory structure is a little scrambled # for technical reasons. # # So you need to log into d0tvs and find your working area. # If you have been working on a linux machine, then in some cases # the totalview debugger is available and in other cases # it is not. # #------------------ # setup the debugger setup totalview # Run totalview, using your code as an argument. # If your code itself takes arguments, you need the # -a option. Say you are debugging trf_proptest: totalview ../bin/Linux2-KCC_3_4/trf_proptest -a trf_proptest.input & # After a moment, two new windows will appear. Patience # is a virtue! If code does not appear in the window, # you can type "f" and view the function "main". If # you have a choice of functions, usually you want the # second choice. #------------------ # Type "g" to begin the program. # Evaluate variables by right-clicking them. # Right-click on anything to "dive" into it. This # lets you evaluate variables or classes. # If you are evaluating a pointer, righ-click the # address and sometimes you get the actual object... # Type "n" to step from line to line # Type "s" to step INTO a line of code. This changes # the code that is displayed in the window. # Type "o" to run to the end of the subroutine and # out to the higher-level routine. # #------------------ # File scope is set in the upper left corner. If you have # a choice of code to look at, you can click that code # in this window. # To look at a different part of the program # from where you are, type "f" and the code you want. #------------------ # To set a breakpoint in the code you see, click the # line number on the left side. The bottom window # keeps track of your breakpoints, you can click on # them any time to see them. # This one is very useful! # To make a breakpoint conditional, right-click the # red breakpoint to launch a new window. Click the # "eval" box, and type in the text box something like: if ( myvar < 0.0 ) $stop # To set a breakpoint in code you can't see, type # "-b" and the class where you want the breakpoint. # You can always click on it in the bottom window if # you want to move it to a specific line number or whatever.