aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-07-23 21:10:55 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-07-23 21:10:55 +0000
commit3a674486ec3a67bbe1e1b96ed676679a1903dc83 (patch)
treeeea320acd73c105016fc6567c8a9185b0f0dd436 /gdb
parent54ec275af07c4f9cfbe0cc23bbb6c2a569437e1a (diff)
downloadgdb-3a674486ec3a67bbe1e1b96ed676679a1903dc83.zip
gdb-3a674486ec3a67bbe1e1b96ed676679a1903dc83.tar.gz
gdb-3a674486ec3a67bbe1e1b96ed676679a1903dc83.tar.bz2
gdb/
* gdb_gcore.sh (tmpfile): Remove the variable, its initialization, cleanup and generating of gdb script to it. (gdb): Use redirection from /dev/null. Use --nx. Turn off pagination and terminal size. Convert $tmpfile to a series of -ex-es.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rwxr-xr-xgdb/gdb_gcore.sh25
2 files changed, 12 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 763e988..e2062d8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb_gcore.sh (tmpfile): Remove the variable, its initialization,
+ cleanup and generating of gdb script to it.
+ (gdb): Use redirection from /dev/null. Use --nx. Turn off pagination
+ and terminal size. Convert $tmpfile to a series of -ex-es.
+
2010-07-23 Keith Seitz <keiths@redhat.com>
* symtab.c (basic_lookup_transparent_type): Call pre-expand
diff --git a/gdb/gdb_gcore.sh b/gdb/gdb_gcore.sh
index c51199f..666b837 100755
--- a/gdb/gdb_gcore.sh
+++ b/gdb/gdb_gcore.sh
@@ -45,32 +45,17 @@ then
shift; shift
fi
-# Create a temporary file. Use mktemp if available, but cope if it is not.
-tmpfile=`mktemp ${name}.XXXXXX 2>/dev/null` || {
- tmpfile=${name}.$$
- if test -e $tmpfile; then
- echo "Could not create temporary file $tmpfile"
- exit 1
- fi
- touch $tmpfile
-}
-trap "rm -f $tmpfile" EXIT
-
# Initialise return code.
rc=0
# Loop through pids
for pid in $*
do
- # Write gdb script for pid $pid.
- cat >>$tmpfile <<EOF
-attach $pid
-gcore $name.$pid
-detach
-quit
-EOF
-
- gdb -x $tmpfile -batch
+ # `</dev/null' to avoid touching interactive terminal if it is
+ # available but not accessible as GDB would get stopped on SIGTTIN.
+ gdb </dev/null --nx --batch \
+ -ex "set pagination off" -ex "set height 0" -ex "set width 0" \
+ -ex "attach $pid" -ex "gcore $name.$pid" -ex detach -ex quit
if [ -r $name.$pid ] ; then
rc=0