Advanced%20UNIX%20progamming - PowerPoint PPT Presentation

About This Presentation
Title:

Advanced%20UNIX%20progamming

Description:

C-h t get tutorial. C-g cancel command. C-x C-c quit emacs. C-h help ... ddd, xxgdb, gdb. The code must be compiled with g option. The power of a debugger: ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 10
Provided by: asri9
Learn more at: http://www.cs.fsu.edu
Category:

less

Transcript and Presenter's Notes

Title: Advanced%20UNIX%20progamming


1
Advanced UNIX progamming
  • Fall 2002
  • Instructor Ashok Srinivasan
  • Lecture 1

Class web site http//www.cs.fsu.edu/asriniva/co
urses/aup-02
Acknowledgements The syllabus and power point
presentations are modified versions of those by
T. Baker and X. Yuan
2
Announcements
  • Pre-requisite
  • COP 4610 Operating systems
  • Collect syllabus
  • http//www.cs.fsu.edu/asriniva/courses/aup-02
  • Sign attendance sheet
  • Read the class web page and check your garnet
    account frequently
  • Use the following machines for programming
    assignments, as far as possible
  • program and linprog

3
Week 1 Topics
  • Course outline and policies
  • UNIX programming environment
  • Editors
  • C compilers and debuggers
  • Makefiles
  • Review some features of C
  • Header files
  • Command line arguments
  • Utilities
  • Review some UNIX system calls
  • system, etc

4
Course outline and policies
  • Read the syllabus
  • Important points will be mentioned in class

5
UNIX programming environment
  • Editors
  • C compilers
  • Debugger
  • Makefiles
  • make

6
Editors
  • vi, pico, emacs, etc
  • What is good about emacs?
  • emacs is more than just an editor
  • You can compile and edit within emacs
  • If you know lisp, you can expand its
    functionality
  • Some useful commands to get started
  • C-h t get tutorial
  • C-g cancel command
  • C-x C-c quit emacs
  • C-h help

7
C compilers
  • gcc, cc
  • Using ANSI C, the code must pass with flags
  • Wall ansi pedantic
  • with no warning messages
  • See example1.c
  • How can we fix warning?
  • Some examples
  • gcc g Wall ansi pedantic example1.c
  • gcc g c Wall ansi pedantic example1.c
  • gcc g example1.o
  • gcc g example.o -lm

8
Debugger
  • ddd, xxgdb, gdb
  • The code must be compiled with g option.
  • The power of a debugger
  • Finding the line that causes coredump.
  • See example
  • Break point, show value, change value, step,
    next, continue, print
  • Very efficient in debugging sequential code
  • Not very effective in debugging concurrent code
    (multiple threads, multiple processes)
  • Good software development practice You must have
    seen each line of your code execute in the
    debugger, at least once

9
Make
  • make -f makefileoption target
  • A tool to update files derived from other files
  • The default files for make are ./makefile,
    ./Makefile, ./s.makefile
  • Use the f option to specify some other file
  • make f makefile1
  • The makefile has three components
  • Macros define constants
  • Target rules Specify how targets are made
  • Inference rules Specify how targets can be made,
    implicitly. make will first check if a target
    rule applies, before using inference rules.
Write a Comment
User Comments (0)
About PowerShow.com