[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: [CPROG] debugger problemer med GDB og DDD



On Tue, 7 Sep 1999, Jacob Kolding wrote:

> men jeg kan ikke rigtigt få DDD og GDB til at svinge. den bugger ved
> følgende linje kode:
> 
> -> while(!feof(indfile))
                ^^^^^^^^^

> og her siger gdb:
> 
> Program received signal SIGSEGV, Segmentation fault.
> _IO_feof (fp=0x0) at feof.c:36
            ^^^^^^^


Ja... du kalder feof med en NULL pointer. gdb virker som den skal :)

Prøv også "p indfile". Den bliver nok NULL.

Ovenover dette gør du nok noget i still med:

fil = fopen("foo", "r")

og glemmer at checke at fopen kan returnere NULL.


-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>              Goodbye, Richard!
==============================================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [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] *