Author Topic: How to add parameters to "main" in debug mode?  (Read 5380 times)

Offline sanron

  • Single posting newcomer
  • *
  • Posts: 3
How to add parameters to "main" in debug mode?
« 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!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How to add parameters to "main" in debug mode?
« Reply #1 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"
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline sanron

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to add parameters to "main" in debug mode?
« Reply #2 on: October 16, 2008, 09:07:32 am »
Thanks, I'll have a try

Offline sanron

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to add parameters to "main" in debug mode?
« Reply #3 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??

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How to add parameters to "main" in debug mode?
« Reply #4 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