Hot!debug mode recognized by xc8

Author
jean claude
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2015/12/14 08:40:32
  • Location: FRANCE
  • Status: offline
2018/03/28 06:14:56 (permalink)
0

debug mode recognized by xc8

hello, in program .asm, I used IFDEF _DEBUG  for instructions to assemble if i debug main project  and to not assemble if i make and program main project automatically.
I try with with xc8, but i don't get expected results.
could someone tell me the right syntax, or if i am completely wrong
thanks in adavnce
#1

4 Replies Related Threads

    jack@kksound
    code tags!
    • Total Posts : 2736
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: debug mode recognized by xc8 2018/03/28 08:38:49 (permalink)
    +1 (1)
    Double underscore: __DEBUG
    #2
    jean claude
    New Member
    • Total Posts : 24
    • Reward points : 0
    • Joined: 2015/12/14 08:40:32
    • Location: FRANCE
    • Status: offline
    Re: debug mode recognized by xc8 2018/04/02 23:50:37 (permalink)
    0
    YES, thank you, ...I should have think about it,
    one thing: window of file .c always stay in non debug mode (production mode)
    I mean instructions inside "#ifdef __DEBUG ..... #endif" always appears like comments
    and instructions inside "#ifndef __DEBUG ..... #endif" always appears like instructions
    but it compiles fine.
     
    #3
    JorgeF
    Super Member
    • Total Posts : 3281
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: PT/EU @ Third rock from the Sun
    • Status: offline
    Re: debug mode recognized by xc8 2018/04/03 02:26:41 (permalink)
    +2 (2)
    Hi
     
    That is because the "__DEBUG" symbol is defined in the compilation command line and not in any "#define" statement in your code, so the syntax highliter allways treats "__DEBUG" as an undefined symbol.
     
     
    HIH
     
    Best regards
    Jorge
     
    #4
    jean claude
    New Member
    • Total Posts : 24
    • Reward points : 0
    • Joined: 2015/12/14 08:40:32
    • Location: FRANCE
    • Status: offline
    Re: debug mode recognized by xc8 2018/04/13 02:19:07 (permalink)
    0
    ty, I write:
    #if(IsDebug)
         #define __DEBUG
    #endif
    after config statements and include
    and syntax highlighter is ok.
    execpt the line #define __DEBUG, always comment.
    #5
    Jump to:
    © 2018 APG vNext Commercial Version 4.5