1 / 14

CS 202 Computer Science II Lab

CS 202 Computer Science II Lab. Fall 2009 September 24. Today Topics. Debugger Sending email with pine enscript Flowchart. Debugger. What is “debug” & “debugger” ? What the debugger does? Prepare the program for debugging. Basic gdb command. What is “debug” & “debugger”?.

jerry
Download Presentation

CS 202 Computer Science II Lab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 202Computer 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. Flowchart • 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. 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.

  12. Flowchart

  13. Flowchart

  14. Questions?

More Related