Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: src/scripts/debug_32bit.sh

Issue 1131002: A pair of scripts to make it easier to run and debug 32 bit executables on 64 bit systems (Closed)
Patch Set: add quotes to "$@" and use exec Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/scripts/run_32bit.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Debug a 32 bit binary on 64 bit linux. Can be run from inside or outside
8 # the chroot. If inside, then the 32 bit gdb from the chroot is used, otherwise
9 # the system's 64 bit gdb is used.
10
11 . "$(dirname "$0")/common.sh"
12
13 # Command line options
14 DEFINE_string chroot "$DEFAULT_CHROOT_DIR" "Location of chroot"
15
16 # Parse command line and update positional args
17 FLAGS "$@" || exit 1
18 eval set -- "${FLAGS_ARGV}"
19
20 # Die on any errors
21 set -e
22
23 if [ -z "$SYSROOT" ]; then
24 if [ $INSIDE_CHROOT == 1 ]; then
25 SYSROOT=/build/x86-generic
26 else
27 SYSROOT=$FLAGS_chroot/build/x86-generic
28 fi
29 fi
30
31 if [ -z "$CHOST" ]; then
32 CHOST="x86-generic"
33 fi
34
35 SYSROOT="$FLAGS_chroot/build/$CHOST"
36 LIB_PATHS="/lib32:/usr/lib32:$LIB_PATHS:$SYSROOT/usr/lib:$SYSROOT/lib:."
37 LIB_PATHS="$LIB_PATHS:$SYSROOT/opt/google/chrome/chromeos"
38
39 if [ $INSIDE_CHROOT == 1 ]; then
40 # if we're inside the chroot, the we'll be running a 32 bit gdb, so we'll
41 # need the same library path as the target
42 export LD_LIBRARY_PATH=$LIB_PATHS
43 GDB="$SYSROOT/usr/bin/gdb"
44 else
45 GDB="gdb"
46 fi
47
48 exec $GDB \
49 --eval-command "set environment LD_LIBRARY_PATH=$LIB_PATHS" \
50 --eval-command "set sysroot $SYSROOT " \
51 --eval-command "set prompt (cros-gdb) " \
52 --args "$@"
OLDNEW
« no previous file with comments | « no previous file | src/scripts/run_32bit.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698