Home

EPIC - User's Guide

image

Contents

1. Views Views support editors and provide alternative presentations as well as ways to navigate the informa tion in your Workbench For example the Navigator view displays projects and other resources that you are working with Views also have their own menus To open the menu for a view click the icon at the left end of the view s title bar Some views also have their own toolbars The actions represented by buttons on view toolbars only affect the items within that view A view might appear by itself or stacked with other views in a tabbed notebook You can change the layout of a perspective by opening and closing views and by docking them in different positions in the Workbench window Using Perspectives New Perspectives There are several ways to open a new perspective within this Workbench window e Using the Open Perspective button m on the shortcut bar e Choosing a perspective from the Window gt Open Perspective menu To open one by using the shortcut bar button 12 Eclipse Basics 1 Click on the Open Perspective button m 2 A menu appears showing the same choices as shown on the Window gt Open Perspective menu Choose Other from the menu E GM Resource ii CVS Repository Exploring a Java 5 Java Browsing En Team Synchronizing Other 3 Inthe Select Perspective dialog choose Debug and click OK select Perspective E CWS Repository Exploring Pt d Java Browsing fet Java Ty
2. Default dd FRECA En CVS Setup By default Eclipse stores Perl files as binary when they are added to the CVS repository To store Perl files as text ASCII select Window gt Preferences from the Eclipse menu and modify the Team gt File Content settings Add your Perl extensions pl pm etc by pressing the Add button and specify ASCII in the Contents column Setting Up Preferences gt Workbench File Content Ant b File extensions with known content Build Order b Help Extension Contents Add gt Install Update pl aia Change gt Java pm ASCII gt Perl EPIC prig Binary Remove Plug in Qevelaprnent ppt Binary gt Run Debug project ASCII be Spelling properties ASCII Team so Binary b cvs tif Binary File Content tiff Binary Ignored Resources as ASCII xls Binary bl ao o o Impart Export OK Cancel Setting Up the Debugger Setting up the debugger requires two steps 1 Define the Perl interpreter to use 2 Install the PadWalker Perl module Note It is possible to use the debugger without installing PadWalker but in this case local vari ables won t be shown Download the PadWalker module from CPAN http www cpan org PadWalker 0 10 http search cpan org 7Erobin Pad Walker 0 10 and install as described in the installa tion notes or use the installation manager provided with your Perl installation e g PPM for ActiveState installations If you are
3. Pattern for var 0 var lt max 55 varp cursor Insert Variable To insert pre defined variables press the Insert Variable button cursor The cursor position after editing template variable date Current date dollar The dollar symbol filename Filename interpreter Perl interpreter time Current time user Username year Current year In addition to pre defined variables the user can specify additional variables using the syntax varname which can be edited when the template is inserted When the first variable is inser ted variables with the same name will automatically be changed Using Templates Templates are invoked by typing some characters and pressing Ctrl Space Templates matching the typed characters will be displayed in a list A preview is also available 23 Working with the Perl Editor E for For loop or fvar 0 var lt max var foreach Foreach with array If the template contains user defined variables the user can press the TAB key to jump to the next variable after the template has been inserted for 5 0 var lt max var Source Formatter EPIC uses PerlTidy for source code formatting Perl Tidy is included in the EPIC package To format the source code select Source gt Format from the Eclipse menu or use Ctrl Shift F Perl Tidy settings can be changed in the Source Formatter preference page Note Source formatting might
4. enter the base directory that contains all CGI files or use the Browse button to select the appropriate directory e Extension for CGI files field this is a comma separated list of file extensions each starting mont with a used for CGI files in the project In the CGI Environment tab e CGlI Script Environment Variables field sorted list of environemt variables to be set for CGI scripts to be executed Use the following syntax to specify environment variables name value In the Browser tab there are two possible settings e Select Custom Browser specify the path to the browser executable and add the required command line parameters Use 1 as a place holder for the HTML file to be opened e Select Default System Browser to use the browser defined as default browser by your OS preferences Press the Apply button Perl Remote Debug a Perl Script on a Remote Ma chine Some points to consider You need a Perl interpreter installed on your target machine The EPIC debugger opens a network connection between local and remote host port number can be specified in the corresponding launch configuration So have a look at your firewall con figuration Scripts executed and code shown are from different sources EPIC displays the code present on your local machine and executes a copy of this code on the remote host So if you make changes within your project please make sure to transfer these changes to the remote hos
5. lf is 0 exits with the value of gt gt 8 backtick command status If 7 gt gt B is 0 exits with 255 Inside an eval the error message is stuffed into and the eval is terminated with the undefined value This makes die the way to raise an exception Code Assist Code Assist features try to assist the user during source code editing Note The features currently implemented in EPIC may not be fully functional but will be im proved in the future Variable Inspection When you press one of the auto completion characters the editor displays all defined vari ables in a list From the list you can select the variable that should be inserted in the source code 20 Working with the Perl Editor gt Fvariable amp Hhvariable2 Module Inspection The editor tries to display methods available in modules when the auto completion characters gt or are entered smmtp authi banneri beci bdatt bdatlast carp ect contess croak datat Note Currently indirect object invocations are not recognized by code assist This code block will not work Ssmtp new Net SMTP Ssmtp gt no content assist This one will work Ssmtp Net SMTP gt new Ssmtp gt content assist Task Markers Task markers are a very convenient way to add items to the Eclipse task list A task marker is gener ated when a TODO any text is found in the Perl sour
6. 38 RODIO ssl idiotas 38 Res Erp PIMC A E EA 39 Ena bline the RESP xp VIEW ae a 39 sine the ResExp Pi ii dd 39 Debugging Regular Expressions cccccececcececeececeeseacecenceceecessecceetseecessenes 39 KnowmBucs a Problems ss sd 41 Ps A at Gaeteenues 41 Problems showing Local Varnable s ae 41 A A l overt eros tnet EO 42 11 Plug in Installation Prerequisites Eclipse Perl Before installing the EPIC plug in Eclipse version 3 1 or higher has to be installed Eclipse comes in two flavors The SDK version contains Java IDE components and is much larger than the Platform version If you only want to use Eclipse as a Perl IDE the Platform version is suf ficient If you are in for Perl and Java coding use the SDK version Eclipse does not include a Java Runtime Environment JRE You will need a 1 4 1 level or higher Java Runtime or Java Development Kit JDK installed on your machine in order to run Eclipse Eclipse can be downloaded from www eclipse org http www eclipse org In order to have all EPIC features like Syntax Checking Source Formatting etc a Perl interpreter is needed In principle any Perl interpreter can be used To use debugging within Eclipse Perl version 5 8 x or 5 6 x is required For further requirements concerning the debugger see the section called Setting Up the Debugger Most nix Linux installations will provide Perl interpreters out of the box Perl for Windows can be down
7. editor remove templates Mame Context Description New A A a ce Name Context pen ki Description Pattern CI 1 E Insert Variable Preview Restore Defaults Apply How Templates are use is covered in Working with the Perl Editor The Templates Preference page allows the creation import and export of Templates Exported Templates are stored in XML format Associating Files with the Perl Editor Eclipse associates file extensions with editors If another plug in is installed the EPIC Perl Editor might not be used as the default editor when opening pl pm or cgi files To associate these file extensions with the Perl Editor choose Window gt Preferences from the Eclipse menu and select Workbench gt File Associations If the Perl extensions are missing they can be created by pressing the Add button Select the Perl Editor from the list and press the Default button Setting Up Preferences Workbench File Associations A ar i ppearance File types Capabilities Add Remove Colors and Fonts Compare P atch Editors File Associations pls We pm Keys Label Decorations Linked Resources prg pro project prop properties B props E p Y Local History Perspectives Search Startup and Shutdown Art Build Order Help Install Upedate Associated editors Yh Epic Perl Editor default dd PerlEPIC Remove Plug in Development Run Debug
8. from everywhere in your program e Local Variables variables declared with the keyword my more correctly called lexical vari ables in Perl To show lexical variables you need to install the Perl PadWalker module The PadWalker module has some problems which influence viewing of local variables Breakpoints View 36 Using the Perl Debugger IEE TIN eee Variables v 2 record ol line 10 O record pl line 9 rc ig Px record pl ai co to File Select All MM Enable Disable 2 Remove ao Remove All The Breakpoints view shows all breakpoints see the section called Breakpoints their state and location By selecting one or more breakpoints and invoking the context menu you can enable disable or re move these breakpoints Perl Expression View ro TI thest 1 p lt C ommandi 14 Finished gt Pr The Perl Expression View allows you to execute any valid Perl code within the current context of the program executed in debug mode E gt A A 1 Open the view Window gt Open View gt Other then EPIC gt Perl Expression View 2 Enter the code to execute 3 Press the symbol Stepping Through the Execution of a Perl Program When a thread is suspended the step controls can be used to step through the execution of the pro gram line by line If a breakpoint is encountered while performing a step operation the execution will suspend at the breakpoint and the step operation is e
9. take a while 1f the source code has a lot of lines Source Folding The editor supports folding of POD comments and subroutines 24 Working with the Perl Editor sub _reset_params my self shift seLlf PROXY self gt PARAMS PROXY self gt TIMEOUT self gt PARAMS gt TIMEOUT seLlf gt DEBUG self gt PARAMS DEBUG tself gt PARTNER_ID tself gt PARAMS gt PARTNER_ID seLlf gt LICENSE_KEY self gt PARAMS LICENSE_KEY self gt UNITS self gt PARAMS gt UNITS tself gt CC self gt PARAMS gt i CC self gt FORECAST self gt PARAMS gt FORECAST self gt LINKS self gt PARAMS gt LINKS return 1 Pb asub older_than my self shift my teaching timeframe shift my Hcachedl shift my row timel if cached lt i Snow caching_timeframe 60 1 return 1 else 4 return l b headl MAME Source folding can be disabled in the Editor preference page Note On big files source folding can decrease performance So if you experience slowdowns disabling source folding might help Refactoring Extract Subroutine Extraction of subroutines is supported by the use of the CPAN Devel Refactor module To extract a subroutine mark the code to extract and select Refactor gt Extract Subroutine from the popup menu 2 Working with the Perl Editor result s t q prin
10. the view tabs 16 Working with the Perl Editor Syntax Check EPIC performs on the fly syntax check of Perl source files In order for the Syntax Check to work the Perl Interpreter has to be set up correctly see Setting Up Preferences The Syntax Check is performed after a defined idle period after the user has stopped typing This idle period can be configured in the preferences When an error warning has been found the editor displays the appropriate icon in the annotation ruler the gray bar on the left side of the editor underlines the error in the source and inserts a marker into the Problems view A syntax check can be enforced by pressing Shift F5 It is also triggered automatically by saving a source file File Edit Source Navigate Search Project Run Window Help roe Dale lt O lt lE E Resource ifr Navi E E Y test pl E s World Ost Hello Sa print t ajm O test2 pl E project i d test pi 2 items E w 7 itest E Description Resource Tasks Console Explain Err 12 Problems ea gt Breakpoints PerlDoc O r T iletisi i Lae h syntax error at line 2 near t test pl BZ Cutline 2 S 20 A a he amp Scalar found where operator expected at line 2 near t test pl H Modules CF Subroutines Explain Errors and Warnings In addition to displaying warnings and errors the editor is capable of explaining th
11. unsigned feature can be ignored Eclipse has to be restarted after installation Now the EPIC installation should be complete Setting Up Preferences EPIC preferences can be accessed via Window gt Preferences from the Eclipse Menu General Preferences Workbench Perl EPIC Ant Build Order aeae M gt Help t Install Update Interpreter type Standard b Java Enable warnings bo Plug in Development Enable taint mode gt Run Debug Defaut Web Start page http gt Team 0 4 seconds W validate source when idle for a ii Apply Import Export OK Cancel Click on Perl EPIC to open the General Preferences page General preferences include the location of the Perl interpreter the option to enable warnings taint mode and the interval of the source validation The validation interval indicates when to start validation after the editor becomes idle Apart from the standard interpreter type the type can be switched to Cygwin In this case the INC path is mapped to be Cygwin compliant Note On slower systems it might be useful to disable automatic syntax validation Syntax valida tion is still possible by using the Shift F5 function key Code Assist On the Code Assist Preference Page the auto completion trigger characters are defined Normally it should not be necessary to change these values By default the editor suggests a list of already used variables when the
12. EPIC User s Guide Table of Contents Pisa Tostadas al a casio whats l E l Le ENAN e EA LEEI EE TOPIN TEELE E Rig canta an E E ETE aia l PPT BEEE A O A EE E E E ENA E EET ENE E E E AE l Considerations when using Cygwin sssssssseessserssssresssereessoreeseressssreesse l Instalati ON seas acerca EA EEEE E VE O ee seca l Settino UMPE OCES SD EE are 3 General Rreterences ita E R T A E A ESN 3 COLE AS a E EA E 3 EME ie ee EE ee e le ANE ed 4 SOULCE FOrmMaler atrial 5 ee A O 6 O roe Rn cena ren ne wie ree See ene eee we tee ey Meee Wee Vee eee Cnr cree eh ere ay Sree eee 6 Associating Files with the Perl Editor ill iio R 7 o A A E A 8 Seti s Up the DEDUS O 9 PE Bd A E II A A ner en ee eT eT 10 Creatine a Pro Eat o T 10 Perl Include Palancia tos lacada ile teGemiantae a adoci e decias 10 Converting am ERSS PrO ECE aa ae 11 ECHPSe Basics a iii oi i teens 12 POTS DECUNES patin is 12 VEW cenena io 12 Usinio Perspectives aeta e IN Maen N 12 NeW Pors PECIVO E at o lacus Gian alan 12 COMMPUTING Pers peces sandeces E AEE i 14 Savina User Detined Perspect Ves aore a 15 Resettio Perspectives nur A aaa 15 USINE VIEWS nte ole 16 Openino VIEWS ua e AT A A A RR 16 Movine and Docking VIEWS odas 16 W orkine with the Per Edt corinae rte rra al atera 17 DY Ee CC Ce E A ln Maman wae 17 Explain Erots and W arhin S ear taa 17 Open UB Dec laran On A ex cee Ae ales 18 Pa tods bs cil 19 QUICK RETENC stes dara tarden 20 A
13. O OR eS RN ee E E TSE ET VERDE Ree a Tarn Te 20 Nala IS Mas PCCHON italia 20 Module InispeCh ON nissan ii pi 21 Tas MARES a A A eat ORE 21 TEMplates a A earch A od ens 22 Dermo Templates caia its det litis toc Mat iiacee tees 22 Use Templates EEN 23 NOULCEPORMALlCl tcs E T 24 SOUECS LOLAS a 24 Refaccionaria dana cos 25 EXCES UDONDO bi 25 HEEE DO AA o T a a Zi OUE A a tae td napatater a tunienan hot dom aeaeasaae em eenane 21 sine the Perl DeDu eset eiie a E 28 launching Perl Pro crais it A A A A A ines 28 Launching Perl Programs in Run Mode oooococcccoccnconcnnoncnnoncononnoncnncnnononos 28 Re launchino a Perl Prostrani li A AAA A 29 EPIC User s Guide Creating Toauncn C ono ciscdas 30 Perl Local Running a Perl Script on the Local Machine 0000 30 Perl CGI Run Perl Programs in a CGI Environment ccceseeeee enone 31 Perl Remote Debug a Perl Script on a Remote Machine oooococccnccccccncnnonoso SA Bredi DOM tods 34 Seto Break MOMS da dai 34 Enabling or Disabling Breakpolnts ooooocccoconcnconcononcnncnncnnononnoncononnononos 34 Remove Brcak pots at A A AA EA 34 Views 10 the Debug PErspecave lios a 35 DEDICE N ICW a ds 35 Y able VIS Wa A AS 35 AS A A at iutene hata 36 PEPES On Vic Wes ll 37 Stepping Through the Execution of a Perl Program oooooococcoconcnnonconcnnoncnnoncnnons 37 SLE PLOVER a da 37 SUC PMN RN Pe lace tc E Sent amal A oka steaaeeneneten
14. ce code On deletion of the TODO com ment the task marker is also deleted 21 Working with the Perl Editor You can customize the keywords which begin task markers in the preferences see the section called Task Tags Me test pol Da test2 pl A Generate quickreference properties file from keyword list keywords txt by parsing perldoc output use strict my keywordFile keywords txt m my outFile quickreference properties open KEYWORDS keywordFile die Unable to open tkeywordFile n open OUT gt outFile die Unable to open foutFile n 212 TODO Check if perldoc is available foreach my keyword lt KEYWORDS gt chomp keyword CI Tasks 53 Console PerlDoc Explain Errors Warnings Problems Breakpoints aS 4 gt 78 1 terns 2 Description Resource In Folder Location Check if perldoc is available test pl test line 17 Templates Templates allow for easy insertion of predefined text segments In addition to normal text these seg ments can also include pre defined variables that are included at runtime as well as variables that are specified by the user when the template is inserted Defining Templates Templates are defined in the EPIC Preferences Window gt Preferences To define a new template press the New button 22 Working with the Perl Editor Name tor Context pen Y Description For loop
15. characters are typed To switch this feature off deselect the Inspect Variables check box Setting Up Preferences Workbench Code Assist All changes will take effect on next code assist action Auto activation characters gt lt a Inspect variables Ant Build Order Help Install U poate Java Perl EPIC Code Assist Editor Source Formatter Templates Plug in Development Restore Defaults Apply Import Export g oy Cancel Editor These options define the appearance of the Perl Editor the coloring of the Perl source code and how annotations are displayed Smart typing settings allow to switch auto completion of quotes parenthesis etc on or off Setting Up Preferences Editor Perl Editor settings Appearance syntax Annatations Smiart typing Displayed tab width 4 Insert tabs spaces on indent E Print margin colurnn 80 Use spaces instead of tabs Y Show overview ruler Show line numbers e Highlight current line Show print margin y Enable Source Folding Appearance color options Color MN Current line highhekt Print margin Restore Defaults Apply Source Formatter EPIC uses PerlTidy to format source code The Source Formatter Preference allows to specify Per ITidy command line parameters To get a description of available parameters press the Help key and select PerlTidy options from the popup menu Additional P
16. cute field select the Perl file to execute Note Only files associated with the Perl editor will be shown See the section called Associating Files with the Perl Editor for details e Commadline Parameters field enter command line parameters to pass to the selected Perl script 3 Press the Apply button Perl CGI Run Perl Programs in a CGI Environment Create manage and run configurations E3 HTML Startup File is invalid Configurations Name New configuration 1 ERs Webserver 1 Col Environment Ws Browser C Common see Ju JUnit H Je JUnit Plug in Test a Perl Cal HTML Root Directory F eclipse_3 eclipselruntime workspace Browse MB Mew configuration ce Perl Local DE E Remote Java Applicatior HTML Startup File F eclipse_3 eclipse runtime workspace Browse CGI Root Directory Fuieclipse_3Heclipseiruntime workspace Browse File Extension for CGI Files comma separated list e g cai pl cgi pl Mew Delete Apply Revert Debug Close 1 Enter the name for the launch configuration in the Name field 2 Inthe Web Server tab e HTML Root Directory field enter the base directory that contains all HTML files or use 31 Using the Perl Debugger the Browse button to select the appropriate directory e HTML Startup File field enter the file name to be shown in the browser after startup or use the Browse button to select this file e CGI Root Directory field
17. d can optionally be activated when a configuration is launched or when a breakpoint is encountered via the Debug preferences To indicate that a perspective switch should not occur select None Debug Debug ki Run hone ir Restore Defaults New Delete Apply Revert a l Select Run gt Run from the Eclipse menu 2 Within the appearing dialog select the configuration type e Perl Local Run a Perl script on the local machine e Perl CGI Run Perl programs in a CGI environment on the local machine e Perl Remote Run a Perl script on a remote machine and press the New button to create a new launch configuration 3 Adjust launch configuration attributes For details see the section called Creating Launch Con figurations 4 Press the Run button This executes the program The program s console output will be shown in the console window For Perl Local and Perl Remote configurations the console window also accepts keyboard input to be passed to the program If you switch to the debug view you have additional control over the execution of the program For details see the section called Debug View Re launching a Perl Program 29 Using the Perl Debugger The workbench keeps a history of each launched and debugged program To relaunch a program do one of the following e Select a previous launch from Run or Debug button pull down menus e From the menu bar select Run gt Run H
18. em in more de tail To get an Error Warning explanation right click the Error Warning icon and select Explain Errors Warnings from the context menu 17 Working with the Perl Editor Add RegExp Breakpoint Add Breakpoint Add Bookmark Add Task Enable QuickDiff shitt Ctrl c Sel QuickDiff Reference b gt Explain Errors WWarnings The explanation s will be displayed in the Explain Errors Warnings view Tasks Console Explain Er ZN Problems Breakpoints 0 syntax error at line 2 near t A fatal error trappable Probably means you had a syntax error Common reasons include A keyword is misspelled A semicolon is missing A comma is missing An opening or closing parenthesis is missing An opening or closing brace is missing A closing quote is missing Often there will be another error message associated with the syntax sd Open SUB Declaration Open SUB Declaration allows the user to search for the declaration of a specific SUBroutine while MoreS5QLlData my i start Undo Chrl z push Mlist i Revert File my f opened ji if opened print lt stI Cut Chez Copy Ctrl l Faste Ctrl print qqisa hre Shift Right if fopened Shift Left print lt st i Open SUB Declaration prin mj I print lt td gt lt td gt lt ir 18 Working with the Perl Editor The search first determines what is selected If no text is selected it attempts to
19. emove and select Remove Views in the Debug Perspective If any of the views described below is not visible you can open it using the Window gt Show View menu Debug View Debug x i Y Perl_Example_Configuration Perl Local Bla Perl Debugger Eg lt suspended gt Main Thread record pl line 5 Go Perl Debugger This view allows you to manage the debugging or running of programs in the workbench It displays the stack frame for the suspended threads for each target you are debugging Each thread in your program appears as a node in the tree It also displays the process for each target you are running If the thread is suspended its stack frames are shown as child elements Clicking on a stack frame takes you to the corresponding line in the Perl editor If necessary a new editor 1s opened automatic ally Variables View Breakpoints variables 4 4 76 la 20 a 0 a EZ Vertical View Orientation Qh b q a 12 Horizontal View Orientation ate D 0 Variables view Only i F E i STDIN filenol0 Wrap Text in Details Pane me H 256 A d La Wel Show Constants es 00 Mswin32 a Show Static Variables 0 y5 E show Qualified Mames eee A 7 de _ eee Show Mull Array Entries Java Primitives l aa O Perl bini iiperl exe hd C Perl bin perl exe e WeShow Perl internal Variables al w WeShow Global Variables w Wk Show Local variables a y 35 Usi
20. erlTidy options separated by space Options HTML Export options sel Source Formatter help topics Perl Tidy options Options toc Setting Up Preferences Note In order for PerlTidy to work correctly the Perl Interpreter Preferences have to be setup correctly see above Task Tags wy gt Workbench Task Tags gt Ant Build Order Define which strings mark task entries in your perl code gt Help Task Tags gt Java FIXME 7 Perl EPIC TASK Remove Code Assist Editor LI Source Formatter Ignore Case Templates al gt Plug in Development Allow leading whitespace Pp Run Debueg gt Team Restore Defaults Import Export Cancel In this section you can specify a list of keywords that act as markers for tasks inside comments in your perl code 1 e tags that mark the beginning of a task entry By default the words TODO and TASK mark the beginning of a task Check the Ignore Case option if you want EPIC to recognize task tags case insensitively e g todo my task If you select Allow whitespace task tags do not need to follow a comment sign directly e g TODO my task instead of having to write TODO my task See the section called Task Markers to see how to use Task Tags in the Perl Editor Templates Templates are a powerful tool to insert pre defined code snippets while working with the Perl Edit or Setting Up Preferences Templates Create
21. es 2 Expand Workbench and choose Perspectives 15 Eclipse Basics 3 From the Available perspectives list select the perspective you want to restore 4 Click Reset 5 Click OK Using Views Opening Views Perspectives offer pre defined combinations of views and editors To open a view that is not in cluded in the current perspective select Window gt Show View from the main menu bar You can create fast views to provide a shortcut to views that you use often After adding a view to the current perspective you may wish to save your new layout by clicking Window gt Save Perspective As Moving and Docking Views To change the location of a view in the current perspective 1 Drag the view by its title bar Do not release the left mouse button yet 2 As you move the view around the Workbench the mouse pointer changes to one of the drop cursors shown in the table below The drop cursor indicates where the view will be docked if you release the left mouse button To see the drop cursor change drag the view over the left right top or bottom border of another view or editor 3 When the view is in the location that you want relative to the view or editor area underneath the drop cursor release the left mouse button 4 Optional If you want to save your changes select Window gt Save Perspective As from the main menu bar 5 Note that a group of stacked views can be dragged using the empty space to the right of
22. f code is executed Regular expression breakpoints additionally extract the regular expression contained in the line of code they are associated with and enable you to debug the regular expression within the RegExp Plugin The following symbols are used to indicate breakpoints Status Line Breakpoint Regular Expression Break point pea Note Regular Expressions Breakpoints are still in an experimental state and will at the moment only work for expressions of the type EXpel lt delim gt regexp lt delim gt modifiers Modifiers are ignored Setting Breakpoints 1 Inthe editor area open the file where you want to add the breakpoint with the Perl editor 2 Directly to the left of the line where you want to add the breakpoint open the marker bar vertical ruler pop up menu and select Add Breakpoint or Add RegExp Breakpoint While the breakpoint is enabled thread execution suspends before that line of code is executed Enabling or Disabling Breakpoints Open the debug view open the Breakpoints view and use the check box in front of the break point to enable or disable the break point Removing Breakpoints There are two possible ways for removing a breakpoint 1 Right click on the breakpoint symbol in marker the bar vertical ruler of the editor pop up menu and select Remove Breakpoint 2 Open the debug perspective open the Breakpoints view right click the breakpoint you want to 34 Using the Perl Debugger r
23. find a subroutine name at the current cursor position The search will fail if no subroutine name is selected Due to the dynamic nature of Perl programs the search is not entirely reliable For subroutine names qualified by a package prefix an attempt will be made to locate the appropriately named module file using the INC path For unqualified subroutine names the search will first occur in the current ed itor and then extend to modules referenced by use statements If the subroutine declaration is found in a file inside workspace it will be highlighted in an existing or new editor Sub haa eRe if defined W fetchahead i return 1 if M fetchahead eurrentquery gt fetchrowlii Perldoc To retrieve Perldoc information select a keyword or text and choose Perldoc from the context menu or press Shift Ctrl H If nothing is selected an input dialog will appear Paste Shitt insert Shift Right Shit Left learn Compare With Replace With El Perldoc Shift Ctrl H ar Open SUB Declaration F3 Source Refactor b Input Methods If Perldoc entries are found they are displayed inside the Perldoc view 19 Working with the Perl Editor el 4 Tasks E Search print AR Highlight FILEHANDLE A FAO Module Source print AMS ASS LIST a print LIST print Prints a string or a list of strings Returns true if successful may be a scalar variable name in which case the variable contain
24. he RegExp Plug in The RegExp plug in is a small tool to debug regular expressions Ry RegExp E Sf amp Xx RegExp O ignore case multiline umped 1 56 1 Match text he quick brown fox jumped over the lazy dog To check if a regular expression is valid press the Run icon If the regular expression matches the text it will be signaled by a green icon If the regular expression contains brackets the matching character groups in text will be colored Regular expression shortcuts are available via the context menu Debugging Regular Expressions 39 RegExp Plug in The Single Step feature allows for a step by step inspection of the regular expression If no groups are defined by the user the RegExp Plug in tries to use logical blocks for matching otherwise the already existing groups are used The following buttons are provided Gh Reset clears all color markers Eb Step forward Step backward 40 Known Bugs amp Problems Debugger Problems Showing Local Variables The EPIC debugger uses the PadWalker module to show local or lexical variables PadWalker 0 10 does not display the values for lexical variables declared on top level outside of functions and blocks correctly if used in debugger mode To get around this problem put your code within a function dummy sub dummy lt YOUR CODE gt 4 References Part of this document is taken from the
25. istory or Run gt Debug History and select a previous launch from these sub menus e In the Debug view select a process that you want to relaunch and select Relaunch from the pro cess s pop up menu To relaunch the most recent launch do one of the following e Click the Run or Debug buttons without using the button pull down menu e Select Run gt Run Last Launched Ctrl F11 or Run gt Debug Last Launched F11 from the workbench menu bar Creating Launch Configurations Perl Local Running a Perl Script on the Local Machine m x amp Debug Create manage and run configurations E Startup File is not specified Configurations Mame New configuration Ju JUnit Ji JUnit Plug in Test ae YB Perl Cal Project Ek Perl Local ven Wk New configuration sual z b Perl Example Conic Besos m Remote Jawa Application File to execute 2 Run time Workbench aS SSS Sa de Configuration E Common Commandline Parameters Hew Delete Apply Revert Debug Close 1 Enter the name for the launch configuration in the Name field 2 Inthe Configuration tab 30 Using the Perl Debugger e Project field select the project to debug Note Only Perl projects projects associated with a Perl nature will be shown If the project you require is not shown see the section called Converting an Existing Project for adding a Perl nature to your project e File to exe
26. loaded from www activestate com http www activestate com Considerations when using Cygwin Make sure that the mount command is available and that it is in your system path As mount is a standard component of Cygwin you usually just have to add the cygwin bin directory to your sys tem path Installation The installation is done by using the Eclipse Update Manager The Update Manager connects to an EPIC Update Site http e p i c sourceforge net updates The Update Site can also be stored locally if no Internet connection is available and can be downloaded from the EPIC project page http e p i c sourceforge net After starting Eclipse select Help gt Software and Updates gt Find and Install from the menu Welcome Help Contents Tips and Tricks Cheat Sheets software Updates ed Find and Install About Eclipse Platform 33 Manage Configuration Plug in Installation Select Search for new features to install an press Next Press the Add Update Site button for a re mote installation via HTTP or the Add Local Site button if the Update Site is available locally When installing EPIC from remote enter any desired Name and the URL ht tp e p i c sf net updates Mame eric URL http e p i c si netupdates Tick the newly created site and press the Next button Follow the instructions of the install wizard The warning about the installation of an
27. nded Step Over 37 Using the Perl Debugger 1 Select a stack frame in the Debug view The current line of execution in that stack frame is highlighted in the editor in the Debug perspective 2 Click the Step Over button ay in the Debug view toolbar or press the F6 key The cur rently selected line is executed and suspends on the next executable line Step Into 1 Select a stack frame in the Debug view The current line of execution in that stack frame is highlighted in the editor in the Debug perspective 2 Click the Step Into button in the Debug view toolbar or press the F5 key The next ex pression on the currently selected line to be executed is invoked and execution suspends at the next executable line in the method that is invoked Run to Return 1 Select a stack frame in the Debug view The current line of execution in that stack frame is highlighted in the editor in the Debug perspective 2 Click the Run To Return button E in the Debug view toolbar or press the F7 key Execu tion resumes until the next return statement in the current subroutine is executed and execution suspends on the next executable line 38 RegExp Plug in Enabling the RegExp View To display the RegExp view select Window gt Show View gt Other from the Eclipse menu and se lect the EPIC gt RegExp view from the list 7 EPIC gt Explain ErrorsWarnings El PerlDoc Sd Perl Expression View Ri RegExp Using t
28. ng the Perl Debugger When a stack frame is selected you can see the visible variables in that stack frame in the Variables view The view shows the value of primitive types Complex variables can be examined by expand ing them to show their members Global variables including Perl internal variables are marked with an gt icon local variables with an aL icon If the value of a variable has changed since the last execution step it is displayed in red If changes in inner levels of complex variables have occurred the path to the changed variables is indicated via delta symbols Er 515 se ABRT undef ALRM undef i BREAK undef ERA BUS e Code 0x1deficc 0x1 deFl coeDB diesignaling This makes it possible to see these kinds of changes even if variables are collapsed Customizing the Variables View You can customize the presentation with the configuration menu Show Details Pane To show the detail pane select Vertical View Orientation or Horizontal View Orientation Select Variables View Only to disable it The details pane shows the value of primitive variables especially useful for string variables Select Variables to Display The variables view allows to select the following types of variables for displaying by checking the corresponding menu entry e Perl Internal Variables these are variables provided by the Perl interpreter like _ INC etc e Global Variables variables visible
29. official Eclipse documentation provided by the Eclipse project and IBM EPIC uses the public domain ANTLR 2 library developed by Terence Parr and others in the ANTLR project http www antlr org 42
30. or will jump to the appropriate position in the source code When the cursor is moved inside of a subroutine s definition the subroutine will become selected in the outline Subroutines named new will get a different icon OF Outline 3 gt 0 v H Modules So Net SMTP 7 F Subroutines a getMail a init E NEW 21 Using the Perl Debugger Launching Perl Programs You may launch your Perl programs from the workbench Programs may be launched in either run or debug mode e Inrun mode the program executes but may not be suspended or examined e In debug mode execution may be suspended and resumed variables may be inspected and ex pressions may be evaluated The environment a Perl program is to be executed in is defined via Launch Configurations A launch configuration defines e if the program is to be executed in a CGI or normal Perl environment e the host the program is to be executed on e the program to execute e execution parameters to pass e environment variables for CGI environment e configuration data for the web server used to provide the CGI framework Launching Perl Programs in Run Mode 28 Using the Perl Debugger Create manage and run configurations Configurations H Perspectives Ju JUnit af Ju JUnit Plug in Test These settings associate a perspective with Perl Local launch configurations 4 Y Perl CGI different perspective may be associated with each supported launch mode an
31. pe Hierarchy lt Plug in Development fs Resource default eo Team Synchronizing The Debug perspective is displayed 13 Eclipse Basics 4 There are several other interesting things to take note of e The title of the window now indicates that the Debug perspective is in use e The shortcut bar contains several perspectives the original Resource perspective the new Debug perspective and a few others The Debug perspective button is pressed in indicating that it is the current perspective e To display the full name of the perspective right click the perspective bar and check Show Text Debug Eclipse Platform File Edit Navigate Search Project Run Window Help ri T Fr er T F T a T me 5 In the shortcut bar click on the Resource perspective button The Resource perspective is once again the current perspective Notice that the set of views is different for each of the perspect ives Configuring Perspectives In addition to configuring the layout of a perspective you can also control several other key aspects of a perspective These include The New menu e The Window gt Open Perspective menu e The Window gt Show View menu e Action sets that show up on the toolbar Try customizing one of these items 1 Inthe shortcut bar click on the Resource perspective 2 Select Window gt Customize Perspective 3 Select the Commands tab 4 Check Launch and click OK 14 Eclipse Basics Cu
32. roject you require 1s not shown see the section called Converting an Existing Project for adding a Perl nature to your project e File to execute field select the Perl file to execute Note Only files associated with the Perl editor will be shown See the section called Associating Files with the Perl Editor for details 3 Local Host IP this is the IP address used by the remote host to connect to your local machine In most cases the default value is appropriate 4 Target Host Project Installation Path the location on the remote machine where your Eclipse project should be copied to 5 Port Port used to transfer data between local and remote host 6 Create Debug Package if checked a ZIP file containing all data to be transfered to the remote machine is created This file is stored at the location indicated in Debug Package File Path 7 Press the Debug button 33 Using the Perl Debugger 8 Extract the ZIP file to the location on your remote machine indicated in Target Host Project In stallation Path 9 Start the script start_epicDB pl on your remote machine it is located in the directory indicated by Target Host Project Installation Path 10 Enjoy debugging Breakpoints The Perl debugger supports line breakpoints and regular expression breakpoints Both types of breakpoints are set on an executable line of a program If enabled they suspend thread execution be fore the corresponding line o
33. roperties Add Perl Nature To remove the Perl Nature from a project select the project and select Remove Perl Nature from the context menu 11 Eclipse Basics Perspectives Each Workbench window contains one or more perspectives A perspective defines the initial set and layout of views in the Workbench window Within the window each perspective shares the same set of editors Each perspective provides a set of capabilities aimed at accomplishing a specific type of task or works with specific types of resources For example the Java perspective combines views that you would commonly use while editing Java source files while the Debug perspective contains the views that you would use while debugging Java programs As you work in the Work bench you will probably switch perspectives frequently Perspectives control what appears in certain menus and toolbars They define visible action sets which you can change to customize a perspective You can save a perspective that you build in this manner making your own custom perspective that you can open again later You can set your Workbench preferences to open perspectives in the same window or in a new win dow The main perspectives for developing Perl applications are bel Perl This 1s the main perspective for coding Perl scripts ED b Provides the main functionality for debugging and executing Perl scripts For details ebug see the section called Views in the Debug Perspective
34. s the name of or a reference to the De ee introducing one level of indirection NOTE If is a Variable and the next token is a term t may be misinterpreted as an operator unless you interpose a or put parentheses around the arguments RaFILEHANDLE is omitted prints by defauk to standard output or to the last selected output channel see select If LIST ts also omitted prints tothe currently selected output channel To set the default output channel to something other than STDOUT use the select operation The current value of if any is printed between each LIST term The current value of if any is printed after the entire LIST has been printed Because print takes a LIST serbia in tha PST ie awalhiaskard im lich errar amr srs Bultin Function Note Perldoc has to be installed and available in the system PATH otherwise this feature will not work Quick Reference Apart from Perldoc support a quick reference feature is available This feature has the advantage that no perldoc has to be installed on the system but does not provide as much information as perl doc To view the Quick Reference select a keyword and move the mouse pointer over the selection A tooltip with a short description of the keyword should appear open FILE file j unable to open file le LIST Outside an eval prints the value of LIST to STDERA and exits with the current value of errno
35. stomize Perspective Shortcuts Commands Select the command groups that you want to see added to the current perspective Resource The details Field identifies which menu items and or toolbar items are added to the perspective by the selected command group Available command groups Menubar Details Toolbar Details Cheat Sheets E Navigate toolbar Cy cvs LE Next Annotation a Mavigation g Previous Annotation L editor Presentation External Tools Dl Java Coding Java Debug O Java Editor Presentation DO Java Element Creation O Java Navigation O Java Open Actions lava Search L Junit Launch Open External Files L Profile Resource Navigation al I Use F2 to display the description For a selected command item 5 Observe that the toolbar now includes buttons for debug run launching e Search Pre FF a 6 After experimenting with the other options on the Customize Perspective dialog choose Win dow gt Reset Perspective to return the perspective to its original state Saving a User Defined Perspective If you have modified a perspective by adding deleting or moving docking views you can save your changes for future use 1 Switch to the perspective that you want to save 2 Click Window gt Save Perspective As 3 Type a new name for the perspective into the Name field 4 Click OK Resetting Perspectives To restore a perspective to 1ts original layout 1 Click Window gt Preferenc
36. t Debug result n if Unda Ctrit z Revert File Cut Shift Delete Copy Ctri Insert Paste Shitt insert Shift Right Shift Left F Open SUB Declaration Source Perldac Save Input Methods In the popup menu insert the name of the new subroutine and press Enter r F gt Subroutine Name Marne of Subroutine replace cancel The new subroutine will be placed at the end of the Perl script before __ EF ND___ section and the selection will be replaced with the subroutine call my replace debug result sub replace 4 my debug shift my result shift result s t g print Debug result n if debug return 1 Note The extraction might not work properly at the moment because the Devel Refactor module 26 Working with the Perl Editor is in an early stage of development With upcoming versions of the module this function should become more reliable HTML Export To export select Source gt Export gt HTML from the Eclipse menu and specify an output file HTML export settings can be changed in the Source Formatter preference page Note For HTML export to work a working Source Formatter is needed see the section called Source Formatter Outline View The Outline view displays packages and subroutines defined in the edited file Modules referenced by use statements are also shown When you click on a module or subroutine name in the outline the edit
37. t see below for further details This problem gets more significant for code modules provided by your Perl installation If mod ules on your local and remote machine differ debugging results may be quite meaningless So try to have the same Perl version installed on both machines and make sure all modules you re quire and are not part of your Eclipse project are identical INC path handling if the include path references directories within your project or directories that are linked into your projects EPIC will include these modules in the list of files to be copied to the remote host and adjust the INC path for your remote machine accordingly 32 Using the Perl Debugger Create manage and run configurations Jo Init 22 ME Configuration F ES Common p30 oo OSC Rs Es i a O E ico io oa nal a k a f ae PS Oda A ae w New configuration 1 aa feta cece acpi AES ar oO re AS Ms Web Shop ea oooO Rie De ite Ms web Shop 2 ere bo execute 222s e Bs Perl Local NN p Test Script E al E4 Perl Remote oi Local Hosts zi 192 168 1 11 i Remote Test O AA HS te E N Target Host Project Installation Path itmp af oh ine nates Gone E Debug Package File Path C tmpitest zip 1 Enter the name for the launch configuration in the Name field 2 Inthe Configuration tab e Project field select the project to debug Note Only Perl projects projects associated with a Perl nature will be shown If the p
38. using ActiveState 5 8 x on a Windows system you can download a pre compiled PadWalker module from the EPIC homepage http e p i c sourceforge net as the version provided by ActiveState doesn t seem to work for Perl 5 8 x but it does for 5 6 x Perl Projects Creating a Project Perl projects are created like any other project by selecting File gt New gt Project from the Eclipse menu selecta wizard SA lt gt Java Project 2 Plug in Project gt cvs b Java Y Perl Project p L Plug in Development Finish Cancel Follow the wizard s instructions to create your Perl Project Perl Projects appear with a custom folder icon in the Navigator view G Perl Include Path To add entries to a project s Perl Include Path INC right click on the project icon and select Properties If non absolute paths are entered they are interpreted as relative to the project folder Standard Ec lipse variables e g project_loc can be used 10 Perl Projects Info Perl Include Path Builders Perl Include Path Project References Spell Default Spell HTML JSP PHP Spell Perl Spell XML Add ta List mn Remove Selection ie Converting an Existing Project To add the Perl Nature to an existing project select the project in the Navigator and select Add Perl Nature from the context menu Refresh Close Project Bun H Debug a Team d Compare With d Restore from Local History P

Download Pdf Manuals

image

Related Search

Related Contents

Community Sea Ice Model (CSIM) User`s Guide Version 5.0  STAR  69500907 LFE03 mai13 rev00.indd  Heizöl- und Dieselpumpe - WilTec Wildanger Technik GmbH  Informacion para Respaldo –PLANILLAS Regiones  January 2012  Zanussi ZCE 7690 Use & Care Manual  全カタログ(一括) - 三興マテリアルサプライ  

Copyright © All rights reserved.
Failed to retrieve file