1 / 10

CSE 451 Section Winter 2006

CSE 451 Section Winter 2006. Reminders. Sign up for mailing list Read the web site Start reading the book Homework due Monday Check access to forkbomb.cs.washington.edu and your directory on it: /cse451/yourusername Read & start project 0. 451 Projects. 5 projects

oprah
Télécharger la présentation

CSE 451 Section Winter 2006

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. CSE 451 SectionWinter 2006

  2. Reminders • Sign up for mailing list • Read the web site • Start reading the book • Homework due Monday • Check access to forkbomb.cs.washington.edu and your directory on it: /cse451/yourusername • Read & start project 0

  3. 451 Projects • 5 projects • First two – individual, others – groups of 3 • Need basic C and UNIX skills • See helpful links on project page • Challenging • Don’t leave until last minute • Learn a lot of cool stuff

  4. Computing Resources • Develop your code on dedicated 451 Linux host: • forkbomb • Test your code on VMWare PCs in 006 • Do not use attu (except on project 0)

  5. First Project • Introduces C and Unix skills you’ll need • Show of hands – who’s done C? • Function pointers? • gdb? • typedef?

  6. UNIX & C help • Unix & C tutorial links on 451 projects page • What do I use to compile stuff in C? • gcc. For example, gcc –o shell shell.c –Wall –g • On project 0, we’ve provided a Makefile • Help! I’m crashing! • Use gdb to debug • gdb tutorials linked on web site • What do I use to type up my code? • I recommend emacs (look for emacs tutorials) • Others like VS.NET, vim

  7. Refreshing C skills; code quality • What’s wrong with this: char *buffer; buffer = malloc(100); strcpy(buffer, param); • How do we fix this?

  8. Debugging example

  9. C Debugging hint #define MYDEBUG // comment out to disable debugging #ifdef MYDEBUG #define DEBUG(x) x #else #define DEBUG(x) #endif … int main() { … printf(“normal output”); DEBUG(printf(“debug output“)); … }

  10. Debugging relevant on later projects • Just for printing: #ifdef MYDEBUG # ifdef __KERNEL__ /* This one if debugging is on, and kernel space */ # define PDEBUG(fmt, args...) printk(“myprg: " fmt, ## args) # else /* This one for user space */ # define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args) # endif #else # define PDEBUG(fmt, args...) /* not debugging: nothing */ #endif • works for both for kernel and userspace • To use: PDEBUG(“Testing two numbers: %d and %d\n”, num, num2);

More Related