gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 23 Jul 2010 21:10:55 +0000 (21:10 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 23 Jul 2010 21:10:55 +0000 (21:10 +0000)
* 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.

gdb/ChangeLog
gdb/gdb_gcore.sh

index 763e9885647919e1d73fb1b72adfbf1f434a0a42..e2062d82fecf9aeaad463a1aa48956b6a4ed6405 100644 (file)
@@ -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
index c51199fcc43f9effc742a154a3e9850f19d8ce2a..666b8373c49516ad5832379e7534b59c151b2afb 100755 (executable)
@@ -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
This page took 0.027637 seconds and 4 git commands to generate.