Skip to content

Normal breakpoints don't get hit util exception line gets hit. #94

Description

@JanusTida

I downloaded the repo,and launched the code without changing any lines,and the workspace stops at the top line ("# VS Code Mock Debug") normally,and I set the a breakpoint at line 3,then continue,but the execution doesn't stop at line 3.
I dive into the code,and see the possible reasons to cause this:
In MockRuntime class,there's a method called findNextStatement:

 */
	 private findNextStatement(reverse: boolean, stepEvent?: string): boolean {

		for (let ln = this.currentLine; reverse ? ln >= 0 : ln < this.sourceLines.length; reverse ? ln-- : ln++) {

			// is there a source breakpoint?
			const breakpoints = this.breakPoints.get(this._sourceFile);
			if (breakpoints) {
				const bps = breakpoints.filter(bp => bp.line === ln);
                        ...
                        }
                   ...
              }
       }

The breakpoints will be undefined,cuz this.breakpoints holds an entry, the key of which is "c:/Code Repository/vscode-mock-debug/sampleWorkspace/readme.md",
but the _sourceFile is "C:/Code Repository/vscode-mock-debug/sampleWorkspace/readme.md" now,see what's different?
the previous one starts with a lowercase drive volume while another starts with a uppercase one,and please note that I have a space char in my workspace path.
Platform:Windows
VSCodeVersion:1.76.2

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions