S32DS IDE: CMake project Debug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32DS IDE: CMake project Debug

ソリューションへジャンプ
3,877件の閲覧回数
Bruce_Ye
Contributor I

hello,

I am using cmake+nijia to create ELF files instead of S32DS IDE. The target development board is S32K344, and the compiler is GHS.

I have successfully generated ELF files so far, but when using PE for ELF file debugging, it does not work as expected, such as the Step over and Step return functions.

Bruce_Ye_0-1705396720058.png

 

Here is the CMake project configuration I am using

***********************************CompileCfg.cmake**************************************

# Basic Settings
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR ARM)

# Set up compiler
set(CMAKE_ASM_COMPILER "D:/D/tools/ghs/comp_202114/ccarm.exe")
set(CMAKE_C_COMPILER "D:/D/tools/ghs/comp_202114/ccarm.exe")
set(CMAKE_LINKER "D:/D/tools/ghs/comp_202114/ccarm.exe")
set(CMAKE_AR "D:/D/tools/ghs/comp_202114/ccarm.exe")

# Set compilation link options
set(C_OPTIONS "-preprocess_assembly_files -c99 --gnu_asm -g -dwarf2 -Onone -DSTART_FROM_FLASH -DS32K3XX -DENABLE_FPU -DLTC_ISOFT_CUSTOM -DINIT_STDBY_RAM -DARMCM7_SP -D__ITCM_INIT -D__DTCM_INIT -D__ghs__  -DGEELY_SPECIFICATION_USED=1 -DDISABLE_MCAL_INTERMODULE_ASR_CHECK -DBTB_ENABLE -DUSING_OS_AUTOSAROS -DS32K344 -DGHS -cpu=cortexm7 -fsingle -thumb -MD")
set(ASM_OPTIONS ${C_OPTIONS})
set(LD_OPTIONS "--gnu_asm -g -dwarf2 -nostartfiles -cpu=cortexm7 -thumb")

set(CMAKE_C_FLAGS ${C_OPTIONS})
set(CMAKE_ASM_FLAGS ${ASM_OPTIONS})

set(CMAKE_EXE_LINKER_FLAGS ${LD_OPTIONS})
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_C_FLAGS CMAKE_ASM_FLAGS)

set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 
******************************************CMakeLists.txt***********************************************
set(target_name "S32K344")

# Contains compile link configuration/lookup function cmake file
include(./CompileCfg.cmake)
include(./Function.cmake)
 
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

# Set project name and language
project(${target_name}_prj LANGUAGES C ASM)

# Set C language standard
set(CMAKE_C_STANDARD 99) # C99标准
set(CMAKE_C_EXTENSIONS ON) # 开启扩展,开启编译器特有扩展
set(CMAKE_C_STANDARD_REQUIRED ON) #强制指定标准

# Set engineering/OS src path
set(OS_SRC_DIR "${CA_DIR}/01_ProductCode/RTOS")
set(PRJ_SRC_DIR "${CA_DIR}/02_ProjectCode/00_OS_Project/${target_name}_CMake/src")

# Set link script file
set(LINK_SCRIPTS
    --gnu_asm
    -g
    -dwarf2
    -T "../src/McalLib/Mcal_lib/Platform_TS_T40D34M10I0R0/build_files/ghs/linker_flash_s32k344.ld"
    -e Reset_Handler
    -nostartfiles
    -cpu=cortexm7
    -thumb
)

# Set CommmonInclude header file directory
set(PRJ_COMMMONINCLUDE_INCS "${PRJ_SRC_DIR}/CommmonInclude")

# Contains cmake files corresponding to each module
include(${OS_SRC_DIR}/Os.cmake)
include(${PRJ_SRC_DIR}/McalLib/Mcal.cmake)
include(${PRJ_SRC_DIR}/Generate/Generate.cmake)

# Project Add Header File Dependency
include_directories(${PRJ_COMMMONINCLUDE_INCS} ${PRJ_GENERATE_INCS} ${BSW_OS_INCS} ${PRJ_SOURCE_INCS})
# get_property(dirs DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
# message(">>> include_dirs=${dirs}")

# Set output file
set(EXECUTABLE ${target_name}.elf CACHE INTERNAL "TARGET")

# Obtain user files and build them
file(GLOB PRJ_MAIN_SRCS "${PRJ_SRC_DIR}/*.c")
add_executable(${EXECUTABLE} ${PRJ_MAIN_SRCS})

# Introduce subdirectories and build them
target_sources(${EXECUTABLE} PUBLIC ${PRJ_MCAL_SRCS})
target_sources(${EXECUTABLE} PUBLIC ${PRJ_GENERATE_SRCS})
target_sources(${EXECUTABLE} PUBLIC ${BSW_OS_SRCS})

# Special processing of assembly files
list(APPEND CMAKE_ASM_SOURCE_FILE_EXTENSIONS S asm inc)
set(MCAL_ASM_PATH "${PRJ_SRC_DIR}/McalLib/Mcal_lib/Platform_TS_T40D34M10I0R0/startup/src/m7/ghs")
set(SAM_OBJ "${OS_SRC_DIR}/Platform/S32K3/S32K344/Arch_PendSV.s" "${MCAL_ASM_PATH}/startup_cm7.s" "${MCAL_ASM_PATH}/Vector_Table.s")
SET_SOURCE_FILES_PROPERTIES(${SAM_OBJ} PROPERTIES LANGUAGE ASM)
target_sources(${EXECUTABLE} PUBLIC ${SAM_OBJ})

# Link Options
target_link_options(${EXECUTABLE} PRIVATE  ${LINK_SCRIPTS})
***************************************************************************************************************

How to use IDE debugging correctly,

Kind Regards.

            
0 件の賞賛
返信
1 解決策
3,692件の閲覧回数
stanish
NXP Employee
NXP Employee

Hi,

This issue is probably related to a known issue listed in the S32DS release notes:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-for-S32-Platform-v3-...

Step out work incorrect with dbg_derived_types source: The GHS toolchain does not
generate DWARF Call Frame information that is suitable for unwinding the call stack. For
third-party debuggers incapable of unwinding the call stack through an alternate means
(disassembling code), this may nullify the ability to walk the call stack or view variables saved
in previous frames. As a workaround S32DS removes the debug frames info to force GDB client
to recreate the frames. In some cases this method may not work and lead to incorrect behaviour
for Step out command.
Workaround: Set a breakpoint at function end and run to breakpoint

Similar issue was pressent in S32DS for arm/power:

Problems could be experienced while debugging of elf file generated by GHS compiler like
missing call stack information, incorrect info on step into function, etc.
Workaround: On occasion GHS generates GDB incompatible debug information preventing the
debugger from displaying the call stack. In some cases, without such information gdb can still
debug your program. The program build needs to be augmented with a post-build step, select the
project in the project explorer view and File->Properties to display the project properties, under
C/C++ Build -> Settings select the build steps tab and enter the command gstrip –
r=.debug_frame executable. Switch to Instruction Stepping Mode to be able to step through
function. If this workaround does not help – please report issue to GreenHills support.

Hope it helps.

Stan

元の投稿で解決策を見る

4 返答(返信)
306件の閲覧回数
kdscrr
Contributor II

@Bruce_Ye  hello, may I ask you a question?
how to import the source code into the S32DS ide?
when I import the elf which is generated by ghs into S32DS, but when I download the elf into MCU, I can not see the source code , only see the assembly code?
thanks

0 件の賞賛
返信
3,875件の閲覧回数
Bruce_Ye
Contributor I

The following is the engineering log of IDE using the GHS compiler:

******************************************************************************

Finished building: ../src/main.c

