weakestOsuPlayer_244's blog

By weakestOsuPlayer_244, history, 4 years ago, In English

Hello everyone. I was trying to learn how GDB works and learn about debugging.

While trying to set breakpoint on main function I saw that it's not displaying the line number in decimal.

So I looked up a bit and found that one needs to include the -g flag while compiling the cpp file.

I did that and yet it doesn't show the line numbers in decimal. (Thereafter I tried to search this up but couldn't get the issue resolved)

My GDB version is 7.6.1 (probably latest for windows)

https://www.imageupload.net/image/gdb-issue.KQ1E2

If someone can help me out with this it would be much appreciated.

UPD: Found out issue. Seems like compilation generates a separate file (a.out) and you have to run gdb on that file.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If your compiler generates a.out by default, then you ran gdb on wrong binary.

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Thanks a lot.. now it's working So it is always going to generate a.out for whatever cpp file I compile or is there a way to change this?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by weakestOsuPlayer_244 (previous revision, new revision, compare).