build_image: fix /usr/lib/debug handling with dev images

gdb only looks in /usr/lib/debug, not anywhere in /usr/local.  So
unpack the C library stuff into the common /usr/local/usr/lib/debug
and symlink /usr/lib/debug to the /usr/local tree.  This way gdb can
find all these things automatically.

BUG=None
TEST=run gdb on board and see it find .debug files automatically

Change-Id: I93bd352ccac52d9d0179537d2eb520da6f684697
Reviewed-on: https://gerrit.chromium.org/gerrit/25270
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-06-08 12:31:47 -04:00 committed by Gerrit
parent 924dae0521
commit e94c0766a3

View File

@ -27,9 +27,12 @@ install_dev_packages() {
# Copy over the libc debug info so that gdb # Copy over the libc debug info so that gdb
# works with threads and also for a better debugging experience. # works with threads and also for a better debugging experience.
sudo mkdir -p "${ROOT_FS_DIR}/usr/local/lib/debug" sudo mkdir -p "${ROOT_FS_DIR}/usr/local/usr/lib/debug"
sudo tar jxpf "${LIBC_PATH}" -C "${ROOT_FS_DIR}/usr/local/lib/debug" \ sudo tar jxpf "${LIBC_PATH}" -C "${ROOT_FS_DIR}/usr/local/usr/lib/debug" \
./usr/lib/debug/usr/${CHOST} --strip-components=6 ./usr/lib/debug/usr/${CHOST} --strip-components=6
# Since gdb only looks in /usr/lib/debug, symlink the /usr/local
# path so that it is found automatically.
sudo ln -s /usr/local/usr/lib/debug "${ROOT_FS_DIR}/usr/lib/debug"
# Install the bare necessary files so that the "emerge" command works # Install the bare necessary files so that the "emerge" command works
sudo cp -a ${root_dev_dir}/share/portage ${ROOT_FS_DIR}/usr/share sudo cp -a ${root_dev_dir}/share/portage ${ROOT_FS_DIR}/usr/share