13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Utility programs 251data types) the compiler can use to check a certain amount of logical consistency.Modern compilers are very helpful in reporting syntax errors in the source program.Some can automatically switch back to the editor at the point of error to allow the programmerto fix it and then continue. Compilers often pass over the program severaltimes, each time accomplishing a different transformation. The first pass might expandmacros, the second generate assembler code, the third improve the assembler code, andthe fourth create an object file. After the object files have been built for the modules thatconstitute a program, the linker combines them, searches libraries for missing names, andbuilds a load image. Tools like the Make utility of Unix accept a description of the wayscompilation units depend on each other. When one unit is modified, only the necessarymodules are recompiled and relinked, according to recipes supplied by the programmer.Testing the program has two stages.(1) Find the obvious errors.(2) Try enough cases to be convinced that the program will work in every case. Atest suite might be specified by the requirements developed in step 1.Most debugging of this sort uses extra output statements to report the inter state of theprogram. As erroneous outputs are found, more output statements are inserted to determinewhere the mistake was made. Suddenly, the programmer will get a flash of insight,determine the problem, and fix it.Debugging tools can be helpful during this stage. Debuggers are programs thatallow the programmer to step through the program under test little by little, examiningthe values in variables at any point during this execution. The debugger might be able todisplay the source program associated with the current point of execution, and it mightaccept source-language statements as commands. The amount of execution before theprogram is stopped can be specified by number of statements, number of executions of aparticular statement, or modification of a particular variable. Routines can be invokedout of order, and both variables and instructions can be modified. Part of a display maybe devoted to a continuous view of the variables the programmer wishes to examine.The program might be displayed from various points of view, including a flowchart, apicture of the run-time stack, and the original text.Maintaining a program is related to managing a large programming effort. Newversions of modules are created by different people at different times for different reasons.At any time it might be useful to roll back to a previous version to see how itworked before it was modified. If the file manager provides versions on files, that facilitycan be useful in maintaining a program. Utility programs have also been written thatprovide for ‘‘checking in’’ and ‘‘checking out’’ files. When a file is checked in, theseutilities prompt for a description of the most recent change and store it in the file forfuture reference. They also ensure that when several programmers are simultaneouslymodifying the program, the modifications are merged instead of having one overwrite theother.3.3 Data management

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!