Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 202 Computer Science II Lab Fall 2009 September 24.

Similar presentations

Presentation on theme: "CS 202 Computer Science II Lab Fall 2009 September 24."— Presentation transcript:

1 CS 202 Computer Science II Lab Fall 2009 September 24

2 Today Topics Debugger Sending email with pine enscript Flowchart

3 Debugger What is “debug” & “debugger” ? What the debugger does? Prepare the program for debugging. Basic gdb command

4 What is “debug” & “debugger”? Debug - Try to find out errors from your programs – Compile-Time Error – Runtime Error Debugger – Such as Gnu DeBugger (GDB) – Run another program under the debugger environment. – Allow users to see The value or address of particular variables The result of expression Where the program Crash Etc…

5 What the debugger does? Start the program, and Specify anything that might affect the program behavior Pause the program at a specific condition Observe the variable value or address during the program is running Analyze errors when the program is crashed Find out which statement causes the program crashed

6 Prepare Program for Debugging: Compile program – $ g++ -g -o cs202 cs202.cpp Run gdb – $ gdb cs202

7 Basic gdb command: run [command] [argument] break [place] delete [N] step next finish continue print [var] help [command] quit

8 Sending emails with pine C –to compose a message – Attachment: Ctrl + J or ctrl + T – Send: ctrl + X – Cancel: ctrl + c, c to confirm Q –to quit I –to – M to go to main menu

9 enscript In Linux, the enscript command changes a text file to PostScript format and then sends it to the printer enscript [options] testFileName – ‘-2’: Print two columns per page – ‘-r’: Rotate the output 90 degrees – ‘-2r’ – ‘Ecpp’: special formatting for C++ man enscript

10 Flowchart

11 Used to represent calculations and data manipulation. Used to represent a comparison with either a Yes/True result or a No/False result. Used to represent the input or output of data. Used to indicate the beginning or ending of a task. These connector lines are used to join the other symbols within the flowchart. The second and third ones are used in conjunction with a Decision Box. An algorithm is a detailed sequence of steps required to solve a problem. Algorithms can be represented in a graphical format called a flowchart. Flowcharts can be large, but they are often useful.

12 Flowchart


14 Questions?

Download ppt "CS 202 Computer Science II Lab Fall 2009 September 24."

Similar presentations

Ads by Google