| Summary: | Add an example for debugging software with the corresponding -dbg package | ||
|---|---|---|---|
| Product: | [Documentation] General Docs | Reporter: | Laszlo Papp <lpapp> |
| Component: | docs-general | Assignee: | Mark Morton <mark.morton> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | bluelightning, jefro, mark.morton, mhalstead, srifenbark |
| Version: | unspecified | ||
| Target Milestone: | Future | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
|
Description
Laszlo Papp
2014-08-12 12:33:20 UTC
This is my commands that I ended up using, but I expect it to be pretty similar for any developers:
Target:
gdbserver 192.168.0.32:2345 auth -c testuser <password> user
Host:
./tmp/sysroots/x86_64-linux/usr/bin/armv5te-foo-linux-gnueabi/cgdb -d ./tmp/sysroots/x86_64-linux/usr/bin/armv5te-foo-linux-gnueabi/arm-foo-linux-gnueabi-gdb
-s ./tmp/work/armv5te-foo-linux-gnueabi/foo/$myver/packages-split/foo-dbg/usr/bin/.debug/foo -e ./tmp/work/armv5te-foo-linux-gnueabi/foo/$myver/packages-split/foo/usr/bin/foo -ex "tar rem 192.168.0.1:2345"
The latter is quite ugly, but could be essentially made scriptable or alias, so it is not a big deal. The concept is however.
Here is my recap:
1) foo-dbg is additional info (symbol table and source code), not replacement.
2) Options (-s symbol-file and -e executable) have to be used on the host since the debug package is not installed there into the sysroot for obvious reasons.
3) gdbserver remains as is without changes. It can be run on the target binary which is stripped, but the optimization level has to be the same as the debug binary.
4) If both are installed on the target, then there is no need to use the aforementioned options, since they will be recognized in their default locations.
5) If one tries to run gdb or gdbserver on the debug binary, that will end up in format/exec error since it is just meant to be the symbol file. This is known and expected, although not quite obvious for a newcomer.
Assigning to security due to accidental content being entered. At least, it will be less visible for the world (hopefully). I spoke with Paul on this bug and there is more to it than I can get to for the upcoming 1.7 release. I am bumping the target out to 1.8. I am also setting the status to ACCEPTED. Scott Setting this to 1.8 M2. I need some information from Paul Eggleton to proceed on this one. Adding self and Paul to CC list. Set milestone to 1.8 M2. Scott I'm just marking this as NEW rather than NEEDINFO; it's just another task I need to look into. Marking as resolved as the Dev manual has a comprehensive section on remote debugging here: https://www.yoctoproject.org/docs/3.1/dev-manual/dev-manual.html#platdev-gdb-remotedebug If something is still missing, please create a new bug with specific information. |