Skip to content

Include breakpoint error reason in tooltip when breakpoints cannot be set #5314

Closed

Description

@DanTup

With the fix for dart-lang/sdk#56820 / #5157, the breakpoint will no longer be set. The VM returns us a reason:

{
	"jsonrpc": "2.0",
	"error": {
		"code": 102,
		"message": "Cannot add breakpoint",
		"data": {
			"request": {
				"method": "addBreakpointWithScriptUri",
				"params": {
					"isolateId": "isolates/49774056015291",
					"scriptUri": "file:///D:/Dev/Test%20Projects/dartcode_5157/bin/dartcode_5157.dart",
					"line": "8"
				}
			},
			"details": "addBreakpointWithScriptUri: Cannot add breakpoint at line 8. Error occurred when resolving breakpoint location: No debuggable code where breakpoint was requested."
		}
	},
	"id": "15"
}

We should wire this up to the reason field on the breakpoint so that it shows if the user hovers over the grey breakpoint.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Oct 16, 2024
  2. added this to the On Deck milestone on Oct 16, 2024
  3. modified the milestones: On Deck, v3.106.0 on Feb 11, 2025
  4. DanTup commented on Feb 12, 2025

    @DanTup
    MemberAuthor

    Image

    Image

  5. DanTup commented on Feb 12, 2025

    @DanTup
    MemberAuthor
  6. DanTup commented on Feb 25, 2025

    @DanTup
    MemberAuthor

    This landed in dart-lang/sdk@7ec6bdc. It's in the SDK, so it will show up in a future SDK release (rather than a Dart-Code release).

  7. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Feb 25, 2025
  8. cddqssc commented on Mar 27, 2025

    @cddqssc

    This landed in dart-lang/sdk@7ec6bdc. It's in the SDK, so it will show up in a future SDK release (rather than a Dart-Code release).

    I encountered this problem(both macos & windows) in vscode. Is there any solution at present?
    !! ⚠️ PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING ⚠️ !!
    Dart Code extension: 3.106.0
    Flutter extension: 3.106.0 (activated)

    App: Visual Studio Code
    App Host: desktop
    Version: win 1.98.2

    Workspace type: Flutter (LSP)
    Workspace name: vocal

    Dart (3.7.2): C:\Users\Administrator\flutter\bin\cache\dart-sdk
    Flutter (3.29.2): C:\Users\Administrator\flutter (No device)

    Logging Categories:
    General, AnalyzerTiming, CommandProcesses, DartTest, DartToolingDaemon, DAP, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, WebDaemon

    Thu Mar 27 2025 [19:07:59 GMT+0800 (China Standard Time)] Log file started
    [7:07:59 PM] [DAP] [Info] ==> {"command":"updateSendLogsToClient","arguments":{"enabled":true},"type":"request","seq":222}
    [7:07:59 PM] [DAP] [Info] <== {"seq":27418,"type":"response","command":"updateSendLogsToClient","request_seq":222,"success":true}
    [7:08:01 PM] [DAP] [Info] ==> {"command":"setBreakpoints","arguments":{"source":{"adapterData":{"type":"@script","id":"libraries/@459260529/scripts/package%3Avocal%2Fpb.dart/195d744d5a2","fixedId":true,"uri":"package:vocal/pb.dart"},"name":"package:vocal/pb.dart","path":"d:\vocal\lib\pb.dart"},"lines":[444],"breakpoints":[{"line":444}],"sourceModified":false},"type":"request","seq":223}
    [7:08:01 PM] [DAP] [Info] <== {"seq":27419,"type":"event","body":{"message":"==> [VM] {"jsonrpc":"2.0","id":"855","method":"addBreakpointWithScriptUri","params":{"isolateId":"isolates/76909889101183","scriptUri":"file:///D:/vocal/lib/pb.dart","line":444}}"},"event":"dart.log"}
    [7:08:01 PM] [VmService] [Info] [vocal (Medium Phone API 35)] ==> [VM] {"jsonrpc":"2.0","id":"855","method":"addBreakpointWithScriptUri","params":{"isolateId":"isolates/76909889101183","scriptUri":"file:///D:/vocal/lib/pb.dart","line":444}}
    [7:08:02 PM] [DAP] [Info] <== {"seq":27420,"type":"event","body":{"message":"<== [VM] {"jsonrpc":"2.0","error":{"code":102,"message":"Cannot add breakpoint","data":{"request":{"method":"addBreakpointWithScriptUri","params":{"isolateId":"isolates/76909889101183","scriptUri":"file:///D:/vocal/lib/pb.dart","line":"444"}},"details":"addBreakpointWithScriptUri: Cannot add breakpoint at line 444. Error occurred when resolving breakpoint location: No debuggable code where breakpoint was requested."}},"id":"855"}"},"event":"dart.log"}
    [7:08:02 PM] [DAP] [Info] <== {"seq":27421,"type":"response","body":{"breakpoints":[{"id":100003,"verified":false}]},"command":"setBreakpoints","request_seq":223,"success":true}
    [7:08:02 PM] [VmService] [Info] [vocal (Medium Phone API 35)] <== [VM] {"jsonrpc":"2.0","error":{"code":102,"message":"Cannot add breakpoint","data":{"request":{"method":"addBreakpointWithScriptUri","params":{"isolateId":"isolates/76909889101183","scriptUri":"file:///D:/vocal/lib/pb.dart","line":"444"}},"details":"addBreakpointWithScriptUri: Cannot add breakpoint at line 444. Error occurred when resolving breakpoint location: No debuggable code where breakpoint was requested."}},"id":"855"}
    Thu Mar 27 2025 [19:08:04 GMT+0800 (China Standard Time)] Log file ended

  9. DanTup commented on Mar 27, 2025

    @DanTup
    MemberAuthor

    @cddqssc it's not very clear what the problem is from the log - could you file a new issue, and include a code sample and information about where you're trying to put a breakpoint? Thanks!

  10. cddqssc commented on Mar 27, 2025

    @cddqssc

    @DanTup
    Thanks for the quick response. As shown in the video, all functions in the pb.dart file cannot be breakpointed. This problem has never happened before. I didn't notice when it started. The video was tested on macos. I also tested it on windows and had the same problem. (Tools • Dart 3.7.2 • DevTools 2.42.3)

    record.2025-03-27.20.23.05.mov
  11. DanTup commented on Mar 27, 2025

    @DanTup
    MemberAuthor

    @cddqssc please file a new issue for this, and include a copy/pastable code sample that definitely triggered the issue and I'll take a look shortly. Thanks!

  12. cddqssc commented on Mar 27, 2025

    @cddqssc

    @DanTup Please see: #5459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions