vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Debug v2 - add "set service entry point" action to *PGM and *SRVPGM

Open mkwan01 opened this issue 1 year ago • 4 comments

Enhancement: Contribute a "Set Service Entry Point" action to *PGM and *SRVPGM objects. This action will appear in the Object Browser and Project Explorer views.

How it works: This action will call the ibmidebug.create-service-entry-point-with-prompt command in the IBM i Debug extension. The command supports the following parameters:

hostName: string, userId: string, password: string, defaultSepLocation?: string

Parameter descriptions:

  • hostName: the remote IBM i host name
  • userId: the user profile for setting the SEP
  • password: the password for the user profile
  • defaultSepLocation: The default SEP location is generated from the selected object. The location string is in the following format: libraryName/programName programType/moduleName/procedureName
    • libraryName: the library name
    • programName: the program name
    • programType: *PGM for program and *SRVPGM for service program
    • moduleName: module name, default to *ALL
    • procedureName: procedure name, default to *ALL

Example: If the user invokes the "Set Service Entry Point" action on program "MYLIB/MYPGM *PGM", the defaultSepLocation string should be MYLIB/MYPGM *PGM/*ALL/*ALL.

The ibmidebug.create-service-entry-point-with-prompt command implementation brings up a prompt to display the defaultSepLocation. If the user wants to set an SEP on a specific module or procedure, he can specify the module name or procedure name in the location value.

Need a UI to let the user select which module/function they want to break on:

  • You can pick a module, which means *ALL procedures
  • You can pick a procedure, which is then explicit
select BOUND_MODULE_LIBRARY, BOUND_MODULE, MODULE_ATTRIBUTE, NUMBER_PROCEDURES from QSYS2.BOUND_MODULE_INFO WHERE Program_Library = 'LIAMA'; --gets module to objects

mkwan01 avatar Feb 02 '24 16:02 mkwan01

@mkwan01 I understand that this depends on a new API in the debug client. Can you let us know what branch this is available on so we can have this available once the new Debug Service ships.

edmundreinhardt avatar Feb 13 '24 15:02 edmundreinhardt

@edmundreinhardt The v2 debug client code is in the debug_v2 branch: https://github.ibm.com/ibmi-toronto/debugclient/tree/debug_v2

I am in the process of integrating the debug_v2 branch to head. It should be available in a few days.

mkwan01 avatar Feb 13 '24 16:02 mkwan01

The internal startDebug functions needs to support SEP, and instead of calling the startDebugging VS Code API, instead call the IBM i Debug command with the correct attributes.

The DebugOptions interface basically needs additional props for SEP debugging.

      const parms = ['hostname', 'userId', 'password', 'sepLocation'];
      vscode.commands.executeCommand(`ibmidebug.create-service-entry-point-with-prompt`, ...parms);

worksofliam avatar Mar 01 '24 18:03 worksofliam

We have a question whether we need to pass the SEP daemon port value as a parameter. I reviewed the debug client code and found that it is currently reading the SEP daemon port and secure debug from the global "IBM i Debug" settings. Since Code for i has its own Connection Settings page, the port number values from Code for i may be different than the global debug settings. I will add two more parameters to the ibmidebug.create-service-entry-point-with-prompt command, so that Code for i can pass these port numbers to debug.

Please see the following debug issue for details: https://github.ibm.com/ibmi-toronto/debugclient/issues/22

mkwan01 avatar Mar 01 '24 20:03 mkwan01