Debugging Cluster Programs using symbolic debuggers.

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Gnu Debugger (GDB) Topics Overview Quick Reference Card Readings: Quick Reference Card February 7, 2012 CSCE 212Honors Computer Organization.
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Utilizing the GDB debugger to analyze programs Background and application.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
CS 202 Computer Science II Lab Fall 2009 September 24.
Dr. Fabrizio Gala Dipartimento di Scienze di Base e Applicate Per l’Ingegneria – Sezione di Fisica Via Scarpa Rome, Italy 1.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Visual Basic Debugging Tools Appendix D 6/27/20151Dr. Monther Aldwairi.
JavaScript, Fourth Edition
Introduction Purpose Objectives Content Learning Time
Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
TotalView Debugging Tool Presentation Josip Jakić
DDT Debugging Techniques Carlos Rosales Scaling to Petascale 2010 July 7, 2010.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Active-HDL Interfaces Debugging C Code Course 10.
VB – Debugging Tools Appendix D. Why do we need debugging? Every program has errors, and the process of finding these errors is debugging Types of errors.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Debugging and Profiling With some help from Software Carpentry resources.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
1 SEEM3460 Tutorial Compiling and Debugging C programs.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
COP 3530 Spring 12 Discussion Session 1. Agenda 1.Introduction 2.Remote programming 3.Separate code 4.Compile -- g++,makefile 5.Debug -- gdb 6.Questions?
CMSC 202 Lesson 15 Debugging. Warmup  What is the bug in the following code? int* foo(int a) { return &a; }
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
HP-SEE Debugging with GDB Vladimir Slavnic Research Assistant SCL, Institute of Physics Belgrade The HP-SEE initiative.
 Wind River Systems, Inc Chapter - 4 CrossWind.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Gnu Debugger (GDB) Topics Overview Quick Reference Card Readings: Quick Reference Card February 4, 2010 CSCE 212Honors Computer Organization.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Using the GNU Debugger (GDB)‏ Techzemplary Pvt.Ltd February 24 th 2008 Pranav Peshwe.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
CSCI 4061 Recitation 2 1.
DEBUG.
Computer System Laboratory
CSE 374 Programming Concepts & Tools
Testing and Debugging.
Debugging with gdb gdb is the GNU debugger on our CS machines.
gdb gdb is the GNU debugger on our CS machines.
HP C/C++ Remote developer plug-in for Eclipse
Debuggers.
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
When your program crashes
Testing, debugging, and using support libraries
Debugging Visual Basic Programs
Module 6: Debugging a Windows CE Image
CSE 303 Concepts and Tools for Software Development
Debugging.
Makefiles, GDB, Valgrind
Presentation transcript:

Debugging Cluster Programs using symbolic debuggers

Debugging Code Careful review of your code Add debugging code to your code print statements at strategic locations in code remove later Use a symbolic debugger

Careful review of your code Rereading your code is often helpful Most parallel code errors are serial errors Compare your code to specs Take a break, review your code with a fresh brain Have someone else help you review your code

Common sources of errors Beyond what the compiler catches Usually run-time errors Incorrect use of pointers Point out of memory Reference should have used a pointer Referenced wrong variable Index initialized wrong, wrong exit condition

Common parallel errors Deadlock errors Receive before send Receive, but no send Incorrect arguments in MPI calls Mismatch on tags Mismatch of source/destination Misunderstanding of a the use of an argument

Add Debugging Code Add strategically placed code in your code to display critical information Watch values of variables as the program progresses Can create data-dump functions – call when you need them Have a way to remove them in production code

Add Debugging Code Can be difficult to get the right debugging code in the right place Does not scale well in parallel environment Can produce unmanageable or unintelligible output

Symbolic Debuggers Allow you to – inspect your code monitor its behavior modify the data values on the fly – as your code executes

gdb – GNU debugger

Frequently used GDB commands: break [file:]function - Set a breakpoint at function (in file). run [arglist] - Start your program (with arglist, if specified). bt - Backtrace: display the program stack. print expr - Display the value of an expression. c - Continue running your program (after stopping, e.g. at a breakpoint). next - Execute next program line (after stopping); step over any function calls in the line. step - Execute next program line (after stopping); step into any function calls in the line. help [name] - Show information about GDB command name, or general information about using GDB. quit - Exit from GDB.

gdb

Running in X-windows Linux (Unix) to Linux ssh to host, login and enter X application Other platforms (Windows, Mac) – Use X- windows server application VNC in most platforms VNC operates as a remote control application in Linux VNC operates as a X-windows server viewer for Windows, Macintosh, Solaris

Running in X-windows Using VNC ssh to host and login start vncserver pay attention to display id (:n) from your desktop run VNCViewer select host with correct display id After session kill vncserver – vncserver –kill :n (n is display id number)

Using VNC

x desktop with VNC

ddd – a graphic front end to gdb…

pgdbg Debugger from the Portland Group (PGI) Can use with PG compilers Can use with GNU compilers

pgdbg – common commands Back to text mode for a bit lis[t] [count | low:high | routine | line,count] -display lines from the source code file or routine att[ach] [ | ] - attach to a running process or start a local executable and attach to it, or start an executable on c[ont] - continue executing from the current location

pgdbg – common commands det[ach] – detach from the currently attached process halt – halt the executing process or thread n[ext] [count] – continue executing and stop after count lines of source code nexti [count] – continue executing and stop after count instructions

pgdbg – common commands q[uit] – terminate pgdbg and exit ru[n] [arg0 arg1 … argn] – run program from beginning with arguments arg0, arg1… s[tep] [count] – execute next count lines of source code and stop. Step steps into called routines s[tep] up – steps out of current routine stepi [count] – execute next count instructions and stop. Steps into called routines

pgdbg – common commands stepi up – steps out of current routine and stops Event command – break line | function - sets a break point to specified line or function. If no line or function specified lists existing breakpoints. A break point stops execution at specified point clear [all | line | func] – clears all breakpoints, or a breakpoint at line line or at function func.

pgdbg – common commands stop var - break when the value of var changes at a location watch expr – stops and display the value of expr when it changes track expr – like watch except does not stop execution trace var - displays a trace of source line execution when the value of var changes

pgdbg – common commands p[rint] var – displays the value of a variable edit filename – evokes an editor to edit file filename. If no filename given edits current file decl[aration name – displays the type declaration for the object name as[ign] var = expr - assigns the value expr to the variable var proc [number] – sets the current process to process number number

Resources gdb man gdb info gdb; Using GDB: A Guide to the GNU Source-  Level Debugger, Richard M. Stallman and Roland H. Pesch, July ddd man ddd VNC

Resources PGI Debugger User’s Guide PGI Users Guide, PGI 4.1 Release Notes, FAQ, Tutorials MPI-CH OpenMP HPDF (High Performance Debugging Forum) Standard