LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Debug problem in Eclipse Helios Release (https://www.linuxquestions.org/questions/programming-9/debug-problem-in-eclipse-helios-release-841256/)

gozlemci 10-29-2010 05:46 PM

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)
{

}



All times are GMT -5. The time now is 10:32 AM.