LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Passing program arguments to gdb (http://www.linuxquestions.org/questions/linux-general-1/passing-program-arguments-to-gdb-769956/)

eddyq 11-18-2009 09:30 AM

Passing program arguments to gdb
 
I'm using gdb to debug my program. My program requires arguments (e.g., ./prog -dfile). But if I use gdb as in gdb ./prog -dfile, gdb wants to interpret the -d argument.

How do I pass an argument to my program via gdb?

johnsfine 11-18-2009 09:36 AM

Quote:

Originally Posted by eddyq (Post 3761377)
How do I pass an argument to my program via gdb?

Code:

gdb --args ./prog -dfile
--args is in gdb.info, but not in the man page.

For a complicated program like gdb, I have no idea how someone decides what is important enough to go in the man page. But usually such decisions are made amazingly badly. Most of the man page for gdb are obscure details far less likely to be needed than --args.

eddyq 11-18-2009 11:17 AM

Thanks, and looking at the man page, I agree.


All times are GMT -5. The time now is 05:59 PM.