CS255 - Programming Lab

Σχετικά έγγραφα
Section 8.3 Trigonometric Equations

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

Εισαγωγή Βασικές εντολές Εκτέλεση βήµα-βήµα Εξέταση/Ανάθεση GDB-101. Νίκος Ντάρµος Τµήµα Πληροφορικής Πανεπιστήµιο Ιωαννίνων

Συστήματα Διαχείρισης Βάσεων Δεδομένων

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

ΕΠΙΧΕΙΡΗΣΙΑΚΗ ΑΛΛΗΛΟΓΡΑΦΙΑ ΚΑΙ ΕΠΙΚΟΙΝΩΝΙΑ ΣΤΗΝ ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ

derivation of the Laplacian from rectangular to spherical coordinates

The Simply Typed Lambda Calculus

2 Composition. Invertible Mappings

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

VBA ΣΤΟ WORD. 1. Συχνά, όταν ήθελα να δώσω ένα φυλλάδιο εργασίας με ασκήσεις στους μαθητές έκανα το εξής: Version ΗΜΙΤΕΛΗΣ!!!!

(C) 2010 Pearson Education, Inc. All rights reserved.

Μηχανική Μάθηση Hypothesis Testing

ΑΓΓΛΙΚΑ IV. Ενότητα 6: Analysis of Greece: Your Strategic Partner in Southeast Europe. Ιφιγένεια Μαχίλη Τμήμα Οικονομικών Επιστημών

Πώς μπορεί κανείς να έχει έναν διερμηνέα κατά την επίσκεψή του στον Οικογενειακό του Γιατρό στο Ίσλινγκτον Getting an interpreter when you visit your

ΕΠΙΧΕΙΡΗΣΙΑΚΗ ΑΛΛΗΛΟΓΡΑΦΙΑ ΚΑΙ ΕΠΙΚΟΙΝΩΝΙΑ ΣΤΗΝ ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Ψηφιακή Οικονομία. Διάλεξη 10η: Basics of Game Theory part 2 Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

ΕΠΙΧΕΙΡΗΣΙΑΚΗ ΑΛΛΗΛΟΓΡΑΦΙΑ ΚΑΙ ΕΠΙΚΟΙΝΩΝΙΑ ΣΤΗΝ ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ

Right Rear Door. Let's now finish the door hinge saga with the right rear door

Example of the Baum-Welch Algorithm

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

ΑΓΓΛΙΚΑ Ι. Ενότητα 7α: Impact of the Internet on Economic Education. Ζωή Κανταρίδου Τμήμα Εφαρμοσμένης Πληροφορικής

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

Solutions to Exercise Sheet 5

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

The challenges of non-stable predicates

C.S. 430 Assignment 6, Sample Solutions

Business English. Ενότητα # 9: Financial Planning. Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων

Finite Field Problems: Solutions

Galatia SIL Keyboard Information

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

ΕΠΙΧΕΙΡΗΣΙΑΚΗ ΑΛΛΗΛΟΓΡΑΦΙΑ ΚΑΙ ΕΠΙΚΟΙΝΩΝΙΑ ΣΤΗΝ ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Section 7.6 Double and Half Angle Formulas

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Χρειάζεται να φέρω μαζί μου τα πρωτότυπα έγγραφα ή τα αντίγραφα; Asking if you need to provide the original documents or copies Ποια είναι τα κριτήρια

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Ψηφιακή Οικονομία. Διάλεξη 7η: Consumer Behavior Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

Areas and Lengths in Polar Coordinates

Section 9.2 Polar Equations and Graphs

Instruction Execution Times

ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ ΣΕ ΕΙΔΙΚΑ ΘΕΜΑΤΑ ΔΙΕΘΝΩΝ ΣΧΕΣΕΩΝ & ΟΙΚΟΝΟΜΙΑΣ

Srednicki Chapter 55

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

Strain gauge and rosettes

Approximation of distance between locations on earth given by latitude and longitude

ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ ΒΑΛΕΝΤΙΝΑ ΠΑΠΑΔΟΠΟΥΛΟΥ Α.Μ.: 09/061. Υπεύθυνος Καθηγητής: Σάββας Μακρίδης

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

Statistical Inference I Locally most powerful tests

ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΝΟΣΗΛΕΥΤΙΚΗΣ

How to register an account with the Hellenic Community of Sheffield.

τατιςτική ςτην Εκπαίδευςη II

Special edition of the Technical Chamber of Greece on Video Conference Services on the Internet, 2000 NUTWBCAM

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Potential Dividers. 46 minutes. 46 marks. Page 1 of 11

EE512: Error Control Coding

Partial Trace and Partial Transpose

Example Sheet 3 Solutions

Areas and Lengths in Polar Coordinates

Ψηφιακή Οικονομία. Διάλεξη 11η: Markets and Strategic Interaction in Networks Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

Homework 3 Solutions

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

Models for Probabilistic Programs with an Adversary

Υλοποίηση Δικτυακών Υποδομών και Υπηρεσιών: OSPF Cost

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ

Code Breaker. TEACHER s NOTES

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Matrices and Determinants

Εργαστήριο 9. Styling with Javascript

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Ηλεκτρονικοί Υπολογιστές IV

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

ΜΟΝΤΕΛΑ ΛΗΨΗΣ ΑΠΟΦΑΣΕΩΝ

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

Every set of first-order formulas is equivalent to an independent set

LESSON 14 (ΜΑΘΗΜΑ ΔΕΚΑΤΕΣΣΕΡΑ) REF : 202/057/34-ADV. 18 February 2014

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Congruence Classes of Invertible Matrices of Order 3 over F 2

ΕΠΛ221: Οργάνωση Υπολογιστών και Συμβολικός Προγραμματισμός. Εργαστήριο Αρ. 2

