From e94c0766a3694262cc05532c685df9f624ed4dcb Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 8 Jun 2012 12:31:47 -0400 Subject: [PATCH] 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 Reviewed-by: Brian Harring Commit-Ready: Mike Frysinger Tested-by: Mike Frysinger --- build_library/dev_image_util.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh index 01ca1735d7..5ad34a7268 100755 --- a/build_library/dev_image_util.sh +++ b/build_library/dev_image_util.sh @@ -27,9 +27,12 @@ install_dev_packages() { # Copy over the libc debug info so that gdb # works with threads and also for a better debugging experience. - sudo mkdir -p "${ROOT_FS_DIR}/usr/local/lib/debug" - sudo tar jxpf "${LIBC_PATH}" -C "${ROOT_FS_DIR}/usr/local/lib/debug" \ - ./usr/lib/debug/usr/${CHOST} --strip-components=6 + sudo mkdir -p "${ROOT_FS_DIR}/usr/local/usr/lib/debug" + sudo tar jxpf "${LIBC_PATH}" -C "${ROOT_FS_DIR}/usr/local/usr/lib/debug" \ + ./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 sudo cp -a ${root_dev_dir}/share/portage ${ROOT_FS_DIR}/usr/share