[PATCH] libdebugger: Fix for ARMv7-M with -O0 optimization

Chris Johns chrisj at rtems.org
Mon Feb 25 21:46:25 UTC 2019


Hi,

The patch looks like it is masking something but I am not sure.

What are the errors at -O0 the patch is attempting to resolve?

Which BSP is showing the issue?
What is the multilib ARM arch?

Are these errors seen at -O2 and if not why does -O0 cause them?

The intention is for the ARM back end to work on more than the CortexA9 so I am
concerned with making the whole of `target_exception` dependent on CP15.

Chris

On 25/2/19 11:47 pm, Sebastian Huber wrote:
> ---
>  cpukit/libdebugger/rtems-debugger-arm.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/cpukit/libdebugger/rtems-debugger-arm.c b/cpukit/libdebugger/rtems-debugger-arm.c
> index 722dd54924..95e26ada76 100644
> --- a/cpukit/libdebugger/rtems-debugger-arm.c
> +++ b/cpukit/libdebugger/rtems-debugger-arm.c
> @@ -439,6 +439,7 @@ arm_debug_break_write_control(int bp, uint32_t control)
>    }
>  }
>  
> +#if ARM_CP15
>  static void
>  arm_debug_break_write_value(int bp, uint32_t value)
>  {
> @@ -493,6 +494,7 @@ arm_debug_break_write_value(int bp, uint32_t value)
>      break;
>    }
>  }
> +#endif
>  
>  static void
>  arm_debug_break_clear(void)
> @@ -514,6 +516,7 @@ arm_debug_set_context_id(const uint32_t id)
>    ARM_CP15_WRITE(id, 0, 13, 0, 1);
>  }
>  
> +#if ARM_CP15
>  /*
>   * You can only load the hardware breaks points when in the SVC mode or the
>   * single step inverted break point will trigger.
> @@ -540,6 +543,7 @@ arm_debug_break_load(void)
>    }
>    rtems_interrupt_lock_release(&target_lock, &lock_context);
>  }
> +#endif
>  
>  static void
>  arm_debug_break_unload(void)
> @@ -583,6 +587,7 @@ rtems_debugger_target_configure(rtems_debugger_target* target)
>    return arm_debug_probe(target);
>  }
>  
> +#if ARM_CP15
>  static void
>  target_exception(CPU_Exception_frame* frame)
>  {
> @@ -938,7 +943,6 @@ target_exception_data_abort(void)
>    EXCEPTION_EXIT_EXC();
>  }
>  
> -#if ARM_CP15
>  /**
>   * The init value for the text section.
>   */
> @@ -975,14 +979,6 @@ rtems_debugger_target_set_vectors(void)
>    /*
>     * Dummy, please add support for your ARM variant.
>     */
> -  void* ui = target_exception_undefined_instruction;
> -  void* sc = target_exception_supervisor_call;
> -  void* pa = target_exception_prefetch_abort;
> -  void* da = target_exception_data_abort;
> -  (void) ui;
> -  (void) sc;
> -  (void) pa;
> -  (void) da;
>  }
>  #endif
>  
> 



More information about the devel mailing list