microsoft / microsoft/AL

Debugger doesn't support some breakpoint Expression types/formats, but the error is not reported and buried in the Locals section...

Open
#6,840 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bydesign debugger documentation enhancement idea
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
I just wasted an hour or two of my life, trying to determine why conditional breakpoints seemingly didn't work, when in fact it appears to be a limitation of the AL extension for VSC - but one that's very quietly reported, nowhere useful, the developer might never see it!!

2. To Reproduce

  1. Have some code that you need to debug, but you need to only break when a condition is met involving a GUID, e.g. in a loop.
  2. Create a breakpoint in VSC and add a condition Expression to it, e.g. IsNullGuid(SomeRecord.SomeField)
  3. Run the debugger and see that the breakpoint is always hit, even when SomeRecord.SomeField is clearly not a NullGuid.

3. Expected behavior

  • I expected the Expression to work.
  • I now expect at least an error to be reported somewhere I can see it / am not likely to miss it... i.e. in a popup message box, etc. - for all such errors of unsupported Expressions (not just those involving Guids).

4. Actual behavior

  • There is an error, but it's buried at the bottom of the Locals tab as an _ALException:
    image
    image
  • This exception should be caught by VSC and reported clearly and unambiguously to the user, and the debugger should stop, so the user can evaluate the problem and determine an alternative condition for their breakpoint!
  • But instead, the debugger continues running and stopping on the breakpoint, despite the condition not being met / being invalid. So the user tries and fails with other expressions - until, IF they are miraculously lucky, they notice the _ALException.

5. Versions:

  • AL Language:
Name: AL Language
Id: ms-dynamics-smb.al
Description: AL development tools for Dynamics 365 Business Central
Version: 8.2.545335
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al
  • Visual Studio Code: 1.62.2
  • Business Central:
  • List of Visual Studio Code extensions that you have installed:
    image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the conditional-breakpoint failure in the AL Language extension for Visual Studio Code using an unsupported expression such as IsNullGuid(SomeRecord.SomeField). Inspect how the debugger exposes the resulting _ALException in the Locals tab. Done means unsupported expression errors are clearly reported and the breakpoint does not silently continue as though its condition were valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.