Math221: HW# 1 solutions

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

Ηλεκτρονικοί Υπολογιστές IV

Homework 8 Model Solution Section

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Ψηφιακή Οικονομία. Διάλεξη 8η: Producer Behavior Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

About these lecture notes. Simply Typed λ-calculus. Types

TMA4115 Matematikk 3

Επιβλέπουσα Καθηγήτρια: ΣΟΦΙΑ ΑΡΑΒΟΥ ΠΑΠΑΔΑΤΟΥ

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

ΟΡΟΛΟΓΙΑ -ΞΕΝΗ ΓΛΩΣΣΑ

Problem Set 3: Solutions

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ Ανώτατο Εκπαιδευτικό Ίδρυμα Πειραιά Τεχνολογικού Τομέα. Συστήματα Αυτομάτου Ελέγχου. Ενότητα Α: Γραμμικά Συστήματα

Transcript:

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ CS255 - Programming Lab Ενότητα: Tutorials Άγγελος Μπίλας Τμήμα Επιστήμης Υπολογιστών

Tutorial 3 - GDB Basics GDB, the GNU Project debugger, allows you to see what is going on inside another program while it executes -- or what another program was doing at the moment it crashed. GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: Start your program, specifying anything that might affect its behavior. Make your program stop on specified conditions. Examine what has happened, when your program has stopped. Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. The program being debugged can be written in Ada, C, C++, Objective-C, Pascal (and many other languages). Those programs might be executing on the same machine as GDB (native) or on another machine (remote). GDB can run on most popular UNIX and Microsoft Windows variants. Compile your program for gdb gcc -ansi -pedantic -Wall -g Run your program using gdb gdb myprogram GDB will start and you will see a prompt (similar to bash's). Type r -any_flags_needed any_args_needed to start the execution of your program. another alternative is gdb myprogram --args -myprograms_flags myprograms_args this way simply typing r will pass the arguments passed with --args to your program, saving you from some typing. Note that r and run are the same command. From now on we will refer to such shortcuts with the following syntax, r[un] Inspect code 2

l[ist] [lineno] will show you the programs source code around line lineno. If lineno is not given it will list around the current line. If you want to see the code of another file issue l[ist] filename:lineno Breakpoints Breakpoints help you inspect your program's state at certain points. Set To set a breakpoint at line lineno issue b[reak] lineno To set a breakpoint at every my_function invocation issue b[reak] my_function Similar to l[ist] if you want to set a breakpoint at another file issue b[reak] filename:lineno You can also set conditional breakpoints like this b[reak] my_function if a==0 && b==1 Show Use i[nfo] b[reakpoints] to list all available breakpoints. Use i[nfo] b[reakpoints] breakpointno to show information about breakpointno Enable/Disable You can enable and disable breakpointno issuing en[able] breakpointno and disable breakpointno Remove You can delete breakpointno issuing d[elete] breakpointno. Issue d[elete] to delete all available breakpoints. Backtrace bt or backtrace will show you the call stack that got you here. You can trace the call path that gave you a crash for instance (get a picture of how we got here). With backtrace you can investigate the arguments passed to the functions that finally called the function we where are running at the crash/breakpoint. Continue/Step/Next/Finish 3

When a breakpoint is reached the program's execution stops to let you inspect its state. To continue the execution you can use: 1. c[ontinue] and the program will execute till its end or till it reaches another breakpoint. 2. f[inish] to execute this function until it returns and stop again. 3. s[tep] to execute the next line 4. n[ext] similar to s[tep] but doesn't step into function calls. If a function call is reached it executes it and then stops. Note that s[tep] and n[ext] can be given an argument like s[tep] [count] and n[ext] [count]. This way you can tell gdb to execute this commands count times. Print From GDB you can print variables/structures, actually almost everything. Use p[rint] with C-like arguments. For instance p my_struct->value or even p my_struct and gdb will print all the struct's fields. Interrupt execution Pressing Ctrl-C will break the programs execution allowing you to inspect its current state (useful when you get stack in infinite loops). After you are done You can continue the program's execution like it was a breakpoint. Quit Just type q and Enter Notes Pressing the UP key goes through previously executed commands. Pressing Enter executes the last command. To visualize the debugging experience use gdbtui or gdb -tui or cgdb References: http://www.gnu.org/software/gdb/ Authored by: Foivos S. Zakkak Άδειες Χρήσης 4

Το παρόν εκπαιδευτικό υλικό υπόκειται στην άδεια χρήσης Creative Commons και ειδικότερα Αναφορά Μη εμπορική Χρήση Όχι Παράγωγο Έργο 3.0 Ελλάδα (Attribution Non Commercial Non-derivatives 3.0 Greece) Εξαιρείται από την ως άνω άδεια υλικό που περιλαμβάνεται στις διαφάνειες του μαθήματος, και υπόκειται σε άλλου τύπου άδεια χρήσης. Η άδεια χρήσης στην οποία υπόκειται το υλικό αυτό αναφέρεται ρητώς. Χρηματοδότηση Το παρόν εκπαιδευτικό υλικό έχει αναπτυχθεί στα πλαίσια του εκπαιδευτικού έργου του διδάσκοντα. Το έργο «Ανοικτά Ακαδημαϊκά Μαθήματα στο Πανεπιστήμιο Κρήτης» έχει χρηματοδοτήσει μόνο τη αναδιαμόρφωση του εκπαιδευτικού υλικού. Το έργο υλοποιείται στο πλαίσιο του Επιχειρησιακού Προγράμματος «Εκπαίδευση και Δια Βίου Μάθηση» και συγχρηματοδοτείται από την Ευρωπαϊκή Ένωση (Ευρωπαϊκό Κοινωνικό Ταμείο) και από εθνικούς πόρους. 5