Cannot add breakpoints to lines during debug

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

    • Cannot add breakpoints to lines during debug

      Hi,

      I have a jlink mini edu and an arduino due which is a SAM3X8E. I created a project in MicroChip Studio, compiled the file with DEBUG and loaded the elf into ozone, additionally I linked the source file and I am able to track the programs function(sort of) in the source file.

      I am having an issue where single steps do not work and the program only halts at function calls, additionally I can only add break points to function calls. I cannot add break points to any other line type. According to system variables breakpoints of any type are permitted.

      I can enter the disassembly and engage in single step, but I cannot single step through the C program.

      Any idea what is going on?

      edit:

      I tried loading the example project in embedded studio and it behaves correctly, there must be something wrong with the compiler/gdb settings when using microchip studio - any ideas?

      The post was edited 2 times, last by Blunk ().

    • Hello,

      Thank you for your inquiry.
      You can only set breakpoints on source lines for which the compiler has created code and symbols for. Ozone will then try to match them if available. You can see where breakpoints in source can be set with the little dot icons next to the source line number.

      So either the symbols are not created correctly/as expected by the compiler, or Ozone interprets them incorrectly.
      Which compiler have you set up for code generation? Are any code optimizations active?

      You write you can "sort of" trace the execution in Ozone. What does that mean? What does work, what does not work?
      Could you provide a video showing the issue and explain what you would expect?

      Could you provide an example project for reproduction (elf file + sources)?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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.
    • Hi,

      look at the optimization settings. The more your code is optimized, the harder it is to debug with source stepping. Try compiling with -O0 or -Og.

      Also add warning flags to the build. -Wall -Wextra and such. Sometimes it warns you about conditions that are always true or false and then a whole block might be skipped from compiling.

      Cheers