help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

running gdb as root under emacs (24)


From: stefan . puiu
Subject: running gdb as root under emacs (24)
Date: Wed, 10 Jan 2018 08:53:46 -0800 (PST)
User-agent: G2/1.0

Hi, 

I'm working on a project that needs to run as root and was wondering if there 
is a way to run gdb as root from emacs. Simply trying 'M-x gdb' and then 'sudo 
gdb ...' does not seem to work. While googling, I found that you can use tramp 
to run certain commands as root 
(https://groups.google.com/forum/#!topic/gnu.emacs.help/fXxnXc3v-pM), so based 
on that I tried 'M-:' and then something like this: 

(with-temp-buffer
  (cd "/sudo::/")
  (shell-command "gdb -q"))

This doesn't seem to work interactively, however - I get a buffer that simply 
has "(gdb) quit" as the output and then there are some weird characters in the 
minibuffer. 

What would be a workable approach to achieve this? I'm using emacs24 on Ubuntu 
16.04 (though I don't mind upgrading if that's what it takes). 

Thanks,
Stefan.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]