[DebuggerStepThrough]

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

[DebuggerStepThrough]

Post by ic2 »

I thought I asked this before but can't find it back.

If we want during debugging that a certain method is skipped (when e.g. step is chosen) I thought in VS you should add:
[DebuggerStepThrough]
just above the method/function.
This works in C#.
However, in X# I get Error XS9002 Parser: unexpected CRLF, are you missing a token ?

I tried it with an extra empty line after it, with and without a ; but no luck.

What should it be?

Dick
User avatar
Chris
Posts: 4986
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

[DebuggerStepThrough]

Post by Chris »

Hi Dick,

You just need a ";" between the attribute and the method declaration, and no empty lines in between. Just as if it was a single statement.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FdeRaadt
Posts: 31
Joined: Wed Sep 01, 2021 12:49 pm
Location: Netherlands

[DebuggerStepThrough]

Post by FdeRaadt »

Code: Select all

[DebuggerStepThrough];
Function DBG(cString as string) as void pascal
Error XS0246 The type or namespace name 'DebuggerStepThroughAttribute' could not be found (are you missing a using directive or an assembly reference?)

Which reference do you need to use this?
I assumed it is covered by Xsharp.RT but I still have this error
User avatar
robert
Posts: 4567
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

[DebuggerStepThrough]

Post by robert »

Frank
System.Diagnostics

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4986
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

[DebuggerStepThrough]

Post by Chris »

...that is, you need a USING System.Diagnostics statement. The dll it is contained in is the most standard library that is referenced automatically by all projects (mscorlib.dll), so no need to add any additional reference.

https://docs.microsoft.com/en-us/dotnet ... mework-4.8
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FdeRaadt
Posts: 31
Joined: Wed Sep 01, 2021 12:49 pm
Location: Netherlands

[DebuggerStepThrough]

Post by FdeRaadt »

Code: Select all

using System.Diagnostics

[DebuggerStepThrough];
Function etc
It seems like I was missing the USING System.Diagnostics Statement.
It works now

Thanks a lot!

Frank
Post Reply