[RTEMS Project] #3779: arm_switch_reg undeclared when building libdebugger/rtems-debugger-arm

RTEMS trac trac at rtems.org
Wed Oct 2 00:30:49 UTC 2019


#3779: arm_switch_reg undeclared when building libdebugger/rtems-debugger-arm
----------------------------+--------------------------
 Reporter:  Andrei Chichak  |       Owner:  Chris Johns
     Type:  defect          |      Status:  assigned
 Priority:  normal          |   Milestone:
Component:  lib/debugger    |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |  Blocked By:
 Blocking:                  |
----------------------------+--------------------------

Comment (by sprhawk):

 Replying to [comment:3 Chris Johns]:
 > Replying to [comment:2 sprhawk]:
 > > I think if there is no need for arm_switch_reg, how about I void
 exception_entry_exc()?
 >
 > I am not so sure.
 >
 > > {{{
 > > #!patch
 > > From 46c1bd458196ff694ce04e74f68695fc620a7a65 Mon Sep 17 00:00:00 2001
 > > From: YANG HONGBO <sprhawk at gmail.com>
 > > Date: Tue, 1 Oct 2019 20:51:03 +0800
 > > Subject: [PATCH] try to fix failure building for STM32F4
 > >
 > > ---
 > >  cpukit/libdebugger/rtems-debugger-arm.c | 9 +++++++--
 > >  1 file changed, 7 insertions(+), 2 deletions(-)
 > >
 > > diff --git a/cpukit/libdebugger/rtems-debugger-arm.c
 b/cpukit/libdebugger/rtems-debugger-arm.c
 > > index 3d5dea0ab7..eefc83eed5 100644
 > > --- a/cpukit/libdebugger/rtems-debugger-arm.c
 > > +++ b/cpukit/libdebugger/rtems-debugger-arm.c
 > > @@ -1590,10 +1590,15 @@ target_exception(CPU_Exception_frame* frame)
 > >   #define EXCEPTION_EXIT_THREAD(_frame)
 EXCEPTION_EXIT_THREAD_V4(_frame)
 > >   #define EXCEPTION_EXIT_EXC()                EXCEPTION_EXIT_EXC_V4()
 > >  #elif defined(ARM_MULTILIB_ARCH_V7M)
 > > - #define EXCEPTION_ENTRY_EXC()               (void) arm_switch_reg
 > > + #if ARM_THUMB_ONLY
 > > +  #define EXCEPTION_ENTRY_EXC()               (void)NULL
 > > +  #define EXCEPTION_EXIT_EXC()                (void)NULL
 > > }}}
 > I do not think this would work. It means `NULL` is being loaded as the
 address. I am not familiar with the specifics of this model. Is ARM mode
 active when entering an exception? If so we need to switch to thumb mode
 and to do this we need a valid `arm_switch_reg`.
 >
 > What is your configure command line for RTEMS and I will see what is
 broken in the build?


 I think you are right, I should simply put it empty instead?
 {{{
 #!patch
 From c3caf01a5674bc4da2b926d118bf5df5baa1fe4f Mon Sep 17 00:00:00 2001
 From: YANG HONGBO <yanghongbo at iotpi.io>
 Date: Wed, 2 Oct 2019 08:12:41 +0800
 Subject: [PATCH] empty EXCEPTION_ENTRY_EXC when cpu is ARM_THUMB_ONLY

 ---
  cpukit/libdebugger/rtems-debugger-arm.c | 15 +++++++++++----
  1 file changed, 11 insertions(+), 4 deletions(-)

 diff --git a/cpukit/libdebugger/rtems-debugger-arm.c b/cpukit/libdebugger
 /rtems-debugger-arm.c
 index 3d5dea0ab7..92b3b586b4 100644
 --- a/cpukit/libdebugger/rtems-debugger-arm.c
 +++ b/cpukit/libdebugger/rtems-debugger-arm.c
 @@ -1590,10 +1590,17 @@ target_exception(CPU_Exception_frame* frame)
   #define EXCEPTION_EXIT_THREAD(_frame)
 EXCEPTION_EXIT_THREAD_V4(_frame)
   #define EXCEPTION_EXIT_EXC()                EXCEPTION_EXIT_EXC_V4()
  #elif defined(ARM_MULTILIB_ARCH_V7M)
 - #define EXCEPTION_ENTRY_EXC()               (void) arm_switch_reg
 - #define EXCEPTION_ENTRY_THREAD(_frame)      (_frame) = NULL
 - #define EXCEPTION_EXIT_THREAD(_frame)       (_frame) = NULL
 - #define EXCEPTION_EXIT_EXC()                (void) arm_switch_reg
 + #if ARM_THUMB_ONLY
 +  #define EXCEPTION_ENTRY_EXC()
 +  #define EXCEPTION_ENTRY_THREAD(_frame)      (_frame) = NULL
 +  #define EXCEPTION_EXIT_THREAD(_frame)       (_frame) = NULL
 +  #define EXCEPTION_EXIT_EXC()
 + #else
 +  #define EXCEPTION_ENTRY_EXC()               (void) arm_switch_reg
 +  #define EXCEPTION_ENTRY_THREAD(_frame)      (_frame) = NULL
 +  #define EXCEPTION_EXIT_THREAD(_frame)       (_frame) = NULL
 +  #define EXCEPTION_EXIT_EXC()                (void) arm_switch_reg
 + #endif
  #else
   #error ARM architecture is not supported.
  #endif
 --
 2.20.1

 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3779#comment:5>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list