TEMENOS T24 Debugging T24 Server 'How To' Guide
User Guide
Amendment Amendme nt History:
Revision
Date Amended
Name
Draft
July 2006
Alex Leggett
nitial version
!"!
January 200#
$ony %orter
&ro'ser de(ug section
!"2
)e(ruary 200#
Description
Add +&A,- environment vari ria a(le settin ing g and Dave *earing additional example for . varia(les"
No part of t/is document may (e reproduced or transmitted in any form or (y any means electronic or mec/anical for any purpose 'it/out t/e express 'ritten permission of $-1-N, Holdings N3" 4opyrig/t 2005 $-1-N, Holdings N3" All rig/ts reserved"
De(ugging $2 ,erver 7Ho' $o7 *uide Table of Contents
$-1-N, $2 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ! De(ugging $2 ,erver 7Ho' $o7 *uide"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ! 8ser *uide""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ! -xecutive ,ummary"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 9 ,upport """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 9 De(ugging ptions""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 8sing t/e De(ugger in $2""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" # 8seful RAD De(ugger 4ommands"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" !!
$-1-N, $2 8ser *uide %age 2 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Ee!utive Su""ar# $/is document gives a (rief introduction to t/e met/ods '/ic/ can (e used to trac do'n logical and data;related errors in T24" $/is mainly concerns t/e use of t/e and 3isual De(ugger '/ic/ is (ased on t/e RAD De(ugger" $/e use of ,-A$ J&"$1-, and ot/er useful files are also discussed /ere"
Su$$ort $ec/nical ssues 'it/ RAD De(ugger ? eg commands not 'oring ? consult +&A,- support $ec/nical ssues 'it/ 3isual De(ugger and all ot/er issues ? eg not displaying source code ? c/ec $$, and create ,ervice Report as necessary
$-1-N, $2 8ser *uide %age 9 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Debugging O$tions $/e approac/es taen to trac do'n errors in an application can vary almost as muc/ as t/e types of pro(lem found" Ho'ever some of t/e most useful general approac/es are given /ere" @/ile it may (e tempting sometimes to start from t/e (eginning of t/e application and step t/roug/ t/e code line (y line t/is can (e a time;consuming and frustrating approac/" n many cases it 'ill lead to t/e de(ugger (ecoming out of step 'it/ t/e source code after some time due to t/e large num(er of called routines in T24 and t/e necessity of compiling routines in your account in order to (e a(le to de(ug t/em" T24 8pgrades deliver t/e o(+ect code in pre;compiled li(raries
$-1-N, $2 8ser *uide %age of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
%inding t&e $roble" f t/e pro(lem is /appening during validation of record entry t/en t/e (est place to start to loo is during t/e 4H-4")-LD, andEor 4R,,3AL stages of processing" $/e diagram (elo' s/o's t/e process flo' for t/e standard T24 $emplate:
-nter Application 4/ec: D
s 1essage G 73AL7
Define %arameters Read Record Just %arametersF
es
es
f )unction G 7D7
N2
es
No
s 1essage G 7A8$7
$erminator
s 1essage Repeat No
f )unction G 7R7
es
Call Matrix Update
es
Call Matrix Alter
4/ec: Reversal nitialise
4/ec: Record
No es
1ain %rogram Loop
4/ec: Delete
Process Display
Get Function/Record ID
No
1esagge Loop No
is 1essage 7R-$7
es
$erminator
No
nput 1odeF
No
Aut/ 4ross 3al
2verrides
&efore Aut/ @rite
&efore 8nAut/ @rite
Call Auth Write
Call UnAuth Write
After Aut/ @rite
After 8nAut/ @rite
es
Ne' )unctionF
Field Input
Field Display
es Has 1essage (een set
4/ec: )unction
s )unction 7-7 or 7L7
4ross 3al
)ield Navigation Loop
No
es
Call Function Display
No
s 1essage G I-RR2RI
4/ec: )ields es ncrement )ield %osition
)ield Navigation Loop No 1esagge Loop
1ain %rogram Loop
$emplateE*2,8& es External Suroutine
Figure 1 Flow-Chart showing Execution of the T24 Template
Note t/at t/ere are some older applications 'it/in T24 t/at do not follo' exactly t/e same logic" $/ey also may not /ave t/e )-LD"D-)N$N, 4H-4")-LD, 4R,,3AL or 3-RRD-, functionality separated into separate su(routines" f you are not sure '/at is /appening and T24 appears to
$-1-N, $2 8ser *uide %age 5 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
%ro(lems 'it/ 3ersions are often due to A%s attac/ed to t/e 3ersion 'it/in t/e follo'ing fields: •
AUT.NEW.CONTENT ? Routine to automate field entry
•
VALIDATION.RTN ? Routine to validate a field
•
INPUT"ROUTINE ? Routine run on commit of record (efore file 'rites Bpre;aut/orisationC
•
AUTH"ROUTINE ? Routine run on aut/orisation of record
•
ID"RTN ? Routine to validate item;id
•
CHECK"REC"RTN ? Routine to control field attri(utes
•
AFTER"UNAU"RTN ? Routine run on commit of record after file 'rites Bpre;aut/orisationC
•
BEFORE"AUTH"RTN ? Routine run on aut/orisation of record (efore file 'rites
•
WEB"VAL"RTN ? Java -&"A% record routine to validate on @e( ,erver
%ro(lems 'it/ enuiries are usually due to A%s attac/ed to t/e enuiry" $/e fields containing t/ese are:
•
BUILD.ROUTINE ? t/e routine '/ic/ (uilds t/e enuiry data
•
ENQUIRY.NAME ? t/e drilldo'n
•
CONVERSION B'/en field content prefaced 'it/
Note t/at t/ere may also (e ;Descriptors in t/e ,tandard ,election record '/ic/ invoe +&A,routines"
$-1-N, $2 8ser *uide %age 6 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Using t&e Debugger in T24 De(ugging Applications in T24 is fairly straig/tfor'ard and can (e done using eit/er t/e 3isual De(ugger or t/e RAD de(ugger" f you are de(ugging <4lassic= it is simply a matter of setting a D-&8* statement '/erever it is reuired and t/en 'aiting until you /it it" ou can also of course press 4trlM4 to invoe t/e de(ugger at any time" De(ugging standard T24 using (ro'ser /o'ever reuires a little more initial 'or"
Setting u$ isual Debugger n order to use 3isual De(ugger you 'ill need to /ave installed T24 $ool&ox and set it up correctly Bsee t/e T24 ,etup T24 $ool&ox and T24 Dev,tudio
Figure 2 Visual Debugger waiting for a DEB! con"ition
$-1-N, $2 8ser *uide %age # of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Setting u$ a Debugger Session
f you 'ould prefer to use t/e RAD De(ugger rat/er t/an t/e 3isual De(ugger you 'ill need to set up a $-LN-$ session '/ic/ points to t/e de(ugger port" ou must also /ave t/e follo'ing environment varia(le set in your unix profile export J&A,-OD-&8*O%%-G! As 'it/ 3isual De(ugger you 'ill need to
! ! ! !
"#$%# "#$%( "#$%* "#$%,
n t/is case since $4,erver 'as started up on Dev;%series! all t/at needs to (e done is to create a ne' $-LN-$ session pointing to Dev;%series! port num(er 50#P2" f t/e $-LN-$ session is correctly set up and pointing to t/e de(ugger port it s/ould loo somet/ing lie t/is:
Figure # Debugger $ession
$-1-N, $2 8ser *uide %age P of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Debugging (obs in t&e Close of )usiness $/e 4lose of &usiness processing in T24 can eit/er (e run automatically or in de(ug mode Bsometimes referred to as
Figure 4 Changing the number of agents while C%B is running
Note t/at once a D-&8* statement is /it t/e output of t/e RAD de(ugger Band t/e inputC 'ill /appen in t/e 'indo' of '/ic/ever t,ABsC /it t/e D-&8* statement" $/e t,1 'ill also declare t/e agent to (e
$-1-N, $2 8ser *uide %age of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Debugging )rowser *elated +ssues Due to issues 'it/ t/e 3isual De(ugger t/is is not recommended for general use (y t/e (ro'ser team" 8se instead a Reflections session on t/e de(ug port as s/o'n in t/e ,etting up a De(ugger ,ession" As soon as a de(ug statement is /it in t/e &ro'ser a de(ug prompt 'ill (e displayed in t/e Reflections session" &e a'are t/at you can=t (acspace or use your cursor eys ? so (e careful of starting 'it/ t/e letter < V+02*+t2on +n* c+n#es o? te Reco*. Set ERROR to $ 2? 2n eo. 34&5 DEBU34&@ IF R.NEWRP.RECORD.STATUS IHLD THEN < CI'$33(;>4% s 34%3 -OSUB CLEAR.CHILD.TN.IDS 34%$ END < CI'$33(;>4% e 34%& IF R.NEWRP.CALCULATION.LINK THEN < EN'$3333@;4 S 6BASE *e!"##e7,
$o see t/e 1L (eing passed to t/e (ro'ser put a D-&8* at t/e top of ),"R-S8-,$"1ANA*-R and vie' t/e $H-"1,* varia(le"
$-1-N, $2 8ser *uide %age !0 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Useful *,+D Debugger Co""ands 4aveat: ,ome of t/ese commands are not supported in 3isual De(ugger" At t/e time of 'riting t/is document t/ere is no official list of supported RAD commands for t/e latest version of t/e +&A,RAD De(ugger /o'ever t/is document 'ill (e updated '/en suc/ details (ecome availa(le"
Co""and S#nta 4ommand
-xplanation
Qcommand
,pa'n anot/er process and execute t/e command" $/e previous command t/us used can also (e recalled and executed (y t/e QQ command"
4trlMD
Display t/e next !! lines of source in t/e current file"
Nn
,et t/e current display line to line nn in t/e current file and t/en display t/e line" Note t/at t/e program execution counter remains unc/anged it is only t/e display pointer t/at is c/anged" A command suc/ as s Bsee laterC 'ill correctly execute t/e next line in t/e programmed seuence not t/e ne'ly displayed line"
&
Display all currently active (reapoints"
( T;tU nnTfileU
,et a (reapoint at line nn in t/e current file or t/at specified (y t/e file modifier" f t/e !t option is specified t/en t/e (reapoint 'ill cause a display of all t/e trace varia(les rat/er t/an /alting t/e program"
( T;tU varname
$/is form of t/e command 'ill cause t/e de(ugger to (e entered '/enever t/e contents of t/e specified varia(le are c/anged"
4
4ontinue execution of t/e program"
d T;t(edU TVnnU
Delete (reapoint andEor trace ta(le entries and 'ill normally prompt for confirmation" $/e t and s'itc/es refer to trace and (reapoints respectively" $/e " s'itc/ deletes all of t/e specified entries 'it/out prompting" $/e nn s'itc/ deletes t/e entry nn in t/e given trace or (reapoint ta(le also 'it/out prompting" $/e d and e s'itc/es respectively disa(le or ena(le t/e given entry 'it/out removing it from t/e ta(le"
f TonWoffU
A de(ug (reapoint is set for a filename c/ange" $/is (rea can (e set to on or off" f t/e program is continued B C commandC t/e de(ugger 'ill (e entered t/e next time t/e source file c/anges"
+ T;gU
$/e # command displays a complete /istory of (ot/ G$SU% and external su(routine calls" @/en issued 'it/out options t/e command 'ill only display information a(out t/e current program or su(routine" $/e !& Bglo(alC option 'ill s/o' a (reado'n of t/e entire application"
p Tpat/listU
Defines t/e list of directories and pat/names Bdelimited (y :C t/at t/e de(ugger 'ill t/en searc/ to find source codes" p 'it/out a pat/list displays t/e current %at/"
s T;tTmUdU TnnU
4ontinue execution of +&4 code in single line steps (efore returning to de(ug" $/e value nn c/anges t/e num(er of lines executed (efore returning to de(ug" $/e !t s'itc/ is used to display t/e trace ta(le after every line executed rat/er t/an 'ait for entry to de(ug" $/e d s'itc/ sets a delay (efore executing eac/ line of code" ' is used to set t/e delay in seconds Bdefault is 5 deci;secondsC"
, T;tTmUdU TnnU
,ame as c except t/is 'ill 7step over7 su(routine calls t/e code 'it/in t/e
$-1-N, $2 8ser *uide %age !! of !5
De(ugging $2 ,erver 7Ho' $o7 *uide su(routine 'ill not (e displayed" $
Display t/e current trace ta(le"
t T;fgU expr
Add t/e value specified (y expr to t/e trace ta(le" @/en de(ug is entered all t/e values in t/e ta(le are displayed" $/e ( s'itc/ is used to fully evaluate expr '/ilst t/e & s'itc/ extends t/e display of expr to all levels"
v T;gmsrvU TexprU
-valuate expr and display t/e result" $/e effects of t/e s'itc/es are: & to extend t/e display of expr to all data areas" ' to allo' varia(le modification 'it/in expr " @/en a varia(le is modified 'it/ t/e ' option (inary c/aracters may (e entered using t/e octal seuence )nnn" $/e seuence )*+* 'ould t/erefore (e replaced (y C,AR-./ in t/e modified varia(le" $/e seuence )) evaluates to t/e single c/aracter ) and a seuence suc/ as )x evaluates to t/e single c/aracter x Bi"e" t/e ) 'ill (e lostC"
' nn
Display a 'indo' of source code" $/e default is lines 'it/ (efore and after t/e current one" $/e value nn is used to c/ange t/is parameter" Table 1 Debugger Comman"s
Debugger *edire!tion and -i$es $/e de(ugger provides t/e a(ility to redirect t/e results of its internal command set to a file or t/roug/ a pipe to a command" $/is is a very po'erful feature of t/e de(ugger" $/e follo'ing commands allo' t/is feature:
Display 3aria(leBsC
H
Display History $race
)
Display &reapoints
T
Display $race $a(le
Here are some examples of t/is feature: ,yntax
Description
v W pg
%ipe t/roug/ t/e pg filter
t traceta(le
redirect trace points output to file
v Record file
Display varia(le contents to a file Table 2 Debugger &e"irection
$-1-N, $2 8ser *uide %age !2 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
Ee!ution . Single Ste$$ing s/.t!gd/n00/nn0
Argument
Description
;t
display trace ta(le after eac/ source line executed
;c
only count t/e lines of source in t/e same CA00 level
;g
only count t/e lines of source in t/e same G$SU% level
;dTnU
enter a delay in increments of !00 milliseconds (et'een executing lines of source" $/is is incremented (y t/e n value entered"
nn
execute t/e next nn lines of source (efore re;entering de(ug Table # $ingle $tepping 'rguments
$/is command is used to execute t/e program in steps and to re;enter de(ug after t/e execution of a given num(er of lines of code" $raced varia(les are displayed after de(ug is re;entered and any screen display 'it/in t/e executed code is s/o'n as normal" -ntry
Result
s
$/e simplest form of t/e command executes t/e next line of t/e code and t/en re;enters de(ug"
s 1t
$/e next line of code is executed and t/e contents of all entries in t/e trace ta(le are s/o'n"
s .t4
$/e next four lines of code are executed displaying t/e trace ta(le entries (efore re;entering de(ug"
s 2
$/is command executes t/e next 20 lines of code (efore re;entering de(ug"
s .td3 2
$/e command executes t/e next 200 lines of code" $/e ;d s'itc/ sets a delay in increments of !00 milliseconds (et'een eac/ line executed" $/e 5 denotes t/at a 500 millisecond or /alf second delay is set (efore executing t/e next line" $/e default value is ! or !00 milliseconds" $/e ;t s'itc/ ensures t/at t/e trace commands are s/o'n after t/e execution of every line" @/ile t/is process is continuing de(ug can (e entered (y (reaing into t/e program as normal" $/is is a very useful command to use '/en a run;time error occurs in a program and t/e area of code responsi(le needs to (e found uicly" @it/ t/e ;d s'itc/ set it is also possi(le to speed up or slo' do'n t/e execution of t/e code if t/e initial value c/osen is too fast or slo'" $/is is done (y entering a num(er from t/e ey(oard in t/e range 0; '/ic/ alters t/e delay to t/e given num(er of !00 milliseconds increments"
s .dt 3
$/e command 'ill execute t/e next 500 lines of code 'it/ a delay factor of 900 milliseconds (et'een eac/ line" $/e speed of execution can (e increased or decreased (y pressing t/e num(ers 0; on t/e ey(oard during execution" n addition to t/is t/e ;t s'itc/ means t/at t/e contents of t/e varia(les trace ta(le 'ill (e displayed after every line of code executed" Table 4 Examples of how to use single-stepping arguments
$-1-N, $2 8ser *uide %age !9 of !5
De(ugging $2 ,erver 7Ho' $o7 *uide
ariable Dis$la# /.gv"rs0
,yntax
Description
3 AN,
$/e simplest form of t/e command 'ill display t/e contents of t/e varia(le next to t/e varia(le name in t/is case A1S" $/is 'ill only produce a display if t/e source is at level ! or in t/e /ome directory" f t/e varia(le /as not (een assigned t/e value BN8LLC is displayed" f t/e value assigned /appens to (e null /o'ever t/en a (lan BnullC 'ill (e displayed next to t/e varia(le name"
v ;g AN,
f t/e varia(le in uestion resides in a different data area to t/e local level B411N or NA1-D 411NC t/en t/e !& s'itc/ s/ould (e used to display t/e varia(le contents" $/is extends t/e display of t/e varia(le to data levels and is particularly useful '/en executing a su(routine in a su(;directory or li(rary"
v ;m AN,
$/e !' s'itc/ displays t/e varia(le and contents (ut in addition allo's t/e user to modify t/e contents" An eual sign is s/o'n after t/e varia(le contents and any c/aracters or num(ers entered follo'ed (y a carriage return are taen to (e t/e ne' value of t/e varia(le" -ntering a carriage return leaves t/e varia(le contents unc/anged" $/e c/aracter seuence )nnn is replaced (y t/e (inary c/aracter defined (y t/e octal num(er nnn" $/erefore t/e seuence )234 'ould (e replaced (y a field mar"
v ;gv AN,
$/is command displays t/e value /eld in varia(le AN, no matter '/at t/e current level of t/e source" n addition t/e !5 s'itc/ s/o's t/e type of varia(le Bstring or numericC its memory location and siXe"
v ;r NA1-
$/is command displays t/e contents of t/e varia(le NA1- at t/e start of t/e next line" $/e !r s'itc/ provides a ra' c/aracter vie' of t/e varia(le name and value"
v ;s NA1-
$/e !s s'itc/ s/o's a s/ort vie' of t/e varia(le (eing t/e first !2P (ytes" $/e " and 6 c/aracters can also (e used 'it/in t/e varia(le name as 'ild card c/aracters" $/e 6 denoting a single occurrence of any c/aracter and t/e " denoting any num(er of occurrences of any c/aracter" Table ( Displa)ing Variables in Debugger
$-1-N, $2 8ser *uide %age ! of !5
De(ugging $2 ,erver 7Ho' $o7 *uide $/e ta(le (elo' s/o's some examples: -ntry
Result
v AV
displays all varia(les (eginning 'it/ t/e letter A
v AFFF
displays all four letter varia(les (eginning 'it/ t/e letter A
v V;N3
displays all varia(les ending 'it/ t/e c/aracters !I17
v V-N%V
displays all varia(les 'it/ t/e c/aracters E1P 'it/in t/eir name
v L,B2VC
displays every element in t/e second ro' of t/e dimensioned array 0IS
3 3Y.)8N4$N
Displays contents of t/e common varia(le 3.)8N4$N note t/e . must (e prefixed (y Y ot/er'ise t/e .)8N4$N is interpreted as an environment varia(le" Table * Examples of Displa)ing Variables
All t/e a(ove ta(les are taen from t/e +&A,- no'ledge(ase '/ic/ contains furt/er commands for t/e de(ugger" /ttp:EE'''"+(ase"comEno'ledge(aseEindex"/tml
$-1-N, $2 8ser *uide %age !5 of !5