Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:47:30+00:00 2026-05-25T20:47:30+00:00

I use gdb-many-windows in emacs as normal user. But the program need to run

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:47:31+00:00Added an answer on May 25, 2026 at 8:47 pm

    When you do Meta-X gdb, emacs allows you to change the gdb command it will invoke.

    Just change it to sudo gdb --annotate=3 ...

    Update: as matt comments, this is still quite insecure. Better make it

    sudo /usr/bin/gdb -ex 'set auto-load-scripts no' --annotate=3 ...
    

    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/tty and 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:

    your_user_id ALL = NOPASSWD: /usr/bin/gdb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using gdb-many-windows, which contains five windows to switch between. Is there a shortcut
Basically I am on school computer trying to use gdb. But there are way
When I use gdb to debug a program written in C, the command disassemble
What gdb frontends can I use with vim for debugging C and C++ code?
To debug chromium using gdb ( LinuxDebugging ) one can use chromium --renderer-cmd-prefix=gdb --args
With g++ with -g option , I can use gdb for debugging purposes. What's
I am trying to use cuda-gdb, but it consistently hangs my entire machine which
Is there a command in gdb that I can use to (re)load / refresh
Under linux, can I use GDB to debug a process that is currently running?
Is it possible to run GDB with a program assembled with as and linked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.