Application Debugging. Debugging methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic.

Slides:



Advertisements
Similar presentations
CS 202 Computer Science II Lab Fall 2009 September 24.
Advertisements

DEBUGGING IN THE REAL WORLD : Recitation 4.
Debugging CPSC 315 – Programming Studio Fall 2008.
CSE 303 Lecture 13a Debugging C programs
DASAN NETWORKS GPON Training
DDD tutorial A GDB Graphical User Interface. DDD Introduction If you find GDB difficult to use, try DDD DDD s GDB but with a Graphical User Interface.
Carnegie Mellon 1 Debugging and Version control / : Introduction to Computer Systems 12 th Recitation, Nov. 14, 2011 Slides by: Lin Xiao(lxiao)
HPCC Mid-Morning Break Interactive High Performance Computing Dirk Colbry, Ph.D. Research Specialist Institute for Cyber Enabled Discovery.
Windows Debugging Demystified
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.
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
F13 Forensic tool analysis Dr. John P. Abraham Professor UTPA.
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.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Debugging Cluster Programs using symbolic debuggers.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
IBM India Software Labs FFDC Using Crash Dumps – BoF07/09/04 © 2004 IBM Corporation First Failure Data Capture Using Crash Dumps: A BoF session Linux Symposium.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
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.
DDT Debugging Techniques Carlos Rosales Scaling to Petascale 2010 July 7, 2010.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
DEBUGGING. BUG A software bug is an error, flaw, failure, or fault in a computer program or system that causes it to produce an incorrect or unexpected.
Application Profiling Using gprof. What is profiling? Allows you to learn:  where your program is spending its time  what functions called what other.
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
Software Overview Environment, libraries, debuggers, programming tools and applications Jonathan Carter NUG Training 3 Oct 2005.
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.
Constructive Computer Architecture Tutorial 3 Debugging BSV Andy Wright TA September12, 2014http://csg.csail.mit.edu/6.175T01-1.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
Constructive Computer Architecture Tutorial 4 Debugging Sizhuo Zhang TA Oct 23, 2015T04-1http://csg.csail.mit.edu/6.175.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
 Programming - the process of creating computer programs.
Slide 5.1 © The McGraw-Hill Companies, 2002 CASE (Computer-Aided Software Engineering) l Scope of CASE –Can support the entire life-cycle l Graphical display.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
MP-PIPE for Soybean Proteome Brad Barnes 27/11/15 COMP 5704.
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.
Debugging Kate Hedstrom August Overview Think before coding Common mistakes Defensive programming Core files Interactive debugging Other tips Parallel.
17/02/2016S. Ponce / EP-LBC1 Debugging Under Linux Sebastien Ponce Friday, 8 March 2002.
Ladebug Kernel Debugging Tutorial Bob Lidral. Introduction Kinds of kernel debugging How to use Ladebug for kernel debugging Not how to debug a kernel.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
CMSC 104, Version 8/061L14AssignmentOps.ppt Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips Reading Section.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
CSE 332: C++ expressions Expressions: Operators and Operands Operators obey arity, associativity, and precedence int result = 2 * 3 + 5; // assigns 11.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
1 ENERGY 211 / CME 211 Lecture 14 October 22, 2008.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
INTRO. To I.T Razan N. AlShihabi
DEBUG.
14 Compilers, Interpreters and Debuggers
Debugger Ritu Chaturvedi
CSCI-235 Micro-Computer Applications
CSE 374 Programming Concepts & Tools
Crash Dump Analysis - Santosh Kumar Singh.
Chapter 2: System Structures
CSCE 212Honors Computer Organization
Debugging with gdb gdb is the GNU debugger on our CS machines.
gdb gdb is the GNU debugger on our CS machines.
Common C Programming Errors, GDB Debugging
When your program crashes
CSCE 212Honors Computer Organization
Debugging.
By Hugues Leger / Intro to GDB debugger By Hugues Leger / 11/16/2019.
Presentation transcript:

Application Debugging

Debugging methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware thus making it behave as expected.

Basic Steps Recognize that a bug exists Isolate the source of the bug Identify the cause of the bug Determine a fix for the bug Apply the fix and test it

Common Debug Method print statements

Preferable Debug Method Use a debugger  monitor an application program in situ  catch memory errors  can't attach print statements to a running program Graphical debuggers can provide visual aids

Available Debuggers dbx gdb PGI pgdbg Intel idb ladebug TotalView DDT Plus many others available

Step 1- Identify there is a bug If an error is severe enough to cause the program to terminate abnormally, the existence of a bug becomes obvious! if the error is minor and only causes the wrong results, it becomes much more difficult to detect that a bug exists  this is especially true if it is difficult or impossible to verify the results of the program Goal  identify the symptoms of the bug  under what conditions the problem is detected will greatly help the remaining steps to debugging the problem.

Example debug]$./dgemm_ex1 Segmentation fault

Steps to follow recompile to enable debug support often this option is '-g' check compiler documentation to be sure! all modules need to be compiled with this option re-run application

Steps to follow want failure to generate a core dump by default, core dumps are disabled on HPC machines re-enable with the command: ulimit -c unlimited

Example debug]$./dgemm_ex1 Segmentation fault (core dumped)

Core File contains the memory image of a particular process along with other information such as the values of processor registers very useful debugging tool name format is: core.PID

Using the Core File examine its contents with a debugging tool such as gdb command format is: gdb exe_file core.PID if application compiled with '-g' then odds are good you will be taken directly to the offending source line

Example debug]$ gdb./dgemm_ex1 core GNU gdb Red Hat Linux ( EL4rh) Copyright 2004 Free Software Foundation, Inc.. Core was generated by `./dgemm_ex1'. Program terminated with signal 11, Segmentation fault. Reading symbols from BLAH BLAH BLAH. Loaded symbols for /lib64/ld-linux-x86-64.so.2 #0 0x d5534d03f in _IO_vfscanf_internal () from /lib64/tls/libc.so.6 (gdb) where #0 0x d5534d03f in _IO_vfscanf_internal () from /lib64/tls/libc.so.6 #1 0x d in fscanf () from /lib64/tls/libc.so.6 #2 0x c25 in main (argc=1, argv=0x7fbffff648) at /home1/nucci/proj/debug/dgemm_ex1.c:41

Live Example and Hands-On DDT Tutorial