Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August,...

67
Getting Started with Colleague Studio Debugger Presented by: Katie Morgan Pacific University August, 2014

Transcript of Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August,...

Page 1: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Getting Started with Colleague Studio Debugger

Presented by: Katie Morgan Pacific University

August, 2014

Page 2: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

What is the CS Debugger?

• Graphical tool to observe your code in action• Step through line by line• Set breakpoints and jump from breakpoint to

breakpoint

• Combines Eclipse’s graphical interface with UniData’s built-in debugging software

Page 3: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Polls!

• How many of you have done development using Colleague Studio?– How many of those have used the Colleague

Studio Debugger?

• Bonus Question!– How many folks out there have ever used the

UniData command-line debugger?

Page 4: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

What can be debugged?

• Web forms

• Batch programs

• Subroutines

• UI forms

Page 5: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

What can’t be debugged?

• “Old-Style” Procedures• The ones that used to use PGDF

Page 6: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Overview of steps

1. Generate

2. Compile

3. Set breakpoints

4. Configure

5. Launch

Page 7: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

1. Generate

• Make sure your project is connected to the environment.

• Generate the process you want to debug.• Make sure there are no errors and that it

really generated.

Page 8: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

2. Compile

• Activate the Generated Code tab• For WebAdvisor, it’s the Generated Web Code

tab

• Click the “compile for debugging” button

Page 9: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Compile for Debugging

Page 10: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Set breakpoints

• Set some breakpoints (at least one, so it will suspend when debugger launches).• Make sure you’re on the Generated Code tab.• In the margin to the left of the line number,

either double-click or right-click and choose Toggle Breakpoint.

• To remove a misplaced breakpoint, just follow the same steps on the existing blue dot, and it will toggle off.

Page 11: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Add your breakpoints

Page 12: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Some tips about breakpoints

• The debugger will suspend immediately prior to the line with the breakpoint.

• Do not put a breakpoint on a “flow-control-only” type of statement.• END, END CASE, NEXT, RETURN, internal

gosub labels• Note that IF’s are fine, because they include

other operations (such as logical comparisons) to support the flow control.

Page 13: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

More tips about breakpoints

• This may be obvious, but… the debugger will only suspend if it actually reaches the line with the breakpoint.• If you have complicated logic, beware of

where you’ve placed your breakpoints, because it might not break when you want/expect it to.

Page 14: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Breakpoint limits

If you are UniData 7.2.3 or older:

You are limited to 6 active breakpoints.

Page 15: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

How many breakpoints?

• This is a UniData limitation that is resolved with 7.2.5 and higher.

• One point per active breakpoint (duh!) … plus• One point per process

Page 16: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

How many breakpoints?

• You can have more than 6 defined, and toggle whether they’re active or not.• In the development perspective, right-click the

breakpoint button and choose Disable/Enable Breakpoint.

Page 17: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Enabling/Disabling Breakpoints

Disabled Breakpoint

Enabled Breakpoint

Page 18: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

How many breakpoints?

• You can also add/remove breakpoints altogether when in the debug perspective.

Page 19: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Configure

• Launch configurations provide settings needed to run the process• How to connect

• WebAdvisor: Ports• UI: URL

• Timeout settings• Credentials• Application Initialization• Arguments

Page 20: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Configure

• There are three ways to configure a launch:• from the “bug button” menu• from the process explorer context menu• from the Run menu

Page 21: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Configuring from the “Bug Button” dropdown

Click the down arrow

Choose “Debug As”

Choose your process type

Page 22: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Configuring from the process explorer context menu

Right-click your process name

Choose “Debug As”

Choose your process type

Page 23: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Configuring from the Run menu

Click the Run menu

Choose “Debug As”

Choose your process type

Page 24: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Subroutine and batch configuration

Set argument values

Initialize the application

Adjust the timeout

Page 25: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Subroutine and batch configuration

Initialize the

application Enter credentials

Page 26: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

UI form configuration

Adjust the timeout

Page 27: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

UI form configuration

Enter UI credentials

Enter URL

Enter SOD password

Page 28: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

WebAdvisor form configuration

Adjust the timeout

Page 29: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

WebAdvisor form configuration

Modify the ports

Page 30: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing Existing Configurations

• Once you have your launch configuration built, next time you use Debug as… for that process, it will simply run the debugger.• To change arguments or other settings on a

future run, go into your launch configurations.

Page 31: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing Existing Configurations

• There are three ways to view existing configurations:• from the “bug button” menu• from the process explorer context menu• from the Run menu

Page 32: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing configurations from the “Bug Button” dropdown

Click the down arrow

Choose “Debug Configurations…”

Page 33: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing configurations from the process explorer context menu

Right-click your process name

Choose “Debug As”

Choose “Debug Configurations…”

Page 34: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing configurations from the Run menu

Click the Run menu

Choose “Debug Configurations…”

Page 35: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Viewing Launch Configurations

Make sure it’s the right one!

Page 36: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Launch

• Now you’re ready to launch.• Hit the green bug.• It will either take you directly into the debug

perspective, or it will prompt you and ask.• Once you’re in the debug perspective, you can still

switch between perspectives.

Page 37: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debug Perspective

Page 38: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debug view

Use these buttons to steer

See where you are

Page 39: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debug View

• Debug view is where you monitor and control the overall flow of your process.• Use buttons to start, stop and step through your

process.• Monitor your stack—see what processes and line

numbers are running.

Page 40: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Control Buttons

• “Clear” clears the perspective of all terminated launches.

• “Resume” runs the debugger until the next breakpoint.• runs to the end if there are no more breakpoints

• “Suspend” halts the debugger without ending the debug session.• but isn’t that what breakpoints are for?

• “Terminate” ends the debug session without executing any further.

Page 41: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Control Buttons

• “Step Into” can be used if the process line you’re on is about to call another process, and you want to debug line-by-line in that process.• The called process must be in your project for

this to work. To debug it, it must be compiled for debugging.

• If you already have breakpoints in that process, you can just use the play button (rather than Step Into), and it will suspend at the breakpoint

Page 42: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Control Buttons

• “Step Over” executes the line you’re currently on and suspends again.• This is for when you need to go line by line.• Also for when you need to execute a called

process without bothering to debug it.

• “Step Return” is used when you’re inside a routine called by another routine, and you want to execute that inner routine until it returns control to the calling process, and then suspend again.

Page 43: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Control Buttons

• “Drop to Frame”: Never used it.• “Use Step Filters”: ditto.

Page 44: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables and Breakpoints Views

Page 45: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables view

• Watch the values change as you step through.

• If the process is suspended, you can alter values here before resuming.

Page 46: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables view

Highlight an item here

Edit its value here

Page 47: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables view

Changed values are automatically highlighted

Page 48: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables view defaults

• Datatel has preset the variables view to include only local variables defined by the programmer, arguments and process variables (like MSG, etc).• Your v. and vl. variables will not show up.

Page 49: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Variables view defaults

1. Window menu -> Preferences2. Run/Debug -> Variable Filters

Check this box

Page 50: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Breakpoints view

• View all of your breakpoints and their statuses (enabled or disabled).

• Enable or disable breakpoints as needed.• This works “on-the-fly”.

Page 51: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Breakpoints view

Check/uncheck to enable/disable breakpoints

Page 52: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Process editor

Page 53: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Process editor

• All of the process editor tabs are available here. The generated code tab will be the focus by default. This tab is where you can• see where you currently are in your code.• view your breakpoints.

• You can add/remove and enable/disable here.

• change your code.• You will probably need to terminate your debug session.

Page 54: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Process editor

Highlights the suspended line

Page 55: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Outline view

Page 56: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Outline view

This is exactly like the outline tab in the default Colleague perspective.

Page 57: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Console view

Page 58: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Console view

• The console displays system messages, including errors and warnings.

Page 59: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Console view

Page 60: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

UI Form Debugger

• It opens UI Web when the debugging session is started.

• You must go to the screen you’re debugging (it doesn’t do this automagically).

Page 61: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Web Form Debugger

• It opens WebAdvisor when the debugging session is started.

• You navigate the login and menus until you arrive at the starting point for the form you’re debugging.

• If the form is in a chain, you will need to fill out the lead-in forms until it pulls up the form you’re debugging.

Page 62: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debugging in layers

• You may want to debug multiple “layers” of processes. Examples:• Your subroutine calls another subroutine• Your batch process runs based on a front-end

UI screen• Your web form writes data based on

subroutines

Page 63: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debugging in layers

1. Import all “layers” into your project

2. Compile all the processes for debugging

3. You can set breakpoints in multiple layers• If you’re on UniData pre-7.2.5, watch your

total number of active breakpoints!• When you’re running the debugger, it will

continue through the outer process, enter the nested process, and suspend at the first breakpoint in it.

Page 64: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Debugging batch processes

• Batch processes that run based on select statements can be an issue.• Debug them via the front-end screen

(provided it uses procedure hook, and is not an “old-style” procedure!), OR

• Build a wrapper to perform the selection and run the “real” batch process.

• Sample in proceedings

Page 65: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Try it!

• Benefits• Obviously, finding the logic errors• Being able to test numerous scenarios rapidly by

just changing values (arguments on the launch configuration or even variables in the variables tab) on the fly

• Being able to choose between stepping one line at a time or skipping around based on breakpoints

• And rapidly changing those breakpoints as needed on the fly

Page 66: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Questions & Answers

Page 67: Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.

Thank You!

Katie [email protected]

Please complete the online session evaluation formSession ID 1994

.  

© 2014 Ellucian. All rights reserved.