Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Debugging not working while running works
Debugging not working while running works [message #903393] Thu, 23 August 2012 13:22 Go to next message
Quint Missing name is currently offline Quint Missing name
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?
Re: Debugging not working while running works [message #903399 is a reply to message #903393] Thu, 23 August 2012 13:35 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 8/23/2012 7:22 AM, Quint Mising name wrote:
> 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>
> [snip]

You might get more relevant help in the Eclipse CDT forum where C/C++
development questions are answered.
Re: Debugging not working while running works [message #903400 is a reply to message #903399] Thu, 23 August 2012 13:42 Go to previous message
Quint Missing name is currently offline Quint Missing name
Messages: 5
Registered: August 2012
Junior Member
Thanks,

Moved to CDT forum
Previous Topic:ClassNotFoundException when running JUnit test
Next Topic:change font and colors
Goto Forum:
  


Current Time: Tue Sep 16 15:35:30 GMT 2014

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

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