From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: stefan.puiu@gmail.com Newsgroups: gmane.emacs.help Subject: running gdb as root under emacs (24) Date: Wed, 10 Jan 2018 08:53:46 -0800 (PST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1515603232 29216 195.159.176.226 (10 Jan 2018 16:53:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 16:53:52 +0000 (UTC) Injection-Date: Wed, 10 Jan 2018 16:53:47 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 10 17:53:48 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZJdH-0006vl-09 for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jan 2018 17:53:43 +0100 Original-Received: from localhost ([::1]:53581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZJfG-0007mv-L9 for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jan 2018 11:55:46 -0500 X-Received: by 10.55.115.133 with SMTP id o127mr13397611qkc.18.1515603227126; Wed, 10 Jan 2018 08:53:47 -0800 (PST) X-Received: by 10.31.170.131 with SMTP id t125mr2094411vke.6.1515603226808; Wed, 10 Jan 2018 08:53:46 -0800 (PST) Original-Path: usenet.stanford.edu!g35no170654qtk.1!news-out.google.com!g8ni220qtk.0!nntp.google.com!z1no173002qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=193.226.172.43; posting-account=zoTxwQoAAABg4AQzY_r8k_HEVmMPN3k5 Original-NNTP-Posting-Host: 193.226.172.43 Original-Xref: usenet.stanford.edu gnu.emacs.help:221524 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115641 Archived-At: Hi,=20 I'm working on a project that needs to run as root and was wondering if the= re 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 th= en something like this:=20 (with-temp-buffer (cd "/sudo::/") (shell-command "gdb -q")) This doesn't seem to work interactively, however - I get a buffer that simp= ly has "(gdb) quit" as the output and then there are some weird characters = in the minibuffer.=20 What would be a workable approach to achieve this? I'm using emacs24 on Ubu= ntu 16.04 (though I don't mind upgrading if that's what it takes).=20 Thanks, Stefan.