[SOLVED] What algorithm is used for the Source Viewers assembly display?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] What algorithm is used for the Source Viewers assembly display?

    Hi and thank you for a great tool!

    Ozone v3.20e
    Ubuntu 20.04

    With gdb I can choose to show disassembly in a source centric (disassemble /m FUNCTION) or machine code centric (disassemble /s FUNCTION) view.
    It looks to me like Ozone provides a similar distinction through the Source Viewer and Disassembly Window.

    But I'm a little puzzed about what algorithm the Source Viewer uses when displaying disassembly.
    The main function in my attached program has a bunch of inlined functions when building with -Os.
    For usart_setup Ozone displays the inlined function body. But for clock_setup and gpio_setup it don't.
    Is this the expected behavior? At first I thought you were just not associating inlined code with the original source lines, but that does happen for usart_setup.

    In contrast: gdb shows assembly code associated for both clock_setup and gpio_setup.

    Attaching a small libopencm3 project for stm32f4discovery (I've deleted the libopencm3 folder due to the forum software not allowing uploads larger than 1M.
    But the elf file is there and the c-file with the main function. If you want to download libopencm3 and rebuild the project, just type make.

    Attaching a screenshot of Ozones source viewer and the output of gdb /m main
    Images
    • ozone_main.png

      102.48 kB, 646×873, viewed 348 times
    • gdb_m_main.png

      84.17 kB, 559×1,000, viewed 351 times
    Files

    The post was edited 4 times, last by dannas ().

  • Hello,

    Thank you for your inquiry.
    Generally we do not recommend to have optimizations active when trying to debug as debug information may be missing which is crucial for many of the Ozone features.
    On first glance it also appears that gdb is not correct with the grouping either.

    Anyhow thank you for the report and we will check if Ozones behaviour can be improved here. But no promises.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    FYI.
    We improved Ozone so he display of size optimized code in the inline disassembly is accurate now.
    This will be available with the next Ozone update.
    You can subscribe to our notification mail to stay up to date:
    segger.com/notification/subscribe.php?prodid=178,7

    Best regards,
    Nino
    Images
    • SizeOptimizedCode.png

      31.62 kB, 817×743, viewed 264 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.