NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Example Applications changes for GDB debugging

From Texas Instruments Wiki
Jump to: navigation, search


Sitara SDK 5.0.3 - Considerations for GDB Debugging Example Applications[edit]

 This applies to the CCSv5 Makefile projects am-benchmarks and am-sysinfo in the Sitara SDK 5.0.3

 (Nov 2011).  The makefiles for these projects require a change to allow GDB debugging to work properly.

 The original makefiles have both the -O3 (optimize level 3) and -g3 (include symbolic information - level 3)

 options included for the debug build.  This produces erratic behavior when stepping thru the code using

 CCSv5. 

 

Correction to the Makefiles (Required for GDB Debuggiong)[edit]

The following make files are affected:

<TI_SDK_PATH>/example-applications/am-benchmarks-1.3/armv7a/dhrystone/makefile

<TI_SDK_PATH>/example-applications/am-benchmarks-1.3/armv7a/linpack/makefile

<TI_SDK_PATH>/example-applications/am-benchmarks-1.3/armv7a/whetstone/makefile

<TI_SDK_PATH>/example-applications/am-benchmarks-1.3/armv7a/dhrystone/makefile

<TI_SDK_PATH>/example-applications/am-sysinfo-1.0/mem_util/makefile


The remiander of this article uses the dhrystone project.

In each of the makefiles listed above find the definition of ALL_CFLAGS in the make file.   Delete the line that contains -O3.  This line is highlighted below.


  Gdb-1.png


Find the object file rule for the release build.  Insert the -O3 option in the compiler command as highlighted in the screen capture below.   The console shows the

corrected compiler options for the Debug build configuration.


  Gdb-2.png

 

Addition of Include Paths (Optional)
[edit]


The am-benchmarks and am-sysinfo projects are CCS Makefile projects.   CCS calls the external GCC toolchain which compiles and links the

program and takes care of accessing all required system header files.  But inside CCS, errors are shown because the paths to the include files

have not been specified in the CCS project files.   This is usually acceptable as is because GDB will not allow you to step into CLIB functions

anyway, since the CLIB source code is not contained within the SDK.  It only means that CCS will not be able to resolve some symbols.


Gdb-3.png


To make the CLIB header files accessible inside the CCS project the following two paths can be included in the project properties.    Set the configuration

to "All Configurations" to make the change for debug and release build configurations.  Add the include paths to TI GNU C.   Paths relative to the project

within the SDK are used here.


  Gdb-8.png



Addition of Define Constants (Optional)[edit]


Again, since the am-benchmarks and am-sysinfo projects are CCS Makefile projects, all define constants that are passed to the compiler are specified

in the makefile.   For CCS to be aware of the settings of the #define constants, these settings need to be added to the CCS project.   The symbolic

debugging will take place according to the #defines as set in the makefile, but there may be #define constants that the debugger will be unable to resolve.

Set the configuration to "All Configurations" to make the change for debug and release build configurations. Add the same #define symbol definitions that are

contained in the makefile to TI GNU C.


Gdb-5.png


The result is shown below.  Errors reported by CCS are all resolved.  The duplicate path warning can be ignored.  The project has both debug and release build configurations and

the CCS project defaults each to the output path where the project is located.  But this is not used, since the actual output paths are controlled by the make file.  The makefile specifies that

the intermediate files and executables go to the Debug and Release subdirectories of the project.


Gdb-6.png

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Example Applications changes for GDB debugging here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Example Applications changes for GDB debugging here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Example Applications changes for GDB debugging here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Example Applications changes for GDB debugging here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Example Applications changes for GDB debugging here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Example Applications changes for GDB debugging here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Example Applications changes for GDB debugging here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Example Applications changes for GDB debugging here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Example Applications changes for GDB debugging here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity