LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 05-01-2008, 10:37 AM   #1
cleopard
Member
 
Registered: May 2006
Posts: 39

Rep: Reputation: 15
invoking GNU debugger for C program


I've used GNU before on C programs, but not on a C program that takes in command line parameters. I have a program that takes as input an IP address as well as another integer, and I tried to invoke it like this:

gdb ./prog XXX.XXX.XXX.XXX 5

but the parameters weren't recognized. I looked at the 'man' page for gdb, but none of the switches looked like they would have anything to do with this. Thanks in advance.
 
Old 05-01-2008, 10:41 AM   #2
cleopard
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
never mind

I took another look at the 'man' page and saw the '--args' switch and that's apparently what I need. Helps to open my eyes.
 
Old 05-01-2008, 11:09 AM   #3
ararus
Member
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 56

Rep: Reputation: 15
You can also pass arguments via

run args...

or

set args ...
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
GDB (GNU DeBugger) plutonas Linux - Software 8 03-19-2013 12:09 PM
I have no debugger program? Flywelder Linux - Newbie 1 03-06-2007 11:03 AM
LXer: GNU Project Debugger: More fun with GDB LXer Syndicated Linux News 0 10-10-2006 03:54 AM
LXer: Atmel offer $500 AVR dev kit with Linux and GNU debugger LXer Syndicated Linux News 0 06-27-2006 04:54 AM
program execution path debugger? (C++) Thinking Programming 3 02-23-2006 04:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration