Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Debugging & Diagnostics with      Visual COBOL        Chris Glazier – SupportLine    Scot Nielsen – Product Management
This Session…• …is for developers• Something in here you can use next week   – or when you get really stuck• Want to fit i...
3 areas we’re looking at today1. Report generation tools   – What did my program do?2. Tracing tools   – Where did it all ...
Start with a little humor…(very little)                    There are 10 types of                    people in the world…  ...
Report generation tools                  5
Report Generation Tools –    MFSupportinfo•    When to use it?      – Opening an incident with SupportLine      – Need to ...
Report Generation Tools – Profiler (Performance Analysis)• When would it be used?   – Diagnose Performance issues   – Requ...
Report Generation Tools –Test Coverage•   When would it be used?     – Find out which lines of code have been executed    ...
Report Generation Tools –Fault Finder•   When would it be used?     –   For Production or Development debugging     –   Do...
Tracing Tools                10
Tracing Tools -Paragraph tracing using TRACE directive•   When to Use     – Shows execution flow of paragraphs & sections ...
Tracing Tools -Database / OpenESQL• ODBC Driver Statement Trace   –   Traces statements executed by the ODBC driver itself...
Tracing Tool –Consolidated Tracing Facility (CTF)•   What is it?     – Highly extendable application tracing engine     – ...
Architecture Diagram                             Config                              File                                 ...
Tracing Tools –XFHTRACE (File Handling)•   XFHTRACE – binary trace of file I-O     –   Traces all file I-O statements to b...
Tracing Tools –Fileshare Tracing•   Fileshare Server Configuration File – Add option “/tr f”     – Trace message written t...
Tracing Tools – Fileshare Tracing• FSView utility    – Command line tool or callable API    – FSVIEW lets you:        • vi...
Tracing Tool – 3rd Party Tools from SysInternalsProcess Monitor – PROCMON   •   Process Monitor can be downloaded for free...
Tracing Tool – 3rd Party Tools from SysInternalsProcess Explorer – PROCEXPL   •   Process Explorer can be downloaded for f...
The DebuggerHow many ways can you debug?•   Dynamic debugging•   Wait for animatable attachment•   Attach to Process•   Co...
Debugging and Diagnostics with Visual COBOL
Upcoming SlideShare
Loading in …5
×

Debugging and Diagnostics with Visual COBOL

1,727 views

Published on

Your application has just crashed. How do you figure out why and where it’s gone wrong? This session will walk you through some of the tips and tricks used by Micro Focus SupportLine and developers to diagnose application problems. We’ll cover a variety of debugging techniques, tracing, profiling and more. These techniques should be invaluable to COBOL developer using Net Express, Server Express or Visual COBOL.

  • Be the first to comment

  • Be the first to like this

