AL icon indicating copy to clipboard operation
AL copied to clipboard

Error: It is not possible to add a breakpoint at the location requested.

Open NemanjaKutlesic opened this issue 6 years ago • 15 comments

Describe the bug I'm not able to set breakpoints in my al code

To Reproduce Im running the latest version on docker, and on some places i can set breakpoint, on some i cannot and i got the error from title

Expected behavior I should be able to set breakpoints everywhere

Screenshots image

Version:

  • AL Language: 4.0.206840

NemanjaKutlesic avatar Jan 10 '20 14:01 NemanjaKutlesic

same problem. Restarting VSCode fixes it for me :)

LFlamme avatar Jan 10 '20 15:01 LFlamme

It is not temporary solution, some of them work after restart, but some still remains dead

NemanjaKutlesic avatar Jan 10 '20 15:01 NemanjaKutlesic

Same problem. Came with a recent update. Same as begin/end autocomplete being entirely broken now.

mjmatthiesen avatar Jan 10 '20 17:01 mjmatthiesen

Have you published the code with F5? Can you provide a repro.? Is it that you just click around and add breakpoints and some succeed, some not? Have you renamed, or deleted any file that had a breakpoint? What happens if you open the breakpoints window in the debug tab and delete all breakpoints, and start re adding them?

kalberes avatar Jan 10 '20 20:01 kalberes

This issue also occurs quite frequently on my dev environment. I could not figure out the exact situation until a couple of minutes ago.

In my case the following scenario creates the issue:

  • Change a piece of code
  • Do a RAD
  • Select "Debug without publishing" from VSCode and wait untill the session is started.
  • Try to add a breakpoint withing the code you've just changed.

VSCode now throws the error "Error: It is not possible to add a breakpoint at the location requested.".

This leads me to believe it has something to do with Rapid Application Publishing.

daansaveyn avatar Jan 13 '20 10:01 daansaveyn

@daansaveyn

  1. What does it mean "Do a RAD"? Do an Alt Ctrl F5? RAd publishing without debugging?
  2. Have you tried Alt F5 publishing with debugging. Does that work?

I have no repro on this on the latest build(for you insider docker) I have assumed "Do a RAD" being an Alt Ctrl F5. But there were no changes in RAD compared to the released version 15.x

Breakpoint resolution happens on the server. If the code the (BC, NAV, your term) server knows as AL source code for an application object does not match a line number of a given statement you set a breakpoint at, that is when the error you have seen happens. This means that one of the publishing scenarios have failed for you, since you have a mismatch between the source code versions

kalberes avatar Jan 16 '20 14:01 kalberes

Here's an easy example:

        case precrRecRef.Number() of
            Database::"Warehouse Shipment Header":
                begin
                    precrRecRef.SetTable(lrecWhseShipHeader);
                end;
            Database::"Transfer Header":
                begin
                    precrRecRef.SetTable(lrecTransferHeader);
                end;
            Database::"Sales Header":
                begin
                    precrRecRef.SetTable(lrecSalesHeader);
                end;
        end;

You cannot set a breakpoint on case. It will be valid, until the code runs and deploys, then the breakpoint is disabled. This is annoying when I want to examine the case statement specifically, because I need a break statement in each case instead.

mjmatthiesen avatar Jan 17 '20 19:01 mjmatthiesen

I can confirm mjmatthiesen: we can not debug case structures.

bleisibach avatar Feb 12 '20 16:02 bleisibach

I cannot debug this case statement on version 16 RTM , using Docker container:

image

rznd avatar May 06 '20 15:05 rznd

Neither do I. I cannot debug case structures Versión: ES Business Central 16.0 (Plataforma 16.0.11233.13086 + Aplicación 16.0.11240.11946)

achecac avatar May 18 '20 22:05 achecac

I have the same problem: image

guilliano avatar Jun 04 '20 10:06 guilliano

I accept it as a bug for now.

kalberes avatar Jun 04 '20 17:06 kalberes

The issue has been fixed and checked into the master branch. It will be available in the next major release of Business Central or through the preview program. Please try it out and let us know if you still encounter the issue. As requested through the support channel, the fix will also be backported to the 16 branch and will be available in the next CU (16.6)

atoader avatar Sep 02 '20 05:09 atoader

hello, i have a similar issue. I can set breakpoint in some of the methods of sales line.dal but on some of them cannot. I thought problems with symblos and cache so i redownloaded them but the issue still exist. Is this fix related to this kind of issue?

albgen avatar Oct 26 '20 15:10 albgen

Issue has been fixed since 16.6

thloke avatar Jul 21 '21 06:07 thloke