I have made an application in which there is a file main.c which uses a function from the master.c file. I would like to debug my application for all functions defined in the master.c file by using gdb tool. Is this possible and if so how?
-
What do you mean by the term debug my application? If you refine that term, either an answer below is already answering the question, or we might be able to find a more specific solution. Do you want to automatically set breakpoints on all functions defined in the header? Do you want to inspect memory of all functions? Or do you want to test the functions by comparing them to specific output for given inputs? This might be of help as well: stackoverflow.com/questions/1504965/…Alexander Oh– Alexander Oh2011-12-27 10:18:52 +00:00Commented Dec 27, 2011 at 10:18
-
i want automatically set breakpoints on all functions defined in the header..Jeegar Patel– Jeegar Patel2011-12-27 10:29:40 +00:00Commented Dec 27, 2011 at 10:29
-
1Duplicate of stackoverflow.com/questions/1476002/… ?another.anon.coward– another.anon.coward2011-12-27 10:41:56 +00:00Commented Dec 27, 2011 at 10:41
-
This might be of help as well: linkcyber_raj– cyber_raj2011-12-27 10:43:30 +00:00Commented Dec 27, 2011 at 10:43
Add a comment
|
2 Answers
You must compile your program using -g flag.
Then you start gdb your_program and set break points: break master.c:37 that will set a break point on master.c, line #37 or you could set breaks at functions: break foo().
Then start your program by run and continue with the debugging process, inspect, continue, watch, display...
http://www.gnu.org/software/gdb/
http://www.gnu.org/software/gdb/documentation/
http://www.cs.cmu.edu/~gilpin/tutorial/
Google for more documentation on using gdb.
Of course there is: