We have a nice big section about using GDB to do remote debugging, but before this in the manual to we should have a short section on using gdb to do on-target debugging, case in case someone thinks that this isn't possible.
Ross, Can you give me some steps here on which I can base a new section for on-target debugging? Once I have that, I can create something. Thanks, Scott
http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#platdev-gdb-remotedebug is the existing documentation for remote debugging. To avoid confusion - we've had people on IRC ask if target gdb works because it's not documented - we need to cover this too. Basically this is just a matter of ensuring that gdb is on the target (add gdb to IMAGE_INSTALL, or tools-debug to IMAGE_FEATURES), and that debug symbols are present (either manually install with IMAGE_INSTALL foo-dbg, or dbg-pkgs to IMAGE_FEATURES for all of them).
Ross, This is my best guess at the actual settings I need to use based on what you said in Comment 2. Please look this section over and suggest filler, whatever, that the user would need. I don't really know too much about this so I am relying on you to fill in the blanks and correct it. Also, I see I don't own this bug but there is a clear documentation component for it. Thanks, scott http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#debugging-with-the-gnu-project-debugger-gdb-on-the-target
Scott, I like your paragraph. I would only add a minor explanation on why target debugging is not the most usual case, and a note on how to improve the debug information. Here's what I suggest: _____________________________________________________________________________ The previous section addressed using GDB remotely for debugging purposes, which is the most usual case due to the inherent hardware limitations on many embedded devices, but debugging in the target hardware itself is also possible with the most powerful devices. This section describes what you need to do in order to support using GDB to debug on the target hardware. To support this kind of debugging, you need do the following: Ensure that GDB is on the target. You can do this by adding "gdb" to IMAGE_INSTALL: IMAGE_INSTALL_append = " gdb" Alternatively, you can add "tools-debug" to IMAGE_FEATURES: IMAGE_FEATURES = tools-debug Ensure that debug symbols are present. You can make sure these symbols are present by installing -dbg: IMAGE_INSTALL_append = " packagename-dbg" Alternatively, you can do the following to include all the debug symbols: IMAGE_FEATURES = dbg-pkgs Note: To improve the debug information accuracy, you can reduce the level of optimization used by the compiler. For example, when adding the following line to you local.conf file you will reduce optimization from FULL_OPTIMIZATION (-O2) to DEBUG_OPTIMIZATION (-O -fno-omit-frame-pointer): DEBUG_BUILD = "1" Consider that this will reduce the application's performance and is recommended only for debugging purposes. _____________________________________________________________________________ Also, feel free to assign this bug to yourself. Let me know if more is needed.
Thanks Jose for the additional detail. See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#debugging-with-the-gnu-project-debugger-gdb-on-the-target for the changed section. Let me know if anything further needs to be done. Scott
(In reply to comment #5) > Thanks Jose for the additional detail. See > http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#debugging- > with-the-gnu-project-debugger-gdb-on-the-target for the changed section. > Let me know if anything further needs to be done. > > Scott Scott, just minor changes: "However, debugging in the target hardware itself is also possible with more powerful devices" instead of "However, debugging in the target hardware itself is also possible with the most powerful devices" Also, the IMAGE_FEATURES is enclosed by quotes (in both cases) IMAGE_FEATURES = " tools-debug"
Hi, Thanks for the feedback. See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#debugging-with-the-gnu-project-debugger-gdb-on-the-target for the changes. Let me know if anything further is needed. Scott
Probably best to use IMAGE_FEATURES_append instead of just IMAGE_FEATURES in the examples. Apart from that looks good to me.
(In reply to comment #8) > Probably best to use IMAGE_FEATURES_append instead of just IMAGE_FEATURES in > the examples. Apart from that looks good to me. You are right Ross. We do not want to override possible previous image's features.
Ross and Leonardo, See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#debugging-with-the-gnu-project-debugger-gdb-on-the-target for the update. I am setting the bug to RESOLVED now and turning the doc flag to "done." Thanks, Scott