Debugging and Diagnostics with Visual COBOL

  1. 1. Debugging & Diagnostics with Visual COBOL Chris Glazier – SupportLine Scot Nielsen – Product Management
  2. 2. This Session…• …is for developers• Something in here you can use next week – or when you get really stuck• Want to fit in as many different approaches to ‘finding the problem’ as we can in 45 minutes• We’ll use Visual Studio and Eclipse – Just about everything you can do in Net Express/Server Express• Back of this deck are all the things we’ve covered (and potentially those things we didn’t get to!) 2
  3. 3. 3 areas we’re looking at today1. Report generation tools – What did my program do?2. Tracing tools – Where did it all go wrong?3. Interactive debugging – Taking the bull by the hornsUse these for testing as well as debugProduction and development 3
  4. 4. Start with a little humor…(very little) There are 10 types of people in the world… Those who understand binary and those who don’t… 4
  5. 5. Report generation tools 5
  6. 6. Report Generation Tools – MFSupportinfo• When to use it? – Opening an incident with SupportLine – Need to know what Micro Focus products are installed – Available in Dev and Production products • How does it work? – creates Mfsupportinfo_machinename_timestamp.log – log file contains everything about your workstation configuration – Can be found in Visual COBOLbin folder starting with Visual COBOL 2.0 6
  7. 7. Report Generation Tools – Profiler (Performance Analysis)• When would it be used? – Diagnose Performance issues – Requires a development product• What information does it provide? – Gives the total execution time – By section and paragraph 7
  8. 8. Report Generation Tools –Test Coverage• When would it be used? – Find out which lines of code have been executed – Useful for Code Coverage Testing – Requires the Development product• What information does it provide? – Shows which statements have been executed – Identifies untested portions of the program – Accumulates results over multiple runs• How does it work? – Program must be compiled with TESTCOVER directive – TCReport utility creates HTML or text report 8
  9. 9. Report Generation Tools –Fault Finder• When would it be used? – For Production or Development debugging – Does not require the development product• What information does it provide? – Snapshot of the application at the time of failure – Open files, file buffers, loaded programs, environment settings, call stack, program memory data, working-storage and local storage• How does it work? – Triggered by abnormal program termination – configured using run-time tunables – Creates report on application state 9
  10. 10. Tracing Tools 10
  11. 11. Tracing Tools -Paragraph tracing using TRACE directive• When to Use – Shows execution flow of paragraphs & sections – Typically for batch applications – Usually a developer product• How to use – Compile using TRACE directive – READY TRACE statement turns on trace – RESET TRACE statement turns off trace – TRACE is displayed to screen as sections executed – OUTDD”filename” directive can redirect a file.
  12. 12. Tracing Tools -Database / OpenESQL• ODBC Driver Statement Trace – Traces statements executed by the ODBC driver itself – Can be used in Development or production – Use precompiler directive SQL(ODBCTRACE=ALWAYS) – Run application to create file MFSQLTRACE.LOG• OpenESQL Summary Trace – Creates pseudo-code summary of statements executed by OpenESQL. – Can be used in Development and Production. – Use precompiler directive SQL(TRACELEVEL=4) – Run application to create file OpenESQLTrace.processID.log. 12
  13. 13. Tracing Tool –Consolidated Tracing Facility (CTF)• What is it? – Highly extendable application tracing engine – Integrated with the components of Visual COBOL, Net Express and Server Express – Provides tracing for applications deployed under COBOL Runtime2010, Application Server and Enterprise Server environments• Why is it so important? – For any customer production issue, application tracing can be turned on by simply setting an environment variable – CTF is always enabled by default and deployed in an application; no special requirements such as compiler directives or development environment IDE is required – Provides a consistent interface for tracing across all products and environments – Customers can CTF-enable their own application components allowing them to configure and generate trace output along with MF component trace information 13
  14. 14. Architecture Diagram Config File Output Destinations TEXTFILE Emitter File Config APIs BINFILE BINFILE Engine Emitter CTFViewer TracerApplication Tracing IDEDBG APIs Visual Studio Emitter IDE Event Log Windows UNIX Syslog Consolidated Emitters Event or Emitter Unix Syslog Tracing Facility
  15. 15. Tracing Tools –XFHTRACE (File Handling)• XFHTRACE – binary trace of file I-O – Traces all file I-O statements to binary format – Often requested in cases of file corruption – Can be used in development or production – Save copy of current file that you wish to trace – Set option TRACE=ON in EXTFH.CFG – Set environment variable EXTFH to point to extfh.cfg – Run application to create binary file XFHTRACE.XFH• COBFHREPRO3 – Create readable text trace file report – run COBFHREPRO3 – Example: C:>cobfhrepro3 /gXFHTRACE.XFH /a /d /ntestfile.dat – Creates report output file xfhrepro.log• COBFHPRINT – Abnormal File Conditions – Prints contents of XFHLOG file – Abnormal file conditions are stored in XFHLOG 15
  16. 16. Tracing Tools –Fileshare Tracing• Fileshare Server Configuration File – Add option “/tr f” – Trace message written to screen – Trace messages written to file fsscreen.lst – Can severely impact performance so use only when debugging – F2 key used to toggle trace on and off 16
  17. 17. Tracing Tools – Fileshare Tracing• FSView utility – Command line tool or callable API – FSVIEW lets you: • view statistics produced by Fileshare • manage Fileshare servers remotely 17
  18. 18. Tracing Tool – 3rd Party Tools from SysInternalsProcess Monitor – PROCMON • Process Monitor can be downloaded for free from: http://technet.microsoft.com/en-us/sysinternals/bb896645
  19. 19. Tracing Tool – 3rd Party Tools from SysInternalsProcess Explorer – PROCEXPL • Process Explorer can be downloaded for free from: http://technet.microsoft.com/en-us/sysinternals/bb896653
  20. 20. The DebuggerHow many ways can you debug?• Dynamic debugging• Wait for animatable attachment• Attach to Process• Core Dump• Watch PointsDifferent approaches for different situations 20

×