1

I am getting the following from gdb:

enter image description here

Below is the source of the program and the tutorial it came from. BAsed on what is going on in the tutorial, I should not be getting an error.

int main()
{
    int a = 5;
    int b = a + 6;
    return b;
}

https://www.hackerschool.com/blog/7-understanding-c-by-learning-assembly

1

You need debugging symbols for the variable names to be defined in GDB. Did you compile with the -g switch?

| improve this answer | |
  • Yes, and after compiling it again it worked fine. – user8058 Jul 14 '14 at 20:13
  • You mean the debugging or the program worked? If the debugging is working as you wanted please mark this question as solved. – ekse Jul 15 '14 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.