Darren Freeman wrote:
Interesting.. maybe a wrapper shell script could be added instead, which
runs LyX through gdb and records anything interesting.. followed by
Darren,

I've tried your script. It's cute and it works here on my FreeBSD system
as well. But gdb is so slow in the startup, the script can only be intended
for repeating an crash that has been found with a normal run of lyx. Nobody
will use this script instead of the lyx executable itself :(.

More serious problem: I had to edit the file and tweak the LYXDIR and RESULTDIR
variables. That needs to be avoided! Why not let the call be:

  lyxgdb what/ever/dir/lyx

then assign "what/ever/dir" to LYXDIR using the dirname command; something
like
    LYXDIR = `dirname $1`

Actually, why do you define $LYXDIR and then never use it in the script?
Using only $RESULTDIR may be sufficient. You may even forget all this and
simply dump the trace file in the current working directory.

-----------

I still would prefer a script that in the first place creates a backtrace
from the coredump file.
Your script is then useful in case the coredump hasn't or cannot be created;
or for lazy/innocent people who don't care to find the coredump file.

Your script should then allow the following two situations:

1) lyxgdb what/ever/dir/lyx

   only one argument ($1), which will start the lyx executable inside gdb
   and dumps the backtrace automatically in the file lyx-trace. This is what
   the script does now, more or less.

2) lyxgdb what/ever/dir/lyx what/ever/else/dir/lyx.core

   two arguments ($1 and $2). The first one is the executable, the second the
   coredump file. This will then read the coredump file and create the backtrace
   in the file lyx-trace. This is new and needs to be added.

The functionality of (2) is needed, because it's so much faster than (1).

What do you think of these ideas?

Regards,
Rob.

Reply via email to