Building file: ../Projectcode/Mcal_config/src/Clock_Ip_Cfg.c
Invoking: GHS C Compiler for ARM Standalone
ccarm -preprocess_assembly_files -c99 --gnu_asm -g -dwarf2 -Onone -DSTART_FROM_FLASH -DS32K3XX -DENABLE_FPU -DLTC_ISOFT_CUSTOM -DINIT_STDBY_RAM -DARMCM7_SP -D__ITCM_INIT -D__DTCM_INIT -D__ghs__ -DGEELY_SPECIFICATION_USED=1 -DDISABLE_MCAL_INTERMODULE_ASR_CHECK -DBTB_ENABLE -DUSING_OS_AUTOSAROS -DS32K344 -DGHS -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Extend" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\CommonInclude" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Kernel" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Platform" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\BSW_Config" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Base_TS_T40D34M10I0R0" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Base_TS_T40D34M10I0R0\header" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Base_TS_T40D34M10I0R0\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Base_TS_T40D34M10I0R0\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Det_TS_T40D34M10I0R0" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Det_TS_T40D34M10I0R0\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Det_TS_T40D34M10I0R0\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Mcu_TS_T40D34M10I0R0" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Mcu_TS_T40D34M10I0R0\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Mcu_TS_T40D34M10I0R0\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\build_files" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\build_files\ghs" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\startup" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\startup\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\startup\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\startup\src\m7" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Platform_TS_T40D34M10I0R0\startup\src\m7\ghs" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Rte_TS_T40D34M10I0R0" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Rte_TS_T40D34M10I0R0\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal\Rte_TS_T40D34M10I0R0\src" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal_config" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal_config\include" -I"D:\D\workpalce\S32k344\S32K344_DEMO_20\Projectcode\Mcal_config\src" -cpu=cortexm7 -fsingle -thumb -MD -c -o "Projectcode/Mcal_config/src/Clock_Ip_Cfg.o" "../Projectcode/Mcal_config/src/Clock_Ip_Cfg.c"
"D:\D\workpalce\S32k344\S32K344_DEMO_20\Platform\Arch_Define.h", line 66: warning #1-D:
last line of file ends without a newline
/*=======[E N D O F F I L E]==============================================*/
^

Finished building: ../Projectcode/Mcal_config/src/Clock_Ip_Cfg.c

************************************************************************************************

Building target: S32K344_DEMO_20.elf
Invoking: GHS C Linker for ARM Standalone
ccarm --gnu_asm -g -dwarf2 -T "D:/D/workpalce/S32k344/S32K344_DEMO_20/Projectcode/Mcal/Platform_TS_T40D34M10I0R0/build_files/ghs/linker_flash_s32k344.ld" -e Reset_Handler -nostartfiles -cpu=cortexm7 -thumb -o "S32K344_DEMO_20.elf" ./src/main.o ./Projectcode/Mcal_config/src/Clock_Ip_Cfg.o ./Projectcode/Mcal_config/src/Clock_Ip_PBcfg.o ./Projectcode/Mcal_config/src/IntCtrl_Ip_Cfg.o ./Projectcode/Mcal_config/src/Mcu_Cfg.o ./Projectcode/Mcal_config/src/Mcu_PBcfg.o ./Projectcode/Mcal_config/src/OsIf_Cfg.o ./Projectcode/Mcal_config/src/Platform_Cfg.o ./Projectcode/Mcal_config/src/Platform_Ipw_Cfg.o ./Projectcode/Mcal_config/src/Power_Ip_Cfg.o ./Projectcode/Mcal_config/src/Power_Ip_PBcfg.o ./Projectcode/Mcal_config/src/Ram_Ip_Cfg.o ./Projectcode/Mcal_config/src/Ram_Ip_PBcfg.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Adc.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Can.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Crc.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Crypto.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Dio.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Eth.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_EthSwt_43_SJA11XX.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_EthTrcv_43_PHY.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Fee.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Fls.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Gpt.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_I2c.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_I3c.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Icu.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Iseled.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Lin.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Mcl.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Mcu.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Ocu.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Port.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Pwm.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Rm.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Sai.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Sbc_fs26.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Sbc_fs86.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Sent.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Spi.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Uart.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Wdg.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Wdg_43_fs26.o ./Projectcode/Mcal/Rte_TS_T40D34M10I0R0/src/SchM_Wdg_43_fs86.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/m7/ghs/Vector_Table.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/m7/ghs/startup_cm7.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/m7/exceptions.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/m7/startup.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/nvic.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/sys_init.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/startup/src/system.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/src/IntCtrl_Ip.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/src/Platform.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/src/Platform_Ipw.o ./Projectcode/Mcal/Platform_TS_T40D34M10I0R0/src/System_Ip.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Data.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Divider.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_DividerTrigger.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_ExtOsc.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_FracDiv.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Frequency.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Gate.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_IntOsc.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Irq.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Monitor.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Pll.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_ProgFreqSwitch.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Selector.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Clock_Ip_Specific.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Mcu.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Mcu_Dem_Wrapper.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Mcu_Ipw.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_CortexM7.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_FLASH.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_MC_ME.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_MC_RGM.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_MC_RGM_Irq.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_PMC.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_PMC_Irq.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Power_Ip_Private.o ./Projectcode/Mcal/Mcu_TS_T40D34M10I0R0/src/Ram_Ip.o ./Projectcode/Mcal/Det_TS_T40D34M10I0R0/src/Det.o ./Projectcode/Mcal/Det_TS_T40D34M10I0R0/src/Det_stub.o ./Projectcode/Mcal/Base_TS_T40D34M10I0R0/src/OsIf_Timer.o ./Projectcode/Mcal/Base_TS_T40D34M10I0R0/src/OsIf_Timer_System.o ./Projectcode/Mcal/Base_TS_T40D34M10I0R0/src/OsIf_Timer_System_Internal_Systick.o ./Projectcode/BSW_Config/Os_Cfg.o ./Projectcode/BSW_Config/Os_Intvet.o ./Projectcode/BSW_Config/Os_Kdata.o ./Projectcode/BSW_Config/Os_UserInf.o ./Platform/Arch_Extend.o ./Platform/Arch_Irq.o ./Platform/Arch_Mpu.o ./Platform/Arch_PendSV.o ./Platform/Arch_Processor.o ./Platform/Arch_Timer.o ./Platform/Arch_Trap.o ./Kernel/Os_Alarm.o ./Kernel/Os_Appl.o ./Kernel/Os_Core.o ./Kernel/Os_Counter.o ./Kernel/Os_Event.o ./Kernel/Os_Hook.o ./Kernel/Os_Interrupt.o ./Kernel/Os_Ioc.o ./Kernel/Os_Kernel.o ./Kernel/Os_Mprot.o ./Kernel/Os_Panic.o ./Kernel/Os_Peripheral.o ./Kernel/Os_Resource.o ./Kernel/Os_Rpc.o ./Kernel/Os_ScheduleTable.o ./Kernel/Os_Spinlock.o ./Kernel/Os_Sprot.o ./Kernel/Os_StackMonitor.o ./Kernel/Os_Task.o ./Kernel/Os_Tprot.o ./Extend/Os_Extend.o
Finished building target: S32K344_DEMO_20.elf

