I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem?
Update: Thanks all.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you do
Meta-X gdb,emacsallows you to change thegdbcommand it will invoke.Just change it to
sudo gdb --annotate=3 ...Update: as matt comments, this is still quite insecure. Better make it
An even better approach might be to change your setup such that the program you are debugging does not need to run as root in the first place. Perhaps you could use fakeroot instead?
Update 2: sudo appears to interfere with emacs terminal handling. In particular, it tries to read password from
/dev/ttyand doesn’t get input from emacs mini-buffer.The solution is to allow yourself to invoke GDB without password via sudo. Something like this (in
/etc/sudoers) should work: