Is there a way to step through a C codebase in a debugger so I can get a feel for where the entry point is? I dont know where a codebase like SMAUG starts - what the entry point is.
Stepping through a C codebase
Posted by Npp83 on Wed 09 Feb 2011 06:21 PM — 4 posts, 20,682 views.
They entry point for every C program is the main() function. Go find it and look through the function calls from there.
Or you can take your method and step through the code with a debugger like gdb. Numerous posts on how to do so have been posted in this forum.
More or less you need to compile SMAUG with debugging information and then start SMAUG via gdb. In your Makefile there should be a line for compiler flags. Make sure it has -g or -g3. Then do ./gdb smaug port# and enjoy.
See this post for more details:
Or you can take your method and step through the code with a debugger like gdb. Numerous posts on how to do so have been posted in this forum.
More or less you need to compile SMAUG with debugging information and then start SMAUG via gdb. In your Makefile there should be a line for compiler flags. Make sure it has -g or -g3. Then do ./gdb smaug port# and enjoy.
See this post for more details:
Please see the forum thread: http://gammon.com.au/forum/?id=3653.
Excellent, technical reply. Thank you. My programming began with Java mid 2005 and I found and stayed with C# since 2008 so going back as far as C for me and what tools I have available to mimic some of the things I am used to with VS or Eclipse is difficult.
So then is most debugging (debugging tecnniques in C) with gdb done with console output (seeding the code), is there any means of applying breakpoints?
So then is most debugging (debugging tecnniques in C) with gdb done with console output (seeding the code), is there any means of applying breakpoints?
Read the link he gave. Another way to get to the same page is:
http://gammon.com.au/gdb
In there I discuss breakpoints.
http://gammon.com.au/gdb
In there I discuss breakpoints.