LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2010, 05:46 PM   #1
gozlemci
Member
 
Registered: Mar 2010
Location: Turkey
Posts: 35

Rep: Reputation: 0
Debug problem in Eclipse Helios Release


Hi there;
I try to make my homework and I've encountered with a weird problem during Debug. My IDE is Eclipse for C/C++ ,Helios Release and my gcc version is version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
Here are the problems:

1- When I toggled a breakpoint in code, a warning appears :"Breakpoint attribute problem:installation failed" .And this breakpoint has not been recognized and it started from main.

2-When I got into debug mode,a new screen has appeared in Eclipse and generated main.c and my original main.c is different, in terms of function's code.

How can I overcome that situation? Any help is appreciated.

My original main.c:
Code:
#include <stdio.h>
#include <math.h>
#include "bil236_exp2.h"

int main()
{
        //struct of coordinates. Defined in "bil236_exp2.h"
	struct _coordinates coord;
	coord.x = 0;
	coord.y = 0;

	int element = 0;
	int i=0;
	int j=0;
	int numberOfSteps=0;
	int n = -9;

	//<Geçici kod parçası
	//Problem 1: Breakpoint attribute problem:installation failed
	printf("Enter n:\n");
	scanf(" %d",&n);
	//>

	//Creating first element
	for(i = n;i>=1 ;i--)
	{
		element += pow(10,i-1);
		numberOfSteps++;
	}

	for(i=0 ; i<=6 ; )
	{
		for(j=0 ; j<=6 ; j++)
		{
			tempArray[i][j] = element;
			increaseElement(&element,numberOfSteps);
		}

		increaseElement(&element,numberOfSteps);
		i++;
	}

	printf("Start ! %d",element);

	return 5;
}

void increaseElement(int *element,int numberOfSteps)
{

	int temp = (*element);
	int i=0;
	int dividend=-9;
	int increase = 0;

	temp++;

	for(i=0;i<numberOfSteps;i++)
	{
		dividend = 8*(int)pow(10,i);

		if( temp % dividend == 7 )
		{
			//Increase place of tens by one and make place of ones 1
			increase = 4 *(int)pow(10,i);
			temp += increase;

		}
	}

	(*element) = temp ;
	return;

}

void printSuddenly(int *array)
{

}
This is the main.c that appears in new screen:
Code:
#include <stdio.h>
#include <math.h>
#include "bil236_exp2.h"

int main()
{
	struct _coordinates coord;
	coord.x = 0;
	coord.y = 0;

	int element = 0;
	int i=0;
	int j=0;
	int numberOfSteps=0;
	int n = -9;

	//<Geçici kod parçası
	printf("Enter n:\n");
	scanf(" %d",&n);
	//>

	//Creating first element
	for(i = n;i>=1 ;i--)
	{
		element += pow(10,i-1);
		numberOfSteps++;
	}

	for(i=0 ; i<=6 ; )
	{
		for(j=0 ; j<=6 ; j++)
		{
			tempArray[i][j] = element;
			increaseElement(&element,numberOfSteps);
		}

		increaseElement(&element,numberOfSteps);
		i++;
	}

	printf("Start ! %d",element);

	return 5;
}

void increaseElement(int *element,int numberOfSteps)
{

//If you noticed, content of this function is different from the //original one .
	int temp = (*element);
	int divisor;
	int i=0;

	temp++;

	for(i=0; ;i++)
	{
		divisor = 8*(int)pow(10,i);
		if( temp % divisor  == 7 )
		{
			//Increase place of tens by one and make place of ones 1
			temp += ( 4 *(int)pow(10,i) );

		}

		if(i>numberOfSteps)
		{
			break;
		}

	}

	(*element) = temp ;
	return;

}

void printSuddenly(int *array)
{

}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse HELIOS problems grimx Slackware 2 03-16-2011 02:02 AM
LXer: First service release of Eclipse Helios LXer Syndicated Linux News 0 09-28-2010 07:30 AM
LXer: HeliOS Store Opens to Fund The HeliOS Project LXer Syndicated Linux News 2 09-07-2010 08:41 AM
LXer: Eclipse Helios technologies arrive on the release train LXer Syndicated Linux News 0 06-24-2010 12:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration