OK I just added to my script, latest version attached. This was the version I just ran 
and attached the trace of on my last post.

It now prepends lyx --version into the trace to aid with going through
the files after the event, and in case the user has an old version.

One other thought, if people like it then it needs to be modified for sh
rather than bash. I'll do that later if it's getting included, it
doesn't sound like much work.

Also I noticed that the CVS version has the date of March 3 - couldn't
somebody update it on the next commit? =)

Have fun,
Darren

On Thu, 2002-11-28 at 01:35, Darren Freeman wrote:
> On Thu, 2002-11-28 at 00:21, Andre Poenitz wrote:
> > On Thu, Nov 28, 2002 at 12:19:27AM +1030, Darren Freeman wrote:
> > > There are plenty of possibilities, maybe it's even enough for a separate
> > > project to create a crash dump library for GPLed projects. The Mozilla
> > > source might be a good place to start...
> > 
> > >From what I've seen so far the Mozilla source is no good place to start
> > for anything ;-}
> > 
> > Are you volunteering?
> 
> I might be, but not any time soon =(
> 
> Interesting.. maybe a wrapper shell script could be added instead, which
> runs LyX through gdb and records anything interesting.. followed by
> offering to mail it off if something did happen... that way developers
> could put all those print statements to use by grepping through all the
> reports donated =)
> 
> I've done something quickly for bash - attached. It basically shields
> everything from the cautious user, running GDB and starting LyX. When
> LyX exits it tries to do a backtrace, then exits. It can be extended to
> provide various messages depending upon what was in the trace, currently
> the presence of SIGSEGV causes a plea to be issued, saying please mail
> this to the list.
> 
> Comments?
> 
> > Andre'
> 
> Have fun,
> Darren
#!/bin/bash

# This file is copyright 2002 Darren Freeman. It is covered by the GNU General Public License which was supplied with LyX.

LYXDIR=/home/lyx-devel/src
RESULTDIR=$LYXDIR

echo LyX automatic backtrace generator v0.1.
echo
echo Please wait while LyX is started with the options you specified: "$@"
echo This sometimes takes a little while - don"'"t panic yet.

# In case noclobber is set, bash won't automatically overwrite these
rm -f $RESULTDIR/gdbcmd
rm -f $RESULTDIR/lyx-trace

# Create stdin for GDB
echo set arg "$@" >$RESULTDIR/gdbcmd
echo run >>$RESULTDIR/gdbcmd
echo bt >>$RESULTDIR/gdbcmd
echo up >>$RESULTDIR/gdbcmd
echo quit >>$RESULTDIR/gdbcmd

# prepend the LyX versions and GDB commands to the trace so we don't need to ask for it.
$LYXDIR/lyx --version &>$RESULTDIR/lyx-trace
echo "----------8<----------8<----------" >>$RESULTDIR/lyx-trace
cat $RESULTDIR/gdbcmd >>$RESULTDIR/lyx-trace
echo "----------8<----------8<----------" >>$RESULTDIR/lyx-trace

gdb <$RESULTDIR/gdbcmd >>$RESULTDIR/lyx-trace 2>&1 $LYXDIR/lyx

rm $RESULTDIR/gdbcmd

echo
echo Wrote the file $RESULTDIR/lyx-trace with everything GDB and LyX said.

# Extra message when interesting things are in lyx-trace.. add more interesting things below!
if ( grep SIGSEGV $RESULTDIR/lyx-trace ) then
  echo
  echo Whoa! Looks like something nasty happened.
  echo *Please* email the above file to the LyX team at:
  echo [EMAIL PROTECTED]
  echo Don"'"t forget to include what you were doing when it bombed!
fi

Reply via email to