Today s presentation. Git gdb Project 1

Similar documents
Programming Studio #9 ECE 190

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

CSCI0330 Intro Computer Systems Doeppner. Lab 02 - Tools Lab. Due: Sunday, September 23, 2018 at 6:00 PM. 1 Introduction 0.

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Software Development I

Lab 08. Command Line and Git

A short tutorial on Git. Servesh Muralidharan 4 March 2014

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

SECTION 2: HW3 Setup.

Using the Debugger. Michael Jantz Dr. Prasad Kulkarni

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

Intro to Github. Jessica Young

Windows. Everywhere else

CS3210: Tutorial Session 2. Kyuhong Park-- edited by Kyle Harrigan

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

SECTION 2: Loop Reasoning & HW3 Setup

SECTION 2: Loop Reasoning & HW3 Setup

CSE 331 Software Design & Implementation


Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

CSCI 350 Pintos Intro. Mark Redekopp

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

CSE 374 Programming Concepts & Tools

Lab6 GDB debugging. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Exercise Session 6 Computer Architecture and Systems Programming

CS354 gdb Tutorial Written by Chris Feilbach

Visualizing Git Workflows. A visual guide to 539 workflows

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :54:11 UTC

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :15:48 UTC

A Tutorial for ECE 175

CSE 391 Lecture 9. Version control with Git

Human-Computer Interaction Design

Table of Contents. Concepts

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

CSE 332: Data Structures and Parallelism Winter 2019 Setting Up Your CSE 332 Environment

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Lecture 2: Data in Linguistics, Git/GitHub, Jupyter Notebook. LING 1340/2340: Data Science for Linguists Na-Rae Han

CSE 344: Section 1 Git Setup for HW Introduction to SQLite. September 28, 2017

Section 9: Intro to Lab 5 CSE WI

git and the virtue of version control ECE /2/2015

Software Revision Control for MASS. Git Installation / Configuration / Use

Class Information ANNOUCEMENTS

EECS150 Fall 2013 Checkpoint: DVI Test Pattern

Human-Computer Interaction Design

Lab 8. Follow along with your TA as they demo GDB. Make sure you understand all of the commands, how and when to use them.

Using Git and GitLab: Your first steps. Maurício

ROS Qt Creator Plug-in. Release

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Version control CSE 403

Debug for GDB Users. Action Description Debug GDB $debug <program> <args> >create <program> <args>

Using Git to Manage Source RTL

CSE 351. GDB Introduction

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

Overview. 1. Install git and create a Github account 2. What is git? 3. How does git work? 4. What is GitHub? 5. Quick example using git and GitHub

CS 270 Systems Programming. Debugging Tools. CS 270: Systems Programming. Instructor: Raphael Finkel

Recitation #1 Boot Camp. August 30th, 2016

Reviewing gcc, make, gdb, and Linux Editors 1

Software Project (Lecture 4): Git & Github

Git. Presenter: Haotao (Eric) Lai Contact:

Tips on Using GDB to Track Down and Stamp Out Software Bugs

CSE 344: Section 1 Git Setup for HW Introduction to SQLite

ROS Qt Creator Plug-in. Release

Recitation #1 Unix Boot Camp. August 29th, 2017

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

cs 140 project 1: threads 9 January 2015

L Modeling and Simulating Social Systems with MATLAB

Lecture 3: Processing Language Data, Git/GitHub. LING 1340/2340: Data Science for Linguists Na-Rae Han

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins)

Understanding the Program Run

Github/Git Primer. Tyler Hague

HW 0: Executable CS 162. Due: January 29, 2018

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

Lecture 6 Remotes. Sign in on the attendance sheet!

Getting started with GitHub

18-600: Recitation #3

Version Control with Git ME 461 Fall 2018

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

FEEG Applied Programming 3 - Version Control and Git II

Version Control System GIT

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Tips on how to set up a GitHub account:

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

Scientific Software Development with Eclipse

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

1. Allowed you to see the value of one or more variables, or 2. Indicated where you were in the execution of a program

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

LAB #8. Last Survey, I promise!!! Please fill out this really quick survey about paired programming and information about your declared major and CS.

Django MFA Documentation

CS 261 Recitation 1 Compiling C on UNIX

ECE/ME/EMA/CS 759 High Performance Computing for Engineering Applications

Practical C Programming

Revision control. INF5750/ Lecture 2 (Part I)

LAB #8. GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:

