The Perl Debugger Issac Goldstand Mirimar Networks

Slides:



Advertisements
Similar presentations
Utilizing the GDB debugger to analyze programs Background and application.
Advertisements

Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
CGI Programming.
CGI Programming Part 2. Input Tags Many different ways of getting data from the user. The tag is used most often. has a type attribute –Specifies the.
Error Trapping Part II Runtime Errors Error Handling Conclusion Questions Syntax Errors Error Categories Logic Errors Debugging Tools The Err Object Error.
CSET4100 – Fall 2009 Perl Introduction Scalar Data, Operators & Control Blocks Acknowledgements: Slides adapted from NYU Computer Science course on UNIX.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
Perl Functions Software Tools. Slide 2 Defining a Function l A user-defined function or subroutine is defined in Perl as follows: sub subname{ statement1;
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Scripting Languages Perl Chapter #4 Subroutines. Writing your own Functions Functions is a programming language serve tow purposes: –They allow you to.
2ex.1 Lists and Arrays. 2ex.2 Comments on exercises Always run your script with “ perl -w ” and take care of all warnings  submitted scripts should not.
Regular Expressions Regular Expression (or pattern) in Perl – is a template that either matches or doesn’t match a given string. if( $str =~ /hello/){
C6713 DSK Diagnostic Utility included with DSK....
Debugging JavaScript CS346. IE Javascript Debugging Aids From IE6 on default: no debugging aid for Javascript Change setting: – Tools > Internet Options.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
The Art of Debugging Shlomy Gantz 02/13/01MDCFUG.
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Building PERL Scripts on a Windows system* *and running those scripts on an Apache server!
Computer Programming for Biologists Class 10 Dec 5 th, 2014 Karsten Hokamp
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
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.
1 Session 3: Flow Control & Functions iNET Academy Open Source Web Programming.
Chapter 9: MuPAD Programming II Procedures MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Chapter 19: Visual Lisp. After completing this Chapter, you will be able to do the following: What is AutoLISP Launching Visual LISP Terminology and Fundamental.
Active-HDL Interfaces Debugging C Code Course 10.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Bioinformatics Introduction to Perl. Introduction What is Perl Basic concepts in Perl syntax: – variables, strings, – Use of strict (explicit variables)
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
Introduction to Perl Yupu Liang cbio at MSKCC
USING UNITY JAVASCRIPT. CONVENTIONS AND SYNTAX IN JAVASCRIPT Case Sensitivity All keywords like var or function must be in lowercase. All variable names,
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Introduction to CGI/Perl Please use speaker notes for additional information!
Introducing System Managers to Win32 Perl Programming Tim Christian College of Arts and Sciences Computing Support Services.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
TCL TK. Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS,
HPCC Mid-Morning Break Dirk Colbry, Ph.D. Research Specialist Institute for Cyber Enabled Discovery TotalView Parallel Debugger.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
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.
– Intermediate Perl 1/6/ Intermediate Perl - POD, parameters and configuration Intermediate Perl – Session 7 · POD –
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.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Visual Basic Integrated Development Environment (IDE) 56:150 Information System Design.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Copyright Ó Oracle Corporation, All rights reserved Debugging Triggers.
Bioinformatics Introduction to Perl. Introduction What is Perl Basic concepts in Perl syntax: – variables, strings, – Use of strict (explicit variables)
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Cool CF Debugging Shlomy Gantz 07/29/01CF_ODYSSEY.
 Wind River Systems, Inc Chapter - 4 CrossWind.
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.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Perl & TCL Vijay Subramanian, Modified from : perl_basics_06.ppt.
Lecture 9: Basic concepts of Perl Modules. Functions (Subs) In perl functions take the following format: – sub subname – { my $var1 = $_[0]; statements.
Introduction to Perl: Practical extraction and report language
PERL.
Barb Ericson Georgia Institute of Technology Dec 2009
Command Line Arguments
Debuggers.
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
This is where R scripts will load
How to debug a website using IE F12 tools
Debugging.
Makefiles, GDB, Valgrind
Presentation transcript:

The Perl Debugger Issac Goldstand Mirimar Networks

Credits / For more info  Based loosely on perldebtut  Also, don’t forget perldeb  Inside the debugger: h h or h [cmd]

Before we even get to the debugger…  Have you: Turned on warnings via use warnings or perl –w ? Do you use strict wherever possible? Does your script pass syntax checking ( perl –c )?

Example 1 – Hello World #!/usr/bin/perl $var1 = ’Hello, world!’; $var2 = “$varl\n”; print $var2;

When not to use the debugger  Not every case needs the debugger  The debugger would not have provided any significant help with the previous example  It is important to use other tools to find problems

What to use?  perl5db.pl – The command line debugger  GUI debugger – ptkdb  ActiveState – PDK, Komodo

Starting the debugger  Called by perl –d  Can be command line option: perl –d myscript.pl  …or part of the shebang line: #!/usr/bin/perl -d

The MOST IMPORTANT COMMAND ™

 q – Quits the debugger

The SECOND MOST IMPORTANT COMMAND™

 h – Displays help

The text debugger  Other common commands: v [line] – View around line (current line by default) x expr – Evaluates an expression (in list context) m expr – Shows methods that expr->can do s – Step into n – Step over c line – Set a “one time” breakpoint

Working with variables & symbols  M shows currently loaded modules + versions  S shows currently available subroutines  X / V shows variables in [current] package

Looking around  v – Shows a “block” of code, starting from current position  l – shows a single line of code, starting from current position  Either command takes an optional parameter of a line number . resets the line position to the current line

Practical use  Normal “command line” scripts  CGI scripts via –debug pragma or command arguments  mod_perl via Apache::DB  Not helpful for XSUB debugging

GUIs  ptkdb  IDEs  ActiveState PDK  I’ve personally found the PDK to be very weak (while somewhat simpler to navigate, set breakpoints, etc)

Komodo  ActiveState’s opensource-language IDE  Costs $$$  New version 3.0 just released with very complete GUI debug tools  Includes supports for watches, conditional breakpoints, immediate pane, etc  Includes support for simulating full CGI environment

The End Issac Goldstand Mirimar Networks