OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 # A generic script used to attach to a running Chromium process and | 8 # A generic script used to attach to a running Chromium process and |
9 # debug it. Most users should not use this directly, but one of the | 9 # debug it. Most users should not use this directly, but one of the |
10 # wrapper scripts like adb_gdb_content_shell | 10 # wrapper scripts like adb_gdb_content_shell |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 # Detect the build type and symbol directory. This is done by finding | 701 # Detect the build type and symbol directory. This is done by finding |
702 # the most recent sub-directory containing debug shared libraries under | 702 # the most recent sub-directory containing debug shared libraries under |
703 # $CHROMIUM_SRC/$CHROMIUM_OUT_DIR/ | 703 # $CHROMIUM_SRC/$CHROMIUM_OUT_DIR/ |
704 # | 704 # |
705 # $1: $BUILDTYPE value, can be empty | 705 # $1: $BUILDTYPE value, can be empty |
706 # Out: nothing, but this sets SYMBOL_DIR | 706 # Out: nothing, but this sets SYMBOL_DIR |
707 # | 707 # |
708 detect_symbol_dir () { | 708 detect_symbol_dir () { |
709 local SUBDIRS SUBDIR LIST DIR DIR_LIBS TSTAMP | 709 local SUBDIRS SUBDIR LIST DIR DIR_LIBS TSTAMP |
710 # Note: Ninja places debug libraries under out/$BUILDTYPE/lib/, while | 710 # Make places them under out/$BUILDTYPE/lib.target. |
711 # Make places then under out/$BUILDTYPE/lib.target. | 711 # GYP places debug libraries under out/$BUILDTYPE/lib |
| 712 # GN places them under out/$BUILDTYPE/lib.unstripped |
712 if [ "$1" ]; then | 713 if [ "$1" ]; then |
713 SUBDIRS="$1/lib $1/lib.target" | 714 SUBDIRS="$1/lib $1/lib.target $1/lib.unstripped" |
714 else | 715 else |
715 SUBDIRS="Release/lib Debug/lib Release/lib.target Debug/lib.target" | 716 SUBDIRS="Release/lib Debug/lib Release/lib.target Debug/lib.target" |
| 717 SUBDIRS+=" Release/lib.unstripped Debug/lib.unstripped" |
716 fi | 718 fi |
717 LIST=$TMPDIR/scan-subdirs-$$.txt | 719 LIST=$TMPDIR/scan-subdirs-$$.txt |
718 printf "" > "$LIST" | 720 printf "" > "$LIST" |
719 for SUBDIR in $SUBDIRS; do | 721 for SUBDIR in $SUBDIRS; do |
720 DIR=$CHROMIUM_SRC/$CHROMIUM_OUT_DIR/$SUBDIR | 722 DIR=$CHROMIUM_SRC/$CHROMIUM_OUT_DIR/$SUBDIR |
721 if [ -d "$DIR" ]; then | 723 if [ -d "$DIR" ]; then |
722 # Ignore build directories that don't contain symbol versions | 724 # Ignore build directories that don't contain symbol versions |
723 # of the shared libraries. | 725 # of the shared libraries. |
724 DIR_LIBS=$(ls "$DIR"/lib*.so 2>/dev/null) | 726 DIR_LIBS=$(ls "$DIR"/lib*.so 2>/dev/null) |
725 if [ -z "$DIR_LIBS" ]; then | 727 if [ -z "$DIR_LIBS" ]; then |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1040 |
1039 if [ "$VERBOSE" -gt 0 ]; then | 1041 if [ "$VERBOSE" -gt 0 ]; then |
1040 echo "### START $COMMANDS" | 1042 echo "### START $COMMANDS" |
1041 cat $COMMANDS | 1043 cat $COMMANDS |
1042 echo "### END $COMMANDS" | 1044 echo "### END $COMMANDS" |
1043 fi | 1045 fi |
1044 | 1046 |
1045 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" | 1047 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" |
1046 $GDB $GDB_ARGS -x $COMMANDS && | 1048 $GDB $GDB_ARGS -x $COMMANDS && |
1047 rm -f "$GDBSERVER_PIDFILE" | 1049 rm -f "$GDBSERVER_PIDFILE" |
OLD | NEW |