Jump to content

Preparing Yocto Development Environment for Debugging: Difference between revisions

no edit summary
No edit summary
Line 5: Line 5:
In order to create an appropriate development environment, Yocto allows to include useful packages and generate specific information required by the development tools.  Additionally, it is well known that for the process of debugging, it is also necessary to disable optimizations and enable debug symbols. The following is a list of additional configuration to be added to the '''build/conf/local.conf''' file. You can choose which ones to include depending on your application and desired environment. The following example enables '''ALL''' of the recommended development/debugging tools.
In order to create an appropriate development environment, Yocto allows to include useful packages and generate specific information required by the development tools.  Additionally, it is well known that for the process of debugging, it is also necessary to disable optimizations and enable debug symbols. The following is a list of additional configuration to be added to the '''build/conf/local.conf''' file. You can choose which ones to include depending on your application and desired environment. The following example enables '''ALL''' of the recommended development/debugging tools.


'''build/conf/local.conf:'''
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
EXTRA_IMAGE_FEATURES += "\
EXTRA_IMAGE_FEATURES += "\
Line 37: Line 37:
Finally, for the general environment setup, depending on where and what we are debugging, it might be useful to have bitbake emit debugging output, which can be achieved by adding the BBDEBUG option to the local.conf as follows. You can also create a build history git repository that stores meta-data about the current project, including package dependencies, size and generated sub-packages, stored in the $PROJECT_DIR/build/buildhistory.
Finally, for the general environment setup, depending on where and what we are debugging, it might be useful to have bitbake emit debugging output, which can be achieved by adding the BBDEBUG option to the local.conf as follows. You can also create a build history git repository that stores meta-data about the current project, including package dependencies, size and generated sub-packages, stored in the $PROJECT_DIR/build/buildhistory.


'''build/conf/local.conf:'''
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
BBDEBUG = "yes"
BBDEBUG = "yes"
Line 60: Line 60:
For setting up the environment to use it, remember that the package "tools-debug" already includes it, so you should add to your local.conf file:
For setting up the environment to use it, remember that the package "tools-debug" already includes it, so you should add to your local.conf file:


'''build/conf/local.conf:'''  
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
EXTRA_IMAGE_FEATURES += "tools-debug"  
EXTRA_IMAGE_FEATURES += "tools-debug"  
Line 80: Line 80:
The following options are the minimum needed for running perf.  
The following options are the minimum needed for running perf.  


'''build/conf/local.conf:'''  
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
Line 96: Line 96:
As you would do for any other package that you want to include in your image and is not part of the default configuration, you need to add the recipe to build it. The source will depend on what board you a using, and you must add the recipe to your meta-layer. Valgrind also needs some of the previously defined features on your '''local.conf''', specifically:
As you would do for any other package that you want to include in your image and is not part of the default configuration, you need to add the recipe to build it. The source will depend on what board you a using, and you must add the recipe to your meta-layer. Valgrind also needs some of the previously defined features on your '''local.conf''', specifically:
    
    
'''build/conf/local.conf:'''  
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
EXTRA_IMAGE_FEATURES += " dbg-pkgs tools-debug "
EXTRA_IMAGE_FEATURES += " dbg-pkgs tools-debug "
Line 154: Line 154:
As previously mentioned, GDB is included in the package "tools-debug", so commonly the EXTRA_IMAGE_FEATURES would be set as follows:
As previously mentioned, GDB is included in the package "tools-debug", so commonly the EXTRA_IMAGE_FEATURES would be set as follows:


'''build/conf/local.conf:'''  
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks dbg-pkgs"
EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks dbg-pkgs"
Line 170: Line 170:
* Configure your build system to construct the companion debug filesystem by editing the local.conf file:
* Configure your build system to construct the companion debug filesystem by editing the local.conf file:


'''build/conf/local.conf:'''  
'''$YOCTO_BUILD/conf/local.conf:'''
<syntaxhighlight lang=make>
<syntaxhighlight lang=make>
IMAGE_GEN_DEBUGFS = "1"
IMAGE_GEN_DEBUGFS = "1"
352

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.