Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug closes original source #2314

Open
JonFP opened this issue Oct 28, 2024 · 19 comments
Open

Debug closes original source #2314

JonFP opened this issue Oct 28, 2024 · 19 comments
Labels
debug Debug client issue (IBM)

Comments

@JonFP
Copy link

JonFP commented Oct 28, 2024

When running the debugger the original source is closed when the debugger terminates. This didn't used to happen and forces me to reopen the source after each debug run.


⚠️ REMOVE THIS LINE AND ANY SENSITIVE INFORMATION BELOW! ⚠️

Context Version
Code for IBM i version 2.13.5
Visual Studio Code version 1.94.2
Operating System darwin_x64
Active extensions
COBOL (cobol): 24.10.26
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0
Configuration Editing (configuration-editing): 1.0.0
Db2 for IBM i (vscode-db2i): 1.6.1
Emmet (emmet): 1.0.0
Error Lens (errorlens): 3.20.0
Extension Authoring (extension-editing): 1.0.0
Git (git): 1.0.0
Git Base (git-base): 1.0.0
GitHub (github): 0.0.1
IBM i Debug (ibmidebug): 2.0.1
JSON Language Features (json-language-features): 1.0.0
Merge Conflict (merge-conflict): 1.0.0
NPM support for VS Code (npm): 1.0.1
Node Debug Auto-attach (debug-auto-launch): 1.0.0
Pylance (vscode-pylance): 2024.10.1
Python (python): 2024.16.1
RPGLE (vscode-rpgle): 0.26.12
Server Ready Action (debug-server-ready): 1.0.0
TODO Highlight (vscode-todo-highlight): 1.0.5
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0

Remote system
Setting Value
IBM i OS V7R4M0
Tech Refresh 10
CCSID Origin 37
Runtime CCSID 37
Default CCSID 37
SQL Enabled
Source dates Disabled

Enabled features

/QOpenSys/pkgs/bin /usr/bin /QSYS.lib/ILEDITOR.lib /QSYS.LIB /QIBM/ProdData/IBMiDebugService/bin /QOpenSys/QIBM/ProdData/JavaVM/jdk80 /QOpenSys/QIBM/ProdData/JavaVM/jdk11 /QOpensys/pkgs/lib/jvm
bash attr GETNEWLIBL.PGM QZDFMDB2.PGM startDebugService.sh 64bit 64bit openjdk-11
chsh iconv
git setccsid
grep tar
ls
md5sum
sort
stat
tn5250
Shell env
BUILDLIB=PARTNER400
CURLIB=PARTNER400
HOME=/home/PARIS
HOST=ideveloper
LIBLS=CODE4ITEST SAMPLE LIBHTTP SIDDBV2 YAJL QTEMP QGPL
LOGIN=paris
LOGNAME=paris
MAIL=/var/spool/mail/paris
OLDPWD=/home/PARIS
PATH=/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
PWD=/home/PARIS
SHELL=/QOpenSys/pkgs/bin/bash
SHLVL=1
SSH_CLIENT=10.29.5.11 63375 22
SSH_CONNECTION=10.29.5.11 63375 172.29.5.35 22
TZ=<EST>5<EDT>,M3.2.0,M11.1.0
USER=paris
USERNAME=paris
WORKDIR=/home/PARIS
_=/QOpenSys/pkgs/bin/env
Variants
{
  "american": "#@$",
  "local": "#@$"
}
Errors
[
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPD4090:  Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.\nRNS9308:  Compilation stopped. Severity 40 errors found in program.\nCPC0904:  Data area RETURNCODE created in library QTEMP.\nRNS9310:  Compilation failed. Program DIEXAMP1 not created in library PARTNER400.",
    "cwd": "/home/PARIS"
  },
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPD4090:  Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.\nRNS9308:  Compilation stopped. Severity 20 errors found in program.\nCPC0904:  Data area RETURNCODE created in library QTEMP.\nRNS9310:  Compilation failed. Program DIEXAMP1 not created in library PARTNER400.",
    "cwd": "/home/PARIS"
  },
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPD4090:  Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.\nRNS9308:  Compilation stopped. Severity 30 errors found in program.\nCPC0904:  Data area RETURNCODE created in library QTEMP.\nRNS9310:  Compilation failed. Program DIEXAMP1 not created in library PARTNER400.",
    "cwd": "/home/PARIS"
  }
]
@worksofliam worksofliam added the debug Debug client issue (IBM) label Oct 28, 2024
@mkwan01
Copy link

mkwan01 commented Nov 19, 2024