**********************************************************************************************

Bruce_Ye_0-1705398814437.png

**********************************************************************************************

Bruce_Ye_1-1705398847049.png

 

0 件の賞賛
返信
3,693件の閲覧回数
stanish
NXP Employee
NXP Employee

Hi,

This issue is probably related to a known issue listed in the S32DS release notes:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-for-S32-Platform-v3-...

Step out work incorrect with dbg_derived_types source: The GHS toolchain does not
generate DWARF Call Frame information that is suitable for unwinding the call stack. For
third-party debuggers incapable of unwinding the call stack through an alternate means
(disassembling code), this may nullify the ability to walk the call stack or view variables saved
in previous frames. As a workaround S32DS removes the debug frames info to force GDB client
to recreate the frames. In some cases this method may not work and lead to incorrect behaviour
for Step out command.
Workaround: Set a breakpoint at function end and run to breakpoint

Similar issue was pressent in S32DS for arm/power:

Problems could be experienced while debugging of elf file generated by GHS compiler like
missing call stack information, incorrect info on step into function, etc.
Workaround: On occasion GHS generates GDB incompatible debug information preventing the
debugger from displaying the call stack. In some cases, without such information gdb can still
debug your program. The program build needs to be augmented with a post-build step, select the
project in the project explorer view and File->Properties to display the project properties, under
C/C++ Build -> Settings select the build steps tab and enter the command gstrip –
r=.debug_frame executable. Switch to Instruction Stepping Mode to be able to step through
function. If this workaround does not help – please report issue to GreenHills support.

Hope it helps.

Stan

3,675件の閲覧回数
Bruce_Ye
Contributor I

Thank you for your help. 

"Problems could be experienced while debugging of elf file generated by GHS compiler like
missing call stack information, incorrect info on step into function, etc.". It is indeed here that caused the problem. I encountered the same issue during debugging when deleting gstrip - r=. debug_frame ${ProjName}. elf in the S32DS compiled project. 

Next, I need to add relevant commands to my CMakeLists.txt. I hope everything goes smoothly.

0 件の賞賛
返信