[fpc-pascal] How to analyze a core dump?

Luca Olivetti luca at ventoso.org
Sun Jun 10 23:10:26 CEST 2007


En/na John Coppens ha escrit:
> On Sun, 10 Jun 2007 21:30:09 +0200
> Luca Olivetti <luca at ventoso.org> wrote:
> 
>> I'm trying to debug a segment violation, I compiled the program with
>> -g, but analyzing the core dump isn't really helpful, maybe the
>> "warning can't read pathname for load map" is the cause? Or it's
>> possible that it's caused by some of the c libraries used having no
>> debug symbols? Any hint?
> 
> I'm not too experienced in this, but I suspect a good first step would be
> to ask for a backtrace (bt) in gdb, after the segfault occured. You'll
> see the steps that led to the actual segfault, starting from the main
> program till the library function that failed. Don't immediately suspect
> the library - go back to the last line of your program and check if all
> things are normal at _that_ point.
> 
> AFAIK, core dumps are not really related with gdb, but are generated by
> the kernel, and should be the last step to fall back on. A backtrace in
> gdb is generally more helpful.

I don't know gdb well, but it should be capable to show a backtrace 
using a core file (that's what I was trying to do). The program doesn't 
work if I run it under gdb (I don't know why, but I think it has 
problems with thread), that's why I was trying to use a core. Also it's 
impossible to debug the program using Lazarus (again, I think, due to 
threads, and, yes, I tried a separate X server as per the instructions 
in the wiki)

Bye
-- 
Luca



More information about the fpc-pascal mailing list