The debugger would open source in a new debug editor and it closes the debug editor after the debug session is terminated. Please describe what the editor behavior is like in your own debug session:

  1. Does your debug session reuse an editor that is opened before the debug session?
  2. If yes, please describe whether the source is local or remote.

If possible, please use some screen captures to show the editor area before debug and during debug.

@heymchri
Copy link

Hi @mkwan01 , I'm not sure whether this is what the OP sees, but for me, the behavior is as follows:

  • I open a source for editing
  • I take the Debug as Batch option
  • The debugger opens a new debug editor to set breakpoints, step through the program, etc.
  • When the debug session ends, not only the debug editor is closed, but also the original source editor I had open. The latter should not be automatically closed - only the debug editor should be closed.

@JonFP
Copy link
Author

JonFP commented Nov 19, 2024

That is exactly what is happening @heymchri

Thanks for clarifying.

@mkwan01
Copy link

mkwan01 commented Nov 19, 2024

Thanks @heymchri for the hint. There is no VScode API to tell whether an open editor is a debug editor. We are currently using the short name on a tab label to determine if this name matches an existing debug source file. If the short name matches, then it is considered as a debug editor and we will close it. This solution is not as good. It can match other existing editors with the same base name. We can change the algorithm to match for the full name.

Can you compare the labels on the two editors (one for debug and the other is opened before debug), and let me know whether the full labels are the same? You can hover on an editor tab to see its label. If their labels are still the same, then we will still have problem in the new solution.

@heymchri
Copy link

hi @mkwan01
My regular source editor shows this:
image
The debug editor shows this:
image

I also tried this for a source member:
Regular source editor:
image
Debug editor:
image

So in both cases, there is a difference in the full label name.

@mkwan01
Copy link

mkwan01 commented Nov 20, 2024

Thanks @heymchri for the information. Can you also capture the Debug Adapter Protocol log from the Debug Console for the first debug session (where the source is located under /home/HEYMCHR)? I want to make sure that my new solution would work for this case. Thanks.

@heymchri
Copy link

Hi @mkwan01 - not sure what you mean with the Debug Adapter Protocol log - is this what you're looking for?

