Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » [SOLVED] Debugging not working while running works
[SOLVED] Debugging not working while running works [message #903401] Thu, 23 August 2012 09:42 Go to next message
Eclipse UserFriend
Hi,

I've been having problems debugging my code in Eclipse. For some reason debugging does not work. Building an executable works fine. I can run it in terminal but when I want to debug, it crashes. Here is my simple code.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void)
{
  static const char filename[] = "test.txt";
  FILE *file = fopen ( filename, "r" );
  if ( file != NULL )
  {
    char line [ 128 ];
    while ( fgets ( line, sizeof line, file ) != NULL )
    {
      fputs ( line, stdout );
    }
    fclose ( file );
  }
  else
  {
    perror ( filename );
  }
  return 0;
}


The debugger runs until fopen and than it crashes and says:

Quote:
Can't find a source file at "../sysdeps/wordsize-64/../../libio/iofopen.c"
Locate the file or edit the source lookup path to include its location.


This while normally running the code (ctrl+F11) does give the desired result. Also running the executable in terminal gives the desired result. Anyone have ideas?

[Updated on: Thu, 30 August 2012 08:58] by Moderator

Re: Debugging not working while running works [message #903532 is a reply to message #903401] Fri, 24 August 2012 03:50 Go to previous messageGo to next message
Eclipse UserFriend
Seems like every operation done using some form of library use crashes the debugging routine. I can make arrays, manipulate them and do whatever. Making use of fopen or sprint or whatever crashes the debugging. While I can still compile and run. So right now my only means of debugging is sprintf while running the complete program...
Re: Debugging not working while running works [message #903551 is a reply to message #903532] Fri, 24 August 2012 05:16 Go to previous message
Eclipse UserFriend
Aah! I made the ultimate n00b mistake. In debugging I used step into in stead of step over. Fastkeys were mixed up and a long day made it difficult to recognize my mistake.
Previous Topic:[Solved] Cross-project #include error
Next Topic:Configuring the debugger so as to step over when stepping over
Goto Forum:
  


Current Time: Sun Jun 22 02:28:11 EDT 2025

Powered by FUDForum. Page generated in 0.06216 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top