User forums > General (but related to Code::Blocks)

compiler debug code

(1/2) > >>

maxcy:
main is a part of a pretty large compiler project. The first part shows the output from the parser and 0 syntax errors. The last half, if no errors, shows a pretty print of the symbol table. The first half works but the second half never shows up and the main program exits with 255 code! I put break points (lines 35 & 45) into the code, but they are ignored by the debugger!! The code is executed though all the parser lines and then ignores the errorcount if loop even though the output of the code shows 0 errors! So the code isn't working properly and the debugger isn't working either. This is very frustrating!!
maxcy / wt1v

Miguel Gimenez:
1.- Some GDB are known to have problems with breakpoints, there are some independent GDB you can try (there are links somewhere in the forum).
2.- You must use the debug target for debugging, the release target makes some optimizations that may ditch the line you are trying to break in.
3.- You can insert some debug lines, like cout << "Arrived here OK" and see which is missing.

nenin:

--- Quote from: Miguel Gimenez on October 18, 2023, 10:20:42 am ---1.- Some GDB are known to have problems with breakpoints, there are some independent GDB you can try (there are links somewhere in the forum).

--- End quote ---
Here it is: https://github.com/ssbssa/gdb/

maxcy:
This particular code comes from a book of 13 chapters. I've used the debugger in many of the projects throughout this book. Setting breakpoints and adding watches are no problem in any of the other projects!  Compiling in runtime/debug mode is simple!!  This particular project is an adaptation of a project from a modified project developed from the previous chapter and it debugged with no problems! But, in this particular project, when I run it the debug mode, it ignores any break points, even if I put one right after main()! Very perplexing to say the least!
maxcy

stahta01:
maxcy: I suggest posting a full debug re-build log and see if someone can see an issue.

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version