• AVR Freaks

Hot!Inexplicable breakpoint behaviour

Author
adown
New Users
  • Total Posts : 56
  • Reward points : 0
  • Joined: 2017/10/19 16:09:17
  • Location: Calgary
  • Status: offline
2020/02/23 11:44:14 (permalink)
0

Inexplicable breakpoint behaviour

Good morning, i have noticed some odd breakpoint behaviour in my code.  Typically when i get unresolvable breakpoints in conditional statements its a type or logic error (my own fault).  However in this case the logic is trivial.  In the first picture, with a _nop() following the else() i can place the breakpoint as shown.  However if i remove the _nop() and recompile i get a broken breakpoint and a note that it cannot be resolved to a memory address.
 
Has anyone seen behaviour like this before?
 
-Alexander

Attachment(s)

Attachments are not available: Download requirements not met
#1

8 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6566
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 11:59:38 (permalink)
    0
    what optimization level are you using ?
    the compiler rearranges the code and the nop fixes that
    #2
    ric
    Super Member
    • Total Posts : 26106
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:09:13 (permalink)
    +1 (1)
    As Jim said.
    At a guess, you have another else clause which also executes "U4RxFSM = api0x81", and the optimiser is causing it to jump there.
    Adding the NOP stops it doing that.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    adown
    New Users
    • Total Posts : 56
    • Reward points : 0
    • Joined: 2017/10/19 16:09:17
    • Location: Calgary
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:11:48 (permalink)
    0
    Thanks for the replys guys!
    The optimization (properties xc32-gcc-optimization) is set to level 0, unroll loops is unchecked.
    -Alexander
    #4
    Jim Nickerson
    User 452
    • Total Posts : 6566
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:15:47 (permalink)
    +1 (1)
    even so at level 0 there is some optimization. occasionally I have had to insert "_ehb()"
    #5
    adown
    New Users
    • Total Posts : 56
    • Reward points : 0
    • Joined: 2017/10/19 16:09:17
    • Location: Calgary
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:38:35 (permalink)
    0
    JANickerson
    even so at level 0 there is some optimization. occasionally I have had to insert "_ehb()"


     Thanks Jim, there is very little information about the execution hazard barrier instruction in the XC32 documentation.  Is there a good resource you could point me towards?
     
    -A
    #6
    Jim Nickerson
    User 452
    • Total Posts : 6566
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:47:38 (permalink)
    0
    maybe something like this https://en.wikichip.org/wiki/mips/mips32_instruction_set
     
    messing with low level Mips instructions from within C is an interesting thing to begin doing.
    Begin with looking at the assembler lst file to see what is happening.
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6566
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 12:50:21 (permalink)
    0
    sorry, the page on hazards is missing
    this may help https://www.mips.com/forums/topic/hazard-in-code/
    #8
    Jim Nickerson
    User 452
    • Total Posts : 6566
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Inexplicable breakpoint behaviour 2020/02/23 13:00:46 (permalink)
    0
    this page has the description https://s3-eu-west-1.amaz...MIPS32BIS-AFP-6.06.pdf
    Attachments are not available: Download requirements not met

    Attachment(s)

    Attachments are not available: Download requirements not met
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5