Rob, On Fri, 2002-11-29 at 15:27, Rob Lahaye wrote: > 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
Thanks sweetie =) You're cute too. Oh, you meant the script =( > 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 :(. Yeah that's why I started it. But of course there are many more things to try out... > 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` or LYXDIR=`dirname $0` if lyxgdb is in the lyx directory.. which I didn't think of either =) > 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. Yeah it was a bit late when I did that. I was trying to get out of finishing a paper on time =) I couldn't decide if it was meant for repeating a known bug or capturing an unexpected one. If the bug isn't expected then the lyx dir might be best.. But if expected then the user knows to CD to a suitable directory before running it. > I still would prefer a script that in the first place creates a backtrace > from the coredump file. As of right now I don't know how to do that =) I'll have a poke around - I know that it must be possible. Maybe GDB supports it directly. > 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. Honestly it wasn't that slow on my Athlon =) Only maybe 3 seconds to start lyx and then normal speed while running. > 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. yeah or as above, `dirname $0` and put it in with lyx > 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. I'll look into it now that I know somebody else wants it. > The functionality of (2) is needed, because it's so much faster than (1). > > What do you think of these ideas? Great thinking 99 =) But for tonight, there is a pub crawl celebrating the end of my undergraduate years. Don't expect me to remember in the morning =) > Regards, > Rob. Have fun, Darren