CS314 Software Engineering Configuration Management

CS 390 Software Engineering Lecture 5 More Git

Version Control. Kyungbaek Kim. Chonnam National University School of Electronics and Computer Engineering. Original slides from James Brucker

Implement an ADT while using Subversion

Project 1. Fast correction

Transcription:

CS3214: Project 1

Today s presentation Git gdb Project 1

Project 1 Due Monday, February 20 at 11:59 PM Office hours are on course website Check Piazza for updates

Git

Version Control System Keep snapshots of your code Sync your code with other developers

Getting the code! Generate SSH keys, add to profile Step by step instructions: https://docs.gitlab.com/ee/ssh/readme.html Fork the repository here: https://git.cs.vt.edu/cs3214-staff/cs3214-esh MAKE IT PRIVATE Give developer access to your partner

Git basics Git keeps your projects history like a timeline Each point in the timeline is called a commit

Committing code Edit some amount of code You can view the status of files as you work git status to see file status (edited, staged, etc) Add changes to staging area: git add <file> Adds file to staging area git add. Adds all files to staging area When ready, commit them git commit -m message Commit with message

Push your changes to Gitlab git push Pull teammate s changes from Gitlab git pull Must pull before push!

Merge Conflict Resolution src/esh.c <<<<<<< HEAD // Author: Richard Feynman ======= // Author: Elon Musk >>>>>>> 52ea9255764f9b67b1ce91250e1d70ddca7ab2cc... Red: My changes Blue: Remote changes Perform necessary changes (don t forget to remove extra markup) and save file Stage changes ($ git add src/esh.c ) Commit changes ($ git commit ) Do another pull ($ git pull), just in case Push final changes ($ git push)

Git Commands - TL;DR Version Shows a list of files that have been modified; shows changes that have been staged and those that haven t $ git status Copies the specified repo to the current directory $ git clone <repo url> Add the specified files to the staging area $ git add <files> Commit all staged changes $ git commit -m commit message here Get changes from the remote repo (gitlab) and apply them to local copy $ git pull Push local changes to the remote repo (gitlab) $ git push Always do PULL before PUSH! Resources Official tutorial page: http://git-scm.com/docs/gittutorial Free Codeschool guided tutorial: https://www.codeschool.com/courses/tr y-git Walk-through tutorial: http://gitimmersion.com/index.html Also, google.com Seriously git is very popular you will probably find everything you need just by searching for it.

Questions?

GDB Debugging is key to success!

$ gcc -g Code MUST compile with -g for gdb to work properly! Also highly recommended to turn off optimizations (-O0) as compilers may shift around or optimize out code

$ gdb --args $ gdb --args program arg1 arg2 Is saved as part of BASH history Great alternative to run arg1 arg2

(gdb) layout src Show source code lines while debugging Far superior alternative to list Turn off with Ctrl-X+A

Backtrace and Frames (gdb) bt (show function call trace) (gdb) frame <num> After selecting a frame, you can print all variables declared in that function call

(gdb) call function() Make any function call while debugging Can also call print function() instead, will also show the return value Don t forget the ()!

Zoning in on the bug Scenario: your program breaks after a while Be clever with breakpoints (bp) (gdb) ignore 1 100 (ignore bp 1 100 times) (gdb) info b (show how many times bp was hit)

Zoning in on the bug

Watchpoints Very good at finding memory bugs watch *0xADDRESS Don t forget the *

GDB Commands - Summary $ gcc -g -O0 $ gdb --args (gdb) layout src (gdb) bt (gdb) frame <num> (gdb) info b (gdb) ignore <bp> <num> (gdb) watch *0x<address> (gdb) call function()

Graphical GDB For those of you who prefer graphical debuggers like Eclipse, try DDD

Questions?

Project 1

Base code - Already includes a parser! - Parser spits out hierarchical data structures -Most of the project will be playing with these data structures

esh_* data structures

List data structure Node contains (a pointer to) data vs Data contains node Retrieve data from a struct list_elem by using the list_entry macro struct esh_command *cmd = list_entry(e, struct esh_command, elem);

List data structure Regular linked list class listnode<t> { T data; listnode<t> next; }

List data structure struct list struct list_elem { struct list_elem *prev; struct list_elem *next; };

List data structure Don t: Use the same list_elem for multiple lists Forget to list_init Pass your struct list to a function (pass a pointer instead)

Questions?

Demo