[SOLVED] Ozone displays incorrect program flow??

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

  • [SOLVED] Ozone displays incorrect program flow??

    I am evaluating ozone as a debugger for my STM32F411E-Discovery project. I am new to ozone so this might be a configuration error but....

    ozone v3.10g (on xubuntu 19.10) displays incorrect program flow when stepping through an ELF file.

    The short video file here : tinyurl.com/y8h5as5n
    shows that gdbgui single-steps through my program correctly ("BUTTON_DOWN" is TRUE so it executes lines 121, 123, 125, 126, 127, 139, ...)
    but ozone does does a little hiccup and executes lines 121, 123, 121, 123, 125, 126, 127, 139, ....
    It is the same binary, compiled with arm-none-eabi-gcc with no optimization flags.
    I can repeat this strange behaviour with other programs too.
    Can this behaviour be explained?

    Thanks for your help....
    Dean
  • Hello Dean,

    Thank you for your inquiry.
    Such an issue is not known to us.
    Do you see the same behaviour with the latest Ozone version 3.20a as well?
    If yes could you provide your example project for reproduction?

    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.
  • Nino, Yes the problem persists even in Ozone v3.20a.
    Yes I have a project ready to send you that reproduces the problemm. How do I send it to you? Do I attach it here?

    [update: submitted a ticket with the requested attachment]

    The post was edited 1 time, last by dwneumann: [ update ] ().

  • Hi,

    Thank you for providing the example project. With it the behaviour was reproducible. However Ozone acts correctly as the compiler does multiple optimizations here e.g. the LDRB R3, [R5] of source line 123 reused or the LDR of the GPIO registers is also reused from multiple different c source lines. This grouping of instructions to source file is done by the compiler and Ozone simply displays it.

    Comparing it to the behaviour of the other debugger you use in your video it appears that debugger does not care about the instruction grouping but on a step over it lets the target execute until the next line is reached. So it appears more "logical" from the programflow. But that approach can lead to unexpected behaviour when debugging many other constructs as it is not consistent.

    Ozone will always behave the same when doing a step over avoid such issues but in special cases like this where a compiler optimizes code it may appear as if the programflow is incorrect.
    You can verify that Ozone is doing everything correctly with the disassembly window and the in line disassembly in the source file.

    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.