[SWLUG] how hard can it be... to get a core dump

Mark Summerfield mark at qtrac.eu
Thu Sep 25 14:16:10 UTC 2008


On 2008-09-25, Neil Greenwood wrote:
> 2008/9/25 Mark Summerfield <mark at qtrac.eu>:
> > On 2008-09-25, Justin Mitchell wrote:
> >> the other way of course is to not core dump at all, but run the program
> >> from within gdb, so it drops straight to the debugger when it crashes.
> >>
> >> 'gdb ./myprogram'
> >> then 'run' followed by any command line args your program needs
> >
> > I tried that.
> >
> > But programA runs programB and the crash only occurs in programB when it
> > is run from programA (with a particular data set); it runs fine on its
> > own or with other data. Inside gdb the crash occurs and a return value
> > of 01 is noted; but the backtrace gives me nothing, presumably because
> > gdb is debugging programA rather than the programB that crashed "inside"
> > it.
>
> Can you change the command-line that programA uses to run programB? If
> so, you could change that to run 'gdb programB'?
>
> Sorry, I'm not a C programmer, so I might be completely off track.
> Just thought a little bit of lateral thinking might help...

A good idea in principle, but in this case I don't know where or how the
first program runs the second---and also it makes multiple runs (scores
or maybe a few hundred times) and only fails after all these have gone
by.

I'll give up on it. On Fedora which I normally use it works fine.

Thanks for the ideas and suggestions:-)

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "C++ GUI Programming with Qt 4" - ISBN 0132354160




More information about the Swlug mailing list