• AVR Freaks

Hot!Assembler source not available in debugger

Author
dharley
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2009/10/19 23:39:11
  • Location: 0
  • Status: offline
2019/10/20 05:46:35 (permalink)
0

Assembler source not available in debugger

I have an xC8 projecting for PIC18F27K40 in MPLABX using mostly .c. Have added an assembler module .s wich compiles and links ok using xc8-cc.exe v2.10.
 
The problem is when compiling for debug and running in simulator debugger, when stepping from C code into the assembler module the source code does not appear. Using Windows/Debugger/Disassembly the following is displayed:
!Source not found, file: <location>/MyProject.X/2
I don't know where the "2" comes from, I'm guessing it is supposed to be the name of the .s module which is located there. Using Windows/Target Memory View/Program Memory I can get the raw assembly and step through, just no listing is available.
 
 I notice that for .c files xc8 generates "pcode" .p1 for the linker, whereas for .s it generates conventional .o object code. Get the same result for both COFF and ELF. I'm guessing either the .o does not include debug info, or it is incompatible with xc8's debug info in the pcode files, or there is a bug filling in "2" as the file name, or I need some magic pixie dust.
 
Has anyone successfully debugged a .s module within an xc8 project?
 
Related question: there seems no way to build .asm files using mpasm and link in with C modules, within an xc8 project; and not even sure mpasm .o is compatible with c18 linker. This used to be straightforward with C18 toolchain but mpasm does not appear in the xc8 toolchain - even though xc8 release notes advertize mpasm is bundled. Now it seems the only option is to use xc8's assembler support, which seems spotty - for example lfsr and btg do not seem to be supported, and it uses different syntax to regular .asm.
 
It is true that we can't use mpasm with c18?
#1

7 Replies Related Threads

    1and0
    Access is Denied
    • Total Posts : 9899
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Assembler source not available in debugger 2019/10/20 11:24:08 (permalink)
    0
    dharley
    Has anyone successfully debugged a .s module within an xc8 project?

    No problem stepping thru an assembly source file here.
     

    Related question: there seems no way to build .asm files using mpasm and link in with C modules, within an xc8 project; and not even sure mpasm .o is compatible with c18 linker. This used to be straightforward with C18 toolchain but mpasm does not appear in the xc8 toolchain - even though xc8 release notes advertize mpasm is bundled. Now it seems the only option is to use xc8's assembler support, which seems spotty - for example lfsr and btg do not seem to be supported, and it uses different syntax to regular .asm.
     
    It is true that we can't use mpasm with c18?

    I think you meant XC8 here, not C18. The XC8 compiler is formally known as HiTech PICC, which uses a different assembler (ASPIC) that is not compatible with MPASM.
    #2
    dharley
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2009/10/19 23:39:11
    • Location: 0
    • Status: offline
    Re: Assembler source not available in debugger 2019/10/20 23:45:19 (permalink)
    0
    Correct, that should read "...compatible with xc8 linker" and "... can't use mpasm with xc8".
     
    Thanks for letting me know source debugging does in fact work somewhere - a hint problem is environmental, not fundamental.
     
    One has to question the wisdom of abandoning the mpasm toolchain for 8-bit. HiTech's is the better compiler but the millions of lines of legacy source out there is more valuable still. What, for new devices not supported by C18 we must now go through our .asm libraries and put colons after our labels, and abandon compatibility with mpasm?
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6333
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Assembler source not available in debugger 2019/10/21 06:29:57 (permalink)
    +1 (1)
    Is there some reason you can not continue using the "old" toolchain for the old existing projects making use of old legacy code ?
    #4
    dharley
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2009/10/19 23:39:11
    • Location: 0
    • Status: offline
    Re: Assembler source not available in debugger 2019/10/21 06:36:19 (permalink)
    0
    C18 is EOL in favor of xc8 and new devices are no longer being supported in C18 - in particular 18xF27K4x to which we have ported.
    #5
    jrbloom
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2019/11/10 15:56:37
    • Location: 0
    • Status: offline
    Re: Assembler source not available in debugger 2019/11/11 21:07:26 (permalink)
    0
    I have exactly the same problem, and it reproduces consistently.
    I tried generating a fresh C project, with minimal main and assembly file contents. Exact same problem.
    There seems to be some issue generating the reference source file name for assembly files.
     
    If I copy the assembly source to file named '2' to match the name reported in listing.disasm, I am able to step into the assembly. This has got me going, so might work for others as a workaround.
    #6
    mlp
    boots too small
    • Total Posts : 816
    • Reward points : 0
    • Joined: 2012/09/10 15:12:07
    • Location: previously Microchip XC8 team
    • Status: offline
    Re: Assembler source not available in debugger 2019/11/13 10:05:41 (permalink)
    +2 (2)
    1and0
    The XC8 compiler is formally known as HiTech PICC

    formerly
     
    It is formally known as XC8.

    Mark (this opinion available for hire)
    #7
    1and0
    Access is Denied
    • Total Posts : 9899
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Assembler source not available in debugger 2019/11/13 10:43:10 (permalink)
    +2 (2)
    mark.pappin
    It is formally known as XC8.

    It is known formally as MPLAB XC8 Compiler and formerly as HI-TECH PICC Compiler. mr green: mr green
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5