Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: sanron on October 16, 2008, 08:51:34 am

Title: How to add parameters to "main" in debug mode?
Post by: sanron on October 16, 2008, 08:51:34 am
Hi all,
I want to debug a programme with parameters, but where set the parameters to?
Thanks!
Title: Re: How to add parameters to "main" in debug mode?
Post by: MortenMacFly on October 16, 2008, 09:04:20 am
I want to debug a programme with parameters, but where set the parameters to?
- select your debug target
- menu "Project" -> "Set program's arguments"
Title: Re: How to add parameters to "main" in debug mode?
Post by: sanron on October 16, 2008, 09:07:32 am
Thanks, I'll have a try
Title: Re: How to add parameters to "main" in debug mode?
Post by: sanron on October 16, 2008, 09:44:37 am
I have found the option, but cann't debug successfully.
the dubuger gave the following messages:
"
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /mnt/hgfs/WinLinux/peer_demo/
Adding source dir: /mnt/hgfs/WinLinux/peer_demo/
Adding file: bin/Debug/peer_demo
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb Red Hat Linux (6.5-16.el5rh)
No symbol table is loaded.  Use the "file" command.
No symbol table is loaded.  Use the "file" command.
Debugger finished with status 0
"

What's wrong??
Title: Re: How to add parameters to "main" in debug mode?
Post by: MortenMacFly on October 16, 2008, 10:57:42 am
No symbol table is loaded.  Use the "file" command.
Debug an application that has a symbol table loaded.
Thus compile/link with the debug switch and do *not* strip the symbols afterwards.