Creating a non-zero .CDB file from sdas8051 ?

  • jmg_

    jmg_ - 2012-06-16

    Can anyone point to some examples of a sdas8051/sdld Linker batch/sources, that creates a CDB debug file ?

    I have a project that installed sdas Assembler V02.00/ sdld Linker V02.00, and their c examples all build/debug fine, and their ASM examples also build ok,  but the created .cdb file is always zero bytes ?

    If I flip the -c CDB switch in the ASM flags I can see the sym files change in size, and the linker does output a new CDB file, (and I can disable create of this), but it always has zero size ?

    I'm guessing this should all work, and that the supplied example just has some switch-glitch, but the obvious suspects do not seem to work ?

  • Maarten Brock

    Maarten Brock - 2012-06-19

    Try compiling a small file with sdcc -v and you'll see all options passed to the assembler. Then look them up in the manual or command line help output. I'm sure you will find the options you need.

  • jmg_

    jmg_ - 2012-06-19

    I'm not quite following, the batch calls sdas8051, not sdcc

    %SDCC_BIN%\sdas8051.exe -plosgffwzc -I"../../../../include/asm/sdcc"   led_blink.asm

    and it seems that 'c' switch (for cdb) does change the output file size, but the linker always generates a Zero size cdb.

    I can make the cdb come and go,  with a linker switch, but nothing will create a non zero cdb.

    So I'm not sure if this is all sdcc does, or if it is capable of creating a proper cdb file for an ASM project ?

  • Maarten Brock

    Maarten Brock - 2012-06-19

    Sorry, I made a typo. I meant sdcc -V a capital V that is, for verbose output.
    -plosgffwzc is ok for the assembler.

    But when sdcc is also used as the front-end for the linker it generates a linker script and passes that to sdld.exe. This is what it looks like:

    -i test.ihx
    -b HOME = 0x0000
    -b ISEG = 0x0000
    -b BSEG = 0x0000
    -k C:\Programs\SDCC\bin\..\lib\small
    -l mcs51
    -l libsdcc
    -l libint
    -l liblong
    -l libfloat

  • jmg_

    jmg_ - 2012-06-19

    The linker is called like this

    %SDCC_BIN%\sdld.exe -muwx -i led_blink.hex -y -b CSEG=0x100  led_blink led_blink.rel uart.rel

    Result:  Creates .cdb of 0 bytes

    Then I notice it supports another debug option , so I try a test I should have thought of before

    %SDCC_BIN%\sdld.exe -muwx -i led_blink.hex -j -b CSEG=0x100  led_blink led_blink.rel uart.rel

    Result:  Creates .noi of 7K bytes, with correct/expected symbol info.

    The .noi is not that different to a .cdb, so if it can do one, it should be able to create the other ?

    Given -j works, and -y works-but-zero-size, that does not sound like a command line issue ?

    Does anyone know if this can/should work 


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks