Kbase 8731: HLI debugging techniques
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
HLI debugging techniques
910322-sec01
INTRODUCTION:
=============
PROGRESS HLI enables you to embed SQL (Structured Query Language)
statements within a program written in a host language, such as C,
COBOL or Pascal, on certain hardware platforms. Some of the advantages
you have by using PROGRESS HLI are:
1. The flexibility of your host language to handle your
application's user interface and flow of control.
2. The power and simplicity of SQL to access and control
your data.
3. Support for Dynamic Embedded SQL. Dynamic Embedded SQL
allows your HLI application to form and execute SQL
statements at runtime.
What will be covered in this document are debugging techniques to
help the developer identify problems with their embedded SQL calls
or host language calls.
WHY YOU NEED TO DO THIS:
========================
With PROGRESS HLI you have to make sure you environment is properly
set up, make sure your host language syntax is correct and the
embedded SQL statements are correct. If any of these areas are not
correct you will receive an error condition at different stages
of building your PROGRESS HLI executable.
PROCEDURAL APPROACH:
====================
1. To make sure your environment is set up properly run the HLI
demo bytes that come with the PROGRESS product. They are located
in the /dlcload/uce subdirectory. There are 3 subdirectories off
of uce (hlic, hlicbl, hlipas). These are the subdirectories that
hold the corresponding host language demo bytes.
Copy them into your home directory. If your host language is C then
the 2 C programs you can test are called hlidemo.cc (static example)
or dyndemo.cc (dynamic example). Make sure your environment is set
properly. EXAMPLE:
DLC=/usr1/rdl6/rel/dlc
DLCDB=/usr1/rdl6/dlc4gl
PATH=:/usr1/rdl6/rel/dlc:/usr1/rdl6/rel/dlc/probin:.......
PROCFG=/usr1/rdl6/dev/full.cfg
PROEXE=/usr1/rdl6/dlc4gl/_progres
PROLOAD=/usr1/rdl6/rel/dlcload
PROPATH=:/usr1/rdl6/rel/dlc:/usr1/rdl6/rel/dlcload/devapp:
/usr1/rdl6/rel/dlcload/eucapp
PROSRV=/usr1/rdl6/dlc4gl/_mprosrv
PROTERMCAP=/usr1/rdl6/rel/dlc/protermcap
TERM=wy60
Preprocess the host langauge source code which has the embedded
SQL statements.
sqlcpp hlidemo.cc or sqlcpp dyndemo.cc
Now compile the preprocessed code.
cc -c hlidemo.c or cc -c dyndemo.c
Either run probuild or take one of the link scripts provided
(ldhlic) and add your object file to the list of objects.
Execute the link script, then run the new PROGRESS executable
against a database. If it runs successfully then you know your
environment is set up properly.
2. To make sure your embedded SQL statements are correct bring them
into the PROGRESS editor. If the statement executes properly in
the editor, then it will work in your host language. This is a
quick method of testing and debugging SQL syntax.
3. Another method of testing your embedded SQL statements, at
preprocessing time, precompile your code. At preprocessing time
if you precompile your code a PROGRESS procedure will be generated
for each unique embedded SQL call and then compiled. If there is
a problem with the embedded SQL statement, then the precompiling
will fail and you will know a SQL statement failed.
sqlcpp source-code-name -c -a applicationname -P
databasename -ld logical dbname
4. Incrementally build your PROGRESS executable. Add 1 object file
at a time to the PROGRESS executable.
5. At preprocessing time use the -debug argument. This will show
you what the quoted structures look like.
sqlcpp -debug source-code-name
6. Run your source code through a debugger and set break points to
determine where the failure is in your code.
REFERENCES TO WRITTEN DOCUMENTATION:
====================================
3GL Interface Guide - Using PROGRESS HLI chapter 3.
Progress Software Technical Support Note # 8731