Using Google and typing "GNU C debugger" gives you 269000 hits, the first of which is
https://www.gnu.org/software/gdb/[
^]
which is a good place to start.
And you might want to take a look at
http://www.codeblocks.org/[
^] to make your life a little easier.
[EDIT]
You didn't even mention NetBeans in the first version of you question! Ok, for NetBeans applies the same. Go to Google, enter "netbeans debugger", and a la, you end up on:
https://netbeans.org/features/java/debugger.html[
^]
Sometimes, to know how to search for information is already half of the job done.