Kbase P126647: How to use the Attachable debugger to debug a remote ABL client process
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/12/2008 |
|
Status: Verified
GOAL:
How to use the Attachable debugger to debug a remote ABL client process
GOAL:
How to attach to a process using the OpenEdge Debugger
GOAL:
How to ready a process for debugging remotely
GOAL:
How to use proDebugConfig
GOAL:
How to use -debugReady
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
FIX:
OpenEdge Release 10.1A introduced new functionality in the debugger tool that allows attaching to a remote process. The way that this is accomplished is the AVM opens up and listens on a specified port for incoming requests to attach by a remote debugger process.
This is a potential security risk and could potentially cause performance issues if used improperly so this should only be used knowingly in a controlled set of circumstances and disabled when not needed unless the environment is secure.
There are essentially two ways to enable an ABL client for debugging. One enables it upon client startup (-debugReady), the other enables processes for debugging on the fly or "when needed". The second methodology is typically the most prudent to use for both security and performance reasons.
Both of these methods are illustrated in this article.
- Before we get to enabling the ports you must first ensure that the remote debugger process is able to see the source code that is executing. The way this is done is to compile the source file with the DEBUG-LIST option. This can be done in the Application Compiler for a single file at a time or in ABL code by simply executing a variation of the following statement:
COMPILE <filename> SAVE DEBUG-LIST <filename>.cmp.
- Then copy the debug listing to a directory local to the debugger client for use when the debugger attaches to the process. i.e. the machine where the debugger GUI will be running.
- Next you must ensure that debugging is enabled on the machine where the process is to be enabled for debugging. This must be done prior to starting the process by using the proDebugEnable command with the -enable-all option:
e.g. proDebugEnable -enable-all
Note: To run this command you must be an Administrator or root.
Note: This can be undone by using the -disable-all option with the same command.
- Next you can start the process. If you intend to enable the process for debugging permanently and are not concerned with security or any potential minor performance loss which could be caused by the listener process you can use -debugReady on the command-line and specify either 0 or an open port.
e.g. mpro -p <myproc.p> -pf <startapp.pf> -debugReady 9899
Otherwise you can simply start your process and enable it later, as shown below, when you need to start debugging.
- To enable a running process for remote debugger attachment use the proDebugConfig command. The basic syntax/usage for this command follows. See OpenEdge Debugging and Troubleshooting Guide for more detailed information on the available options.
proDebugConfig
Note: To run this command you must be an Administrator or root.
This command brings up a list of OpenEdge processes that can be attached to. To enable a specific process enter the process id from the available list then hit enter.
This returns a message indicating that the process is ready for debugging on port # <n> (Where <n> is the assigned port number. 9999 is the default).
- Next you can start the debugger GUI on another machine, select "Attach to Process" from the "Debug" menu, specify the host and port information and, when prompted for the location of the debug listing file, add the directory where the debug listings were placed earlier.