Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: 198710 on December 26, 2009, 02:36:06 pm

Title: A constructive suggestion
Post by: 198710 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. :)
Title: Re: A constructive suggestion
Post by: MortenMacFly 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.
Title: Re: A constructive suggestion
Post by: 198710 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?
Title: Re: A constructive suggestion
Post by: MortenMacFly 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.
Title: Re: A constructive suggestion
Post by: 198710 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!
Title: Re: A constructive suggestion
Post by: 198710 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...
Title: Re: A constructive suggestion
Post by: 198710 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?
Title: Re: A constructive suggestion
Post by: blueshake 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.