C Programming Review & Productivity Tools



Similar documents
Debugging with TotalView

Module 11 Setting up Customization Environment

[PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14]

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

MPLAB Harmony System Service Libraries Help

An Introduction to Mercurial Version Control Software

PetaLinux SDK User Guide. Application Development Guide

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

An Introduction to Mercurial Version Control Software

Building Embedded Systems

Analysis Programming

Content. Development Tools 2(63)

Distributed Version Control

MatrixSSL Getting Started

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

LLVMLinux: Embracing the Dragon

Version Control with Git. Dylan Nugent

CMPT 373 Software Development Methods. Building Software. Nick Sumner Some materials from Shlomi Fish & Kitware

Using Git for Project Management with µvision

Dalhousie University CSCI 2132 Software Development Winter 2015 Lab 7, March 11

STLinux Software development environment

Building Software Systems. Multi-module C Programs. Example Multi-module C Program. Example Multi-module C Program

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

#pragma omp critical x = x + 1; !$OMP CRITICAL X = X + 1!$OMP END CRITICAL. (Very inefficiant) example using critical instead of reduction:

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

Introduction to Version Control

Netscape Internet Service Broker for C++ Programmer's Guide. Contents

Easing embedded Linux software development for SBCs

Multi-Threading Performance on Commodity Multi-Core Processors

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

Testing for Security

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

Version Control with Subversion

SQLITE C/C++ TUTORIAL

[Handout for L6P2] How to Avoid a Big Bang: Integrating Software Components

Multi-threaded Debugging Using the GNU Project Debugger

RTOS Debugger for ecos

