Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[DebuggerStepThrough] 04 Aug 2022 14:57 #23212

  • ic2
  • ic2's Avatar
  • Topic Author


  • Posts: 1661
  • 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

    Please Log in or Create an account to join the conversation.

    [DebuggerStepThrough] 04 Aug 2022 16:07 #23213

    • Chris
    • Chris's Avatar


  • Posts: 3974
  • 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.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    [DebuggerStepThrough] 04 Aug 2022 17:50 #23214

    • FdeRaadt
    • FdeRaadt's Avatar


  • Posts: 31
  • [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

    Please Log in or Create an account to join the conversation.

    [DebuggerStepThrough] 04 Aug 2022 21:25 #23215

    • robert
    • robert's Avatar


  • Posts: 3588
  • Frank
    System.Diagnostics

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    [DebuggerStepThrough] 04 Aug 2022 23:51 #23216

    • Chris
    • Chris's Avatar


  • Posts: 3974
  • ...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.

    docs.microsoft.com/en-us/dotnet/api/syst...iew=netframework-4.8
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    [DebuggerStepThrough] 05 Aug 2022 10:24 #23218

    • FdeRaadt
    • FdeRaadt's Avatar


  • Posts: 31
  • using System.Diagnostics
    
    [DebuggerStepThrough];
    Function etc

    It seems like I was missing the USING System.Diagnostics Statement.
    It works now

    Thanks a lot!

    Frank

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1