pct icon indicating copy to clipboard operation
pct copied to clipboard

PDSOE: replacing r-code

Open stefandrissen opened this issue 2 years ago • 9 comments

This is not directly a PCT problem, but is IMHO very interesting for PCT users.

There are two place in PDSOE where r-code built by PDSOE seems to be needed:

  • debugging client side code
  • ALT+L to find debug listing line in source code (Carl's tip in poet-summit today)

Since we replaced the PSDOE AVM compiler with PCT a long time ago, I'm wondering if PDSOE can be "fooled" into using PCT's r-code.

stefandrissen avatar Nov 10 '21 15:11 stefandrissen

I'll do some tests, and update the ticket if I find anything useful.

gquerret avatar Nov 12 '21 08:11 gquerret

Debugging client side code

In order to avoid this message ? image

ctrl+L to find debug listing line in source code (Carl's tip in poet-summit today)

What was this tip ? :blush:

gquerret avatar Nov 25 '21 13:11 gquerret

I do not let PDSOE create any r-code:

---------------------------
Launch Debugger
---------------------------
Source-level debugging requires saving the r-code. 
Please check your compile-project settings.
Enable Debugger cannot be performed at this time.
---------------------------
OK   
---------------------------

Sorry I meant ALT+L:

image

Which results in:

---------------------------
Debug Listing Line Number
---------------------------
Rcode file of the current resource not found.
---------------------------
OK   
---------------------------

stefandrissen avatar Nov 25 '21 13:11 stefandrissen

  • Debugger

Unchecking "Save r-code" in Progress OpenEdge -> Build -> Compile menu introduces this behavior, and it looks like it's hard-coded in the Java code. If you check the box but disable "Build automatically", you can still build with PCT and use the debugger (but it's still possible to force rcode creation, but it's probably not what you want to do). AFAIK, there's no other solution

  • Debug listing line number

In a very simple project, I'm able to use Alt + L. Rcode has to be in the exact location where it would be generated by PDSOE (target build directory of source entry, or global directory). Make sure rcode has debug information. Once again, I did my test on a very simple environment.

gquerret avatar Nov 25 '21 14:11 gquerret

Debugger

That works rather nicely! What a breath of fresh air to step through source with the Eclipse debugger instead of the stand alone debugger.

Debug listing line number

This nearly works, for some reason include files are not automatically found, this may be related to relative paths, or something else:

image

After manually selecting the include file, the correct line is highlighted!

stefandrissen avatar Nov 25 '21 14:11 stefandrissen

It looks like relative paths (even valid ones in the context of the project) are not correctly understood by PDSOE. Maybe an enhancement request for Progress. You can also try using relativePaths="false" in your PCTCompile statement. RCode will be generated with absolute references to include files, so they might be understood by PDSOE. Only use this option for local builds, any CI build should use relativePaths=true.

gquerret avatar Nov 25 '21 14:11 gquerret

The debugger is not working as well as I had hoped, the notion of include files seems a bit lost on the debugger, a breakpoint in source.p in project A results in the debugger stopping at that line in the debug-listing of source.p, ie at a completely different line.

The initial results were beyond my expectations, so I am encouraged to experiment a little more in this area.

stefandrissen avatar Nov 25 '21 14:11 stefandrissen

Make sure you recompile all rcode with relativePaths="false". Once again, I've tried that on a very simple project, but I've been able to compile with PCT and use breakpoints in the debugger, even within include files. The debugger always pointed at the right location in the code.

gquerret avatar Nov 25 '21 15:11 gquerret

I have just performed a clean build with relativePaths false without success.

Maybe it is related to having multiple projects.

I am starting a debug configuration in project A (ui only) with a breakpoint in project B (back end). Project A is unaware of project B.

Line breakpoint in .p of project B:

image

Debugger showing line 67 of .p - which is debug-listing line 67, ie one of the lines from an include before line 67 of the .p:

image

stefandrissen avatar Nov 25 '21 16:11 stefandrissen

My work on this topic is a bit far away, but I didn't find any way on how to solve this issue. Unless additional info can be provided, this issue won't be fixed.

gquerret avatar Dec 11 '22 20:12 gquerret