LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-11-2009, 07:20 AM   #1
lsyhot
LQ Newbie
 
Registered: Nov 2009
Location: Hong Kong
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
Question How to debug big c language project with GDB?


Now I have a project which include three directories /bin, /inc and /src.
All of header files (*.h) are included in /inc and all of source(*.c) files are stored in /src, i.e. a.c, b.c, c.c..., the final generated executable file will locate in /bin.

after compling with makefile, all of obj files will be generated in /src/obj like a.o, b.o, c.o, d....! Moreover an final.exe executable file will be generated in the /bin directory.

Now if I want to debug it with GDB, how can I do it???

To debug those obj files in /src/obj? or somewhat else?

Many thanks for the kind help!
 
Old 11-11-2009, 08:41 AM   #2
ammorais
Member
 
Registered: Nov 2009
Location: Lisbon, Portugal
Distribution: Gentoo, CentOs, Ubuntu, Debian
Posts: 182

Rep: Reputation: 49
All your object files will be linked into one executable.
You can debug by compiling your project with -ggdb flags and executing your program through gdb.

example: gdb my_program

Look at the gdb manual to more info.
 
  


Reply

Tags
debugging, gdb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug using gdb and gdbserver Hachaso Programming 0 06-07-2009 12:45 AM
cannot debug with gdb ufmale Programming 9 04-27-2009 05:21 PM
how to use gdb to debug multiple files in a project like other IDEs? DrowningFish Programming 1 08-15-2006 08:55 PM
Using gdb to debug different arhitectures george_mercury Linux - Software 1 01-07-2005 06:19 PM
how to debug multithread using GDB? ryanux Programming 1 05-11-2004 12:58 AM


All times are GMT -5. The time now is 03:24 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration