Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:42 Go to next message
Quint Missing name is currently offline Quint Missing nameFriend
Messages: 5
Registered: August 2012
Junior Member
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 12:58]

Report message to a moderator

Re: Debugging not working while running works [message #903532 is a reply to message #903401] Fri, 24 August 2012 07:50 Go to previous messageGo to next message
Quint Missing name is currently offline Quint Missing nameFriend
Messages: 5
Registered: August 2012
Junior Member
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 09:16 Go to previous message
Quint Missing name is currently offline Quint Missing nameFriend
Messages: 5
Registered: August 2012
Junior Member
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: Fri Apr 26 04:10:52 GMT 2024

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

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

Back to the top