[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] lokalisere og fixe segfaults



On 10/05/2009 11:33 AM, Bjørn Hartfelt wrote:
2009/10/5 Atte André Jensen<sslug@sslug>:
1) Hvad findes der af alternativer til 1.000.000 printf-statements? Jeg
forestiller mig noget, evt med GUI, jeg kan køre mit segfaultende program
igennem og så få at vide hvor det crasher og evt lidt mere om hvorfor.
compiler med -g (jeg går ud fra at du bruger g++) og kør den gennem
valgrind (`valgrind foo`, hvor foo er din binary). den fanger dine
hukommelsesfejl.


Du kan også i stedet for valgrind køre via gdb.

kompilere med -g switchen.

så udfør

gdb
gdb> run foo

Den vil så stoppe og give dig positionen hvor det gik galt (generelt).

Valgrind gør mere mht hukommelses forbrug - som jeg husker det.
gdb er en debugger, hvor du kan steppe igennem, og undersøge værdier.

Kan man ikke lide gdb kommando linje, findes der et utal af grafiske
wrappers til den.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *