Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

Unable to debug with this GDB on Atom

I have been trying to debug my code in Atom, but I keep getting the error message "Unable to debug with this GDB GDB said: -break-insert: Garbage following". I created compiled my code and set breakpoints, but the debugger does not work. I have attached my .cpp file and a screenshot of the error message. Any help would be greatly appreciated! 

//Dimitra Doiphode
// 2/26/19

#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>

using namespace std;

//constants
const int NUM_STUDENTS = 10;
const int NUM_SCORES = 5;

//prototypes
void read(string names[], int namesSize, double scores[][NUM_SCORES]);
void calculate(double matrix[], double scores[][NUM_SCORES], int rowSize);
void print(double matrix[], string names[], int namesSize);

int main()
{
  int ids[NUM_STUDENTS];
  string names[NUM_STUDENTS];
  double scores[NUM_STUDENTS][NUM_SCORES];
  double grades[NUM_STUDENTS];

    ifstream infile;
    infile.open("data121.txt");
    int namesCounter = 0;
    int scoresCounter = 0;

    while (namesCounter < NUM_STUDENTS)
    {
      infile >> ids[namesCounter];
      infile.ignore(',');
      infile.ignore();
      //infile >> names[namesCounter];
      getline(infile, names[namesCounter], ',');
      while (scoresCounter < NUM_SCORES)
      {
        infile  >> scores[namesCounter][scoresCounter];
        infile.ignore(',');
        infile.ignore();
        scoresCounter++;
      }
      scoresCounter = 0;
      namesCounter++;
    }
  //}

  /*void calculate(double matrix[], double scores[][NUM_SCORES], int rowSize)
  //{
    int counter = 0;
    int num = 0;
    double total = 0;
    double average = 0.0;
    cout << fixed << showpoint << setprecision(2) << endl;

    while (counter < rowSize)
    {
      while (num < NUM_SCORES)
      {
        total = total + scores[counter][num];
        num++;
      }
      average = (total/NUM_SCORES);
      matrix[counter] = average;
      total = 0;
      average = 0;
      num = 0;
    }
  }

  /* void print(double matrix[], string names[], int namesSize)
  {
    cout << setw(10) << "Name: " << setw(12) << "Grade: " << endl;
    int counter = 0;

    while (counter < namesSize)
    {
      cout << setw(10) << names[counter] << setw(12) << matrix[counter] << endl;
      counter++;
    }
  }

  read(names, 10, scores);
  calculate(grades, scores, 10);
  print(grades, names, 10); */

  return 0;
}

debugging-issue.PNG

1 Reply
Community Manager
Message 2 of 2

Re: Unable to debug with this GDB on Atom

Atom doesn't have debugging capabilities built-in. You may want to contact the maintainer of the package you're using to provide debugging functionality. They would probably have more context on what you're running into.

 

Additionally, if you have questions about Atom, you may want to check Atom's support resources for more Atom-specific help.

 

I hope that helps!