14
Debugging with Zend Studio for Eclipse Hosted by: Peter B. MacIntyre, ZCE Senior Solutions Consultant, Center of Excellence http:// php.osscube.com

Debugging with Zend Studio for Eclipse

  • View
    2.870

  • Download
    5

Embed Size (px)

DESCRIPTION

Debugging with Zend Studio for Eclipse by Peter B. MacIntyre, ZCESenior Solutions Consultant, Center of Excellence

Citation preview

Page 1: Debugging with Zend Studio for Eclipse

Debugging with Zend Studio for Eclipse

Hosted by:Peter B. MacIntyre, ZCESenior Solutions Consultant,

Center of Excellence

http://php.osscube.com

Page 2: Debugging with Zend Studio for Eclipse

About Us

• Acquia• SugarCRM• MySQL • Zend• EnterpriseDB

• Research Triangle Park, NC

• Houston• London• Delhi

• Linux, Apache, MySQL, PostGre SQL PHP

• Rich Internet Technologies (Jquery, Flex, Prototype, Backbase, YUI-Ext)

• RHCE, LPI, MySQL and Zend Certified Professionals

• One of the Largest no. of certified LAMP professionals in World

• 200+ Technology Team

• Contribute Code, Write Books, Gurus People

Technology

Partners

Locations

2http://php.osscube.com

Page 3: Debugging with Zend Studio for Eclipse

Our Services

Product Engineering &

Application Development for

Web & Mobile

Customize, Implement & Support niche Open Source

Products

Open Source Training

Open Source Consulting

3http://php.osscube.com

Page 4: Debugging with Zend Studio for Eclipse

About MeOver 20 years in the IT Industry

Wrote “PHP: The Good Parts” - O’Reilly Press

Co-authored:• “Programming PHP 2nd Ed.” - O’Reilly Press• “Zend Studio for Eclipse Developer’s Guide” – Addison-Wesley

Tech Edited 10+ IT Books

Wrote Whitepaper for Zend on Team Development within Zend Studio

Working on a PHP Book for APress

Live in PEI, Canada

http://php.osscube.com 4

Page 5: Debugging with Zend Studio for Eclipse

Zend Studio Overview• Installation Options

– Browser Toolbar

• Integration with Zend Server (CE)• Views• Perspectives• The Debugging Perspective

– Debug as… PHP Script

http://php.osscube.com 5

Page 6: Debugging with Zend Studio for Eclipse

Debugging Perspective• Multiple Views available

– Debug (start / stop / restart)– Code editor– Breakpoints – Variables– Expressions (watches)– Browser Output (rendered HTML)– Debug Output (raw HTML)

http://php.osscube.com 6

Page 7: Debugging with Zend Studio for Eclipse

Moving through the code• F5 – Step Into• F6 – Step Over• F7 - Step Return• F8 – Run (to next breakpoint or to end of script)• Ctrl + F2 – Terminate Debug Session• Ctrl + R – Run to Line (cursor)

http://php.osscube.com 7

Page 8: Debugging with Zend Studio for Eclipse

Preparing the Session• Setting Breakpoints

– Double-click on line of code in the Marker Bar– Little blue dot appears indicating a breakpoint– Line number reference appears in the breakpoint view– Can be turned off / on in the breakpoint view

• Conditional Breakpoints– Can be set to trigger when a certain condition becomes true– Iteration # 7 of a for-next loop for example

http://php.osscube.com 8

Page 9: Debugging with Zend Studio for Eclipse

Looking at Debug Preferences• General Debug options

– Preferences -> Run/Debug• Launching• Perspective switching

• PHP Debug options– Preferences -> PHP -> Debug

• Debugger to use• Server to use – Zend Server CE in our case• Break at first line• Debug broadcast port: 20080

http://php.osscube.com 9

Page 10: Debugging with Zend Studio for Eclipse

Debugging Demo File• Walk through a debug session

– Look at the views– Set a watch value– Change a Variable value on the fly– Change code, save, and re-start debug session in the debug view

http://php.osscube.com 10

Page 11: Debugging with Zend Studio for Eclipse

Zend Browser Toolbar• Looking at the Firefox version

– Not ready for Version 5 of Firefox yet– Will recognize that Studio is running or try to launch it– Extra Stuff -> Settings

• Lots of options here• Path to Studio exe• Break at first line• Zend Debugger broadcast port: 20080

– Debug Menu Options• Current Page• Next Page• All forms• All Pages

http://php.osscube.com 11

Page 12: Debugging with Zend Studio for Eclipse

Zend Browser Toolbar Contd..

– Debug (launches debugger from the browser)– Search tool for on-line information– Profile – discussed next

http://php.osscube.com 12

Page 13: Debugging with Zend Studio for Eclipse

Profiling• A way to check on code efficiencies

– Bottlenecks, time wasting code

• Can be launched from browser or from within Studio• Has its own Perspective• Look at Profile results for demo code

http://php.osscube.com 13

Page 14: Debugging with Zend Studio for Eclipse

Thank you for your Time and Attention!

For more information visit http://php.osscube.com

Or drop-in an email to [email protected]

my Contact: [email protected]

14 14http://php.osscube.com