Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » how to debug a program with root priviledge on eclipse CDT?
how to debug a program with root priviledge on eclipse CDT? [message #1799381] Wed, 05 December 2018 20:14 Go to next message
Siyu Zhang is currently offline Siyu ZhangFriend
Messages: 3
Registered: August 2018
Junior Member
I'm using ubuntu(linux) and changing FORTE to send Ethernet packet.

What I have done until now.

1 Enable your user to run gdb as root without being asked for any password:
sudo visudo
Add the following line after all other rules:
myusername ALL = (ALL) ALL
myusername ALL=(root) NOPASSWD:/usr/bin/gdb

2 Create or modify a debug configuration in eclipse to run gdb as root
e.g. in Run > Debug Configurations > C/C++ Application > YourProject Debug:
change Debugger > Main > GDB debugger from gdb to sudo -u myusername gdb

but this solution doesn't work, I get "socket: Operation not permitted".

Could you give me some insights into it?

Thank you.
Re: how to debug a program with root priviledge on eclipse CDT? [message #1799399 is a reply to message #1799381] Thu, 06 December 2018 08:46 Go to previous message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi,

so you changed FORTE to send some other kind of Ethernet messages? Perhaps you have just introduced a bug?

Your approach to starting gdb as a privileged process seems right, but it would be better just to grant gdb the needed capabilites. Then you would also not need to run gdb with sudo.

Best regards,
Martin
Previous Topic:Control of Kuka YouBot by Raspberry Pi 3
Next Topic:Error during testating of function block
Goto Forum:
  


Current Time: Sat Apr 27 03:13:09 GMT 2024

Powered by FUDForum. Page generated in 0.02836 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top