From client: evaluate({"expression":"len","frameId":7,"context":"hover","line":55,"column":25,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
From client: evaluate({"expression":"&sublength","frameId":7,"context":"hover","line":56,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":25,"success":false,"command":"evaluate","body":{"error":{"id":"8999","format":"Server: CPF7E12 Identifier does not exist."}}}
To client: {"type":"response","seq":0,"request_seq":26,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":57,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":27,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}

@mkwan01
Copy link

mkwan01 commented Nov 20, 2024

@heymchri Yes, that is the one I am looking for. Specifically, I want to check the loadedSource event, which looks like the following:
To client: {"type":"event","seq":23,"event":"loadedSource","body":{"reason":"new","source":{"adapterData":{"module":"*PGM MERDBGTEST/EDITORTEST","part":"EDITORTEST"},"name":"MERDBGTEST/QRPGLESRC/EDITORTEST.RPGLE","path":"MERDBGTEST/QRPGLESRC/EDITORTEST.RPGLE","sourceReference":1001}}}

Please attach your loadedSource event for the first debug session where the debug source is located under /home/HEYMCHR.

@heymchri
Copy link

@mkwan01 The loadedSource event shows:

To client: {"type":"event","seq":23,"event":"loadedSource","body":{"reason":"new","source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}}}

Full log:

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"IBMiDebug","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportTerminateDebuggee":true,"supportsFunctionBreakpoints":true,"supportsConfigurationDoneRequest":true}}
From client: launch({"type":"IBMiDebug","request":"launch","name":"IBM i batch debug: program AEALIB/CRTOBJEDN","user":"HEYMCHR","password":"Vectra18","host":"usalil2c.infor.com","port":"8005","secure":true,"ignoreCertificateErrors":false,"subType":"batch","library":"AEALIB","program":"CRTOBJEDN","startBatchJobCommand":"SBMJOB CMD(AEALIB/CRTOBJEDN OBJ(XA10M7X1O/acecoq0r) STMF('/home/heymchr/builds/xa10/m7x/qrpgmodsrc/acecoq0r.sqlrpgle') OPTION(*EVENTF)) INLLIBL(QGPL QTEMP XA10FLIB AEFLIB AEALIB AMFLIBB AMXLIBB XA10M7X1O CCHLIB HEYMCHR) CURLIB(AEALIB) JOBQ(QSYSNOMAX) MSGQ(*USRPRF) CPYENVVAR(*YES)","updateProductionFiles":true,"trace":true,"workbenchSettings":{"updateProductionFiles":false,"enableDebugTracing":false},"__sessionId":"06fa2276-50f2-429d-8eba-b56448ff2a19"})
To client: {"type":"event","seq":2,"event":"initialized"}
From client: setFunctionBreakpoints({"breakpoints":[]})
To client: {"type":"response","seq":0,"request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
From client: configurationDone(undefined)
To client: {"type":"response","seq":0,"request_seq":4,"success":true,"command":"configurationDone"}
From client: threads(undefined)
To client: {"type":"response","seq":0,"request_seq":5,"success":true,"command":"threads","body":{"threads":[]}}
To client: {"type":"event","seq":6,"event":"capabilities","body":{"capabilities":{"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportsSetExpression":true,"supportsRestartRequest":true,"supportsTerminateRequest":true}}}
To client: {"type":"event","seq":7,"event":"output","body":{"category":"console","output":"EQARD1067I Remote Debug Service has generated the following trace files: \n/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_DAP.txt\n/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_EPDC.hex\n"}}
EQARD1067I Remote Debug Service has generated the following trace files: 
/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_DAP.txt
/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_EPDC.hex
To client: {"type":"event","seq":8,"event":"output","body":{"category":"telemetry","data":{"rdsBuildVersion":"unknown","rdsCorePluginVersion":"1.3.3.202310041518","rdsDb2PluginVersion":"unknown","rdsZosPluginVersion":"unknown","engineLabel":"unknown","engineVersion":"unknown"}}}
To client: {"type":"event","seq":9,"event":"thread","body":{"reason":"started","threadId":1}}
To client: {"type":"event","seq":10,"event":"stopped","body":{"reason":"entry","threadId":1,"allThreadsStopped":true}}
To client: {"type":"event","seq":11,"event":"process","body":{"name":"Process: 414982/HEYMCHR/QDFTJOBDI  Program: CRTOBJEDN","isLocalProcess":false,"startMethod":"launch"}}
To client: {"type":"event","seq":12,"event":"module","body":{"reason":"new","module":{"id":1,"name":"*PGM AEALIB/CRTOBJEDN"}}}
From client: threads(undefined)
To client: {"type":"response","seq":0,"request_seq":6,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"Thread:1 (stopped)"}]}}
From client: stackTrace({"threadId":1,"startFrame":0,"levels":20})
To client: {"type":"response","seq":0,"request_seq":7,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":7,"name":"CRTOBJEDN : CRTOBJEDN : CRTOBJEDN","line":1,"column":1,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}},{"id":6,"name":"_CL_PEP : CRTOBJEDN : CRTOBJEDN","line":1,"column":1,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}},{"id":5,"name":"QCAPCMD : QCAPCMD : QCAPCMD","line":1,"column":1,"source":{"adapterData":{"module":"*PGM QSYS/QCAPCMD","part":"QCAPCMD"},"name":"QCAPCMD.STATEMENT","path":"QCAPCMD.STATEMENT","sourceReference":2001}},{"id":4,"name":"ProcessCommand : QRSEEXEC : EVFCEXEC","line":1,"column":1,"source":{"adapterData":{"module":"*PGM QDEVTOOLS/QRSEEXEC","part":"EVFCEXEC"},"name":"EVFCEXEC.STATEMENT","path":"EVFCEXEC.STATEMENT","sourceReference":3001}},{"id":3,"name":"main : QRSEEXEC : EVFCEXEC","line":1,"column":1,"source":{"adapterData":{"module":"*PGM QDEVTOOLS/QRSEEXEC","part":"EVFCEXEC"},"name":"EVFCEXEC.STATEMENT","path":"EVFCEXEC.STATEMENT","sourceReference":3001}},{"id":2,"name":"_C_pep : QRSEEXEC : EVFCEXEC","line":1,"column":1,"source":{"adapterData":{"module":"*PGM QDEVTOOLS/QRSEEXEC","part":[...]
To client: {"type":"event","seq":15,"event":"module","body":{"reason":"new","module":{"id":3,"name":"*PGM QSYS/QCAPCMD"}}}
To client: {"type":"event","seq":16,"event":"module","body":{"reason":"new","module":{"id":4,"name":"*PGM QDEVTOOLS/QRSEEXEC"}}}
To client: {"type":"event","seq":17,"event":"module","body":{"reason":"new","module":{"id":6,"name":"*PGM QSYS/QCMD"}}}
To client: {"type":"event","seq":18,"event":"capabilities","body":{"capabilities":{"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsValueFormattingOptions":true,"supportsModulesRequest":true,"supportsSetExpression":true,"supportsRestartRequest":true,"supportsTerminateRequest":true}}}
To client: {"type":"event","seq":19,"event":"output","body":{"category":"console","output":"EQARD1067I Remote Debug Service has generated the following trace files: \n/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_DAP.txt\n/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_EPDC.hex\n/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_LOG.log\n"}}
EQARD1067I Remote Debug Service has generated the following trace files: 
/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_DAP.txt
/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_EPDC.hex
/QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/PDT_DAAS_20241120_111429_0705_2_LOG.log
To client: {"type":"response","seq":0,"request_seq":2,"success":true,"command":"launch"}
From client: source({"sourceReference":1001,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
From client: threads(undefined)
To client: {"type":"response","seq":0,"request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"Thread:1 (stopped)"}]}}
To client: {"type":"response","seq":0,"request_seq":8,"success":true,"command":"source","body":{"content":"pgm parm(&qualobj &fullpath &options)\n \ndcl &qualobj      *char 20\ndcl &fullpath     *char 200\ndcl &options      *char 10\n \ndcl &name         *char 10\ndcl &buildlib     *char 10\n \ndcl &app          *char  3\ndcl &obj          *char 10\ndcl &objtype      *char 10\ndcl &chglvl       *char  1\ndcl &cmplib       *char 10\ndcl &dstlib       *char 10\ndcl &srcstmf      *char 200\n \ndcl &startpos     *int\ndcl &found        *int\ndcl &length       *int\ndcl &sublength    *int\ndcl &mbrtype      *char 10\ndcl &env          *char  4\ndcl &objdesc      *char 50\ndcl &otlib        *char 10\ndcl &objown       *char 10\ndcl &pubaut       *char 10\ndcl &runprf       *char 10\ndcl &ismodule     *int\n \nchgvar &name      value(%sst(&qualobj 1 10))\nchgvar &buildlib  value(%sst(&qualobj 11 10))\n \n \n \n \nchgvar &env *blanks\nchgvar &found %scan('/builds/' &fullpath)\nif (&found > 0) then(do)\n \n    /* set the LDA environment value based on the path of the streamfile */\n    /* set the APP parameter based on the path of the streamfile         */\n    /* example: '/home/heymchr/builds/xa10/m7x/rpglesrc/amvt0.rpgle'     */\n    chgvar &startpos (&found + 8)\n    chgvar &env %substring(&fullpath &startpos 4)\n    chgvar &env %upper(&env)\n    chgdtaara dtaara(*lda (1 4)) value(&env)\n    chgvar &startpos (&found + 13)\n    chgvar &app %substring(&fullpath &startpos 3)\n    chg[...]
To client: {"type":"event","seq":23,"event":"loadedSource","body":{"reason":"new","source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}}}
From client: scopes({"frameId":7})
From client: evaluate({"expression":"&qualobj","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&fullpath","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&app","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&obj","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&chglvl","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&cmplib","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&dstlib","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&igc","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&startpos","frameId":7,"context":"watch"})
From client: evaluate({"expression":"&edn","frameId":7,"context":"watch"})
To client: {"type":"response","seq":0,"request_seq":10,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":71000000,"expensive":false}]}}
To client: {"type":"response","seq":0,"request_seq":11,"success":true,"command":"evaluate","body":{"result":"ACECOQ0R  XA10M7X1O ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":12,"success":true,"command":"evaluate","body":{"result":"/home/heymchr/builds/xa10/m7x/qrpgmodsrc/acecoq0r.sqlrpgle                                                                                                                                              ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":13,"success":true,"command":"evaluate","body":{"result":"   ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":14,"success":true,"command":"evaluate","body":{"result":"          ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":15,"success":true,"command":"evaluate","body":{"result":" ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":16,"success":true,"command":"evaluate","body":{"result":"          ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"event","seq":31,"event":"output","body":{"category":"console","output":"Server: CPF7E12 Identifier does not exist."}}
Server: CPF7E12 Identifier does not exist.
To client: {"type":"response","seq":0,"request_seq":18,"success":false,"command":"evaluate","body":{"error":{"id":"8999","format":"Server: CPF7E12 Identifier does not exist."}}}
To client: {"type":"response","seq":0,"request_seq":17,"success":true,"command":"evaluate","body":{"result":"          ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":19,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"event","seq":35,"event":"output","body":{"category":"console","output":"Server: CPF7E12 Identifier does not exist."}}
Server: CPF7E12 Identifier does not exist.
To client: {"type":"response","seq":0,"request_seq":20,"success":false,"command":"evaluate","body":{"error":{"id":"8999","format":"Server: CPF7E12 Identifier does not exist."}}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":57,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
From client: evaluate({"expression":"&sublength","frameId":7,"context":"hover","line":56,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":21,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
To client: {"type":"response","seq":0,"request_seq":22,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":57,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":23,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&sublength","frameId":7,"context":"hover","line":56,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":24,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":57,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":25,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&sublength","frameId":7,"context":"hover","line":56,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":26,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":53,"column":12,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":27,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&length","frameId":7,"context":"hover","line":55,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":28,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}
From client: evaluate({"expression":"&startpos","frameId":7,"context":"hover","line":57,"column":16,"source":{"adapterData":{"module":"*PGM AEALIB/CRTOBJEDN","part":"CRTOBJEDN"},"name":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","path":"/home/HEYMCHR/builds/tools/qclsrc/crtobjedn.clle","sourceReference":1001}})
To client: {"type":"response","seq":0,"request_seq":29,"success":true,"command":"evaluate","body":{"result":"0            ","variablesReference":0,"namedVariables":0,"type":""}}

@mkwan01
Copy link

mkwan01 commented Nov 20, 2024

Thanks @heymchri . The DAP log confirms that the name field of the loadedSource event contains the full path of the source file in the IFS debug scenario.

@JonFP
Copy link
Author

JonFP commented Nov 20, 2024

Just a thought - this appears to have been a recently introduced problem - so how did it work before?

@mkwan01
Copy link

mkwan01 commented Nov 20, 2024

The old behaviour is to close the currently active editor, even if the active editor is not for the current debug session. This solution also has its own set of problems. We will try to fix the problem by matching the full path of the source tab against the loaded debug source files.

@mkwan01
Copy link

mkwan01 commented Nov 22, 2024

The fix will be available in the coming debug client update (around early December).

@mkwan01
Copy link

mkwan01 commented Dec 13, 2024

This problem was fixed in debug client v2.0.2. The new debug client requires a debug service update via the following host PTFs:
7.3 PTF SJ02996
7.4 PTF SJ03026
7.5 PTF SJ03030

Please note that you need to regenerate the SSL certificate after updating the debug service.

@worksofliam

@chrjorgensen
Copy link
Collaborator

Hi @mkwan01

Unfortunately the latest version 2.0.2 of the debug client still closes the original source... 😢

My case:

  • open a CLLE streamfile for edit
  • select either Debug as Batch or Set Service Entry Point
  • a new window opens
  • debug the program in the new window
  • after debug the new window is closed... but also the original window!

When checking the editor windows, they both have the same label: the full IFS path /cjtesting/test.clle.

@mkwan01
Copy link

mkwan01 commented Dec 18, 2024

@chrjorgensen This is a limitation, if the debug editor and the source file editor has the same label. The fix addressed the cases where the two labels are different. In these cases, only the debug editor is closed after the debug session is terminated.

As we have no way to tell whether an editor is a debug editor from VSCode API, we can only use the editor label matching solution, which is better than the original solution, but it still has its own limitations.

@heymchri
Copy link

@mkwan01 @chrjorgensen I tested this as well, and for both stream files and source members this now works OK for me - the original editor tab stays open after the debug editor tab closes.

@chrjorgensen
Copy link
Collaborator

@heymchri Source members work here also - because the label for the member is \<lib>\<file>\<member>.<type> whereas the debugger editor has label <lib>\<file>\<member>.<type>, i.e. not having a \ in the front, thus making the two labels different.

I noticed your two labels for streamfiles in your comment above also are different, where your opened streamfile has a label starting with ~/dev/, i.e. your home directory (in IFS or local?) and the debug editor has the full path for the streamfile as label (i.e. starting with /home/HEYMCHR/builds/, your home directory, but in absolute notation). Does the debugger close only its own editor if you open the streamfile with an absolute path, e.g. from Go to File (Ctrl-Shift-P)?

@mkwan01 You've probably already investigated this, but is it possible to only close one editor window instead of all having the same label? Or open the editor window with a unique label like e.g. <full path> - debug? Just some ideas / thoughts...

@heymchri
Copy link

@chrjorgensen my source is in git so I have my stream files locally. ~/dev/ in my case equals /Users//dev/
I've never used 'Go to File' before. I just tried that and opened the source directly from my deployment location in the IFS, and in that case, both the editor tab and the debug editor tab close because both have the same label - so this confirms what you're seeing.
I'm not quite sure what logic could be used to fix this scenario - is it even possible to close only a single tab if both tabs have the same label? I understood that the previous logic was to close the active editor tab, but apparently that had the side effect of also closing any other tabs that had the same label - so it may be a VS Code shortcoming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug client issue (IBM)
Projects
None yet
Development

No branches or pull requests

5 participants