How To Understand How A Process Works In Unix (Shell) (Shell Shell) (Program) (Unix) (For A Non-Program) And (Shell).Orgode) (Powerpoint) (Permanent) (Processes

Microsoft Visual Basic Scripting Edition and Microsoft Windows Script Host Essentials

CS 253: Intro to Systems Programming

PPC s SMART Practice Aids Common Questions and Answers

Derived from Chris Cannam's original at, an.

Course Development of Programming for General-Purpose Multicore Processors

Version Control with Git. Kate Hedstrom ARSC, UAF

Introduction to Programming System Design. CSCI 455x (4 Units)

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

GPU Tools Sandra Wienke

iphone SDK Enrolled students will be invited to developer program Login to Program Portal Request a Certificate Download and install the SDK

Continuous Integration/Testing and why you should assume every change breaks your code

Streamline Computing Linux Cluster User Training. ( Nottingham University)

Lab 2-2: Exploring Threads

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

PKCS #11 opencryptoki for Linux HOWTO

Interfacing an HTML Form to the ez80f91 MCU

SysPatrol - Server Security Monitor

Frysk The Systems Monitoring and Debugging Tool. Andrew Cagney

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

10CS35: Data Structures Using C

Lab 4: Socket Programming: netcat part

OPERATING SYSTEM SERVICES

Cosmic Board for phycore AM335x System on Module and Carrier Board. Application Development User Manual

Brent A. Perdue. July 15, 2009

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011

Binary compatibility for library developers. Thiago Macieira, Qt Core Maintainer LinuxCon North America, New Orleans, Sept. 2013

ADL User Guide for Open AT V4.10

Braindumps.C questions

Eclipse Help

School of Computing and Information Sciences. Course Title: Computer Programming III Date: April 9, 2014

Version Control with Git

Environnements et Outils de Développement Cours 6 Building with make

Parallel Debugging with DDT

How to Write a Simple Makefile

Source code management systems

CANnes PC CAN Interface Manual

See the installation page

Lab 5: BitTorrent Client Implementation

Designing and Implementing a Server Infrastructure

Version control with GIT

The Asterope compute cluster

Distributed Version Control with Mercurial and git

Illustration 1: Diagram of program function and data flow

Price: see your VeriFone sales representative. Per student, Excluding VAT.

Andreas Burghart 6 October 2014 v1.0

Red Hat Developer Toolset 1.1

A SIMPLE WAY TO CAPTURE NETWORK TRAFFIC: THE WINDOWS PACKET CAPTURE (WINPCAP) ARCHITECTURE. Mihai Dorobanţu, M.Sc., Mihai L. Mocanu, Ph.D.

PKI, Git and SVN. Adam Young. Presented by. Senior Software Engineer, Red Hat. License Licensed under

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Red Hat Linux Internals

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

CSI 402 Lecture 13 (Unix Process Related System Calls) 13 1 / 17

Mercury User Guide v1.1

Stack Allocation. Run-Time Data Structures. Static Structures

6.S096 Lecture 1 Introduction to C

Monitoring, Tracing, Debugging (Under Construction)

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Chapter 13 Storage classes

ERIKA Enterprise pre-built Virtual Machine

Transcription:

Review & Productivity Tools Giovanni Agosta Piattaforme Software per la Rete Modulo 2

Outline Preliminaries 1 Preliminaries 2 Function Pointers Variadic Functions 3 Build Automation Code Versioning 4

Preliminaries What are we looking at in this course? Using TCP/IP in application software The Client-Server model Application protocols standard: remote login, file transfer, email, etc. non-standard using standard protocols for non-standard uses: telnet towel.blinkenlights.nl

Preliminaries What are we looking at in this course? Using TCP/IP in application software The Client-Server model Application protocols But we also need good programming skills! C programming language Programming well Shell scripting Programming productivity tools (make, gdb)

Organization of the course Syllabus The Practice of Programming Network Administration and Security TPC/IP & Client-Server Applications Advanced topics (kernel modules, wireless networks) Labs & Projects Both are optional Labs: try out SW development practices, building an application Project: a more advanced design & development task, replacing the exam

Evaluation Written exam Each module is assessed separately Projects Time for exam: 90 Structure: one/two exercises per syllabus item Multiple batches of projects First batch will be presented on 12/4 Second batch will be presented near the end of the course Project replaces one (and only one) module Must be taken by two (or three) students, all are responsible for the entire work

Function Pointers Variadic Functions 1 Preliminaries 2 Function Pointers Variadic Functions 3 Build Automation Code Versioning 4

Function Pointers Preliminaries Function Pointers Variadic Functions Generalities Functions are not variables, per se But, you can declare function pointers A first example i n t p l u s ( i n t a, i n t b ){ return a+b ; } i n t a p p l y ( i n t x, i n t y, i n t ( f u n c p t r ) ( int, i n t ) ) { return f u n c p t r ( x, y ) ; }

Function Pointers Usage Preliminaries Function Pointers Variadic Functions Switch-like constructs Generic functions Callbacks calc.c qsort.c obj.c Let s have a look at these examples...

Unions Function Pointers Variadic Functions What A type for representing multiple types Why Forces alignment to the longest type Need fixed size structures with variable content Example typedef union { char chr ; i n t i t g ; char s t r ; } d a t a ;

Type Qualifiers Function Pointers Variadic Functions Volatile Forces all accesses to be in memory Needed when the compiler may be unaware of external accesses to a variable v o l a t i l e i n t a ; Const The variable is considered read-only by the compiler const i n t a = 1 ;

Storage Class Specifiers Function Pointers Variadic Functions auto Standard automatic variable register: subclass where address cannot be taken static Applied to variables: variable persist between function calls Applied to functions: function is not seen outside the compilation unit extern Applied to variables: variable declared outside the function Applied to functions: function defined in another compilation unit

Variadic Functions Handling variable parameters in C Function Pointers Variadic Functions stdarg.h Defines the following macros: va list : data type void va start ( va list args, last): initialize scanning, starting from parameter last void va end( va list args): end scanning type va arg( va list args, type): get next argument, casting to type type

Build Automation Code Versioning 1 Preliminaries 2 Function Pointers Variadic Functions 3 Build Automation Code Versioning 4

Build Automation Code Versioning Tasks Compiling Building Versioning There are several solutions for each task!

Build Automation Code Versioning Solutions Compiling: gcc, icc Building: make, SCons, autoconf, CMake Versioning: mercurial, git, svn, cvs : gdb, idb We focus on the GNU tools

Build Automation GNU make Preliminaries Build Automation Code Versioning GNU make Basics Variables Rules Patterns, wildcards and much more Today, we will look at a few basics only!

Build Automation GNU make Preliminaries Build Automation Code Versioning Automatic Variables $@ The file name of the target $< The name of the first prerequisite $? The names of all prerequisites newer than the target $ˆ The names of all prerequisites $+ Like above, but keeps duplicates Variable definition objects = *.o objects := $(wildcard *.o)

Build Automation GNU make Preliminaries Build Automation Code Versioning Rules %.o: qsort: %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ qsort.c gcc -o qsort qsort.c Variable definition Generic vs specific rules Prefer specific to generic: shortest stem rule

Versioning Mercurial Preliminaries Build Automation Code Versioning A Quick Primer create a repository copy a (remote) repository add files to repository commit changes to changeset push changes to other repository pull changes to other repository merge different history lines hg init directory hg clone address hg add files hg commit -m comment hg push address hg pull address hg merge

GNU Debugger (gdb) Preliminaries Build Automation Code Versioning A Quick Primer Compiling for debugging: -g flag Setting arguments and running: set args, run Multiple threads: info threads, thread n Breakpoints: break at function, line or address, can be conditional or thread-specific Continuing execution: continue (to next breakpoint), step (to next source line), next (to next line in same stack frame) Get info about the program: info Examine the stack: bt, up, down Examine data: print

Concluding Remarks What to do now? Programming in C with dynamic libraries Write a dynamic library supporting a data type (e.g., lists or trees) Use it in implementing a simple program (e.g., indexing Setting up a code project Using versioning Creating makefiles