To perform local debugging
-
Configure and start the Lawson Debug Server (ladebug).
-
Make sure that there is an entry for the Lawson Debug
Server (ladebug.exe) in laserv.cfg. The entry should be as follows:
ladebug "%gendir%\bin\ladebug.exe"
- Set the ENABLEDBG parameter in %LAWDIR%\system\ladebug.cfg to TRUE.
-
Start the Lawson Debug Server (ladebug). At the command line, type
startladebug
If the ENABLEDBG parameter in ladebug.cfg is set to TRUE and if ladebug is running, Lawson client programs will check with the Lawson Debug Server to see if the application program is being debugged. Because this setting incurs some overhead, the ENABLEDBG parameter should always be set to FALSE in a production Lawson Environment. For more information on the Lawson Debug Server, see the Lawson Administration: Server Setup and Maintenance guide.
-
Make sure that there is an entry for the Lawson Debug
Server (ladebug.exe) in laserv.cfg. The entry should be as follows:
-
Compile the program you want to debug.
qcompile -D productline systemcode programcode
-
From a command line window set up for Lawson, start
Net Express:
mfnetx
Note: After you have set up a project’s application path variable, you can double-click the Net Express icon to start it.The following parameters are valid:
Parameter Description projname Load the specified project (for example, gl00.app). /DEBUG:progname Animate a program without loading a project. /DEBUGPROJ:projname Load a project and start animating the main program. /DEBUGWAIT:Directory Start the debugger and wait for an executable in the directory to start. /N Do not load the last project used. /? Read this help message. /CLONE:projname Make a copy of an existing project structure. /PROJECTWIZARD Start the wizard for creating new projects. -
Create a Net Express project for the program to be
debugged.
- From the File menu, select New, then Project.
- In the New Project wizard, select Empty Project.
- Enter the name of the project, such as GL00.
-
Enter the location of the project, typically
%LAWDIR%\productline\obj
. - Click on Create.
- Add files to the project by right-clicking in the left side of the Project window and selecting the Add Files to Project option.
-
Set debug settings.
- From the Animate menu, select the Settings… option.
-
In the Command line parameters field, enter
-D DataArea
, where DataArea is the data area or data ID the program is to run against. - Close the Settings window.
-
Set the path variable for the project.
- From the Project menu, select Properties.
- Click the Application button.
- On the Environment Variables tab, type path in the Variable Name field and, in the Value field, type the actual path for %GENDIR%\bin. Do not type "%GENDIR%, but rather what it is equivalent to on your system. Also, type the actual path to the jvm.dll file.
- Click Set and then click OK.
-
Set the build type.
- From the Project menu, select Types of Build.
- Highlight Debug and click Change.
- Clear the Build subdirectory field, and then click OK and then Close.
- If you are debugging a batch program, enter any parameters for it in Job Definition (jobdef).
- From the Animate menu, select Start Animating.
-
Set break points as needed. In the case of online
programs, all breakpoints must be after the statement:
CALL "InitOnline" USING WS-DB-PRODUCT-LINE,
CRT-PROGRAM-CODE,
WS-DATE-DISPLAY-FORMAT
CRT-DEFAULT-PRINTER.
- From the Animate menu, select Run.
-
If you are working with an online program, use a Lawson
client to bring up the program form and perform a transaction. (This
step is not necessary with batch programs.)
Net Express will stop execution if the program hits any of the break points.