Author Topic: A constructive suggestion  (Read 5717 times)

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
A constructive suggestion
« on: December 26, 2009, 02:36:06 pm »
I'm currently developing a raw socket program under Ubuntu,but this kind of programs need administrator's privilege that can only run with "sudo" command.Since switching to root user is not that easy in Ubuntu,I wish CodeBlocks can provide a dialogbox with a single line textbox for password to access the superior privilege for such programs. :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9493
Re: A constructive suggestion
« Reply #1 on: December 26, 2009, 07:25:11 pm »
CodeBlocks can provide a dialogbox with a single line textbox for password to access the superior privilege for such programs. :)
You can use the tools menu for that easily. Setup SUDO as a tool using the macros for current project / target / executable and you're done. It'll work with any project you setup.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: A constructive suggestion
« Reply #2 on: December 27, 2009, 04:09:36 am »
Nice answer and thanks a lot!
But I also wish to know how to "debug" such programs with root's privilege?
« Last Edit: December 27, 2009, 04:30:25 am by 198710 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9493
Re: A constructive suggestion
« Reply #3 on: December 27, 2009, 12:33:59 pm »
But I also wish to know how to "debug" such programs with root's privilege?
If you are constantly need this you can modify the shell command from the settings and prepend a sudo in front. (Never tried that, but it should work.)

Alternatively why don't you simply start an instance of C::B itdelf with root rights? I know this might be a security risk, but as a developer you should know what to do... ;-) Notice that it's possible to habe e.g. one instance with root rights and another with default rights (in case you'll need this). Make sure you setup the multiple instance handling in the general settings correctly for this to work.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: A constructive suggestion
« Reply #4 on: December 27, 2009, 04:20:54 pm »
Wonderful idea!
But I discovered another approximately perfect solution:
"Remote" debug with 127.0.0.1 and say "sudo" before gdbserver 8)
What's unfortunate is that the raw socket detects the gdbserver connection recursively!

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: A constructive suggestion
« Reply #5 on: December 31, 2009, 11:55:40 am »
By the way,I noticed the inconvenience of gdb remote debug:target files should be synchronized to the remote machine before debugging,then why not CB help doing such actions by starting a CB_server  service at the remote system and send sync commands from the local IDE?
Third-Part utilities may help,but those commands are not always so easy to grasp,whereas uniwin cannot be installed on Ubuntu...

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: A constructive suggestion
« Reply #6 on: January 01, 2010, 12:09:02 pm »
Nobody replies...
Then I'd like to develop a plugin for this in the future,can anyone here tell me how to submit my code?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: A constructive suggestion
« Reply #7 on: January 01, 2010, 12:55:27 pm »
Nobody replies...
Then I'd like to develop a plugin for this in the future,can anyone here tell me how to submit my code?


It is easy to do this.one way is to upload it in this forum.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?