Last active
February 23, 2016 18:22
-
-
Save ppetraki/a0080da047047ea184c6 to your computer and use it in GitHub Desktop.
qtcreator - run gdb via sudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- qtcreator-3.0.1.orig/src/plugins/debugger/gdb/gdbprocess.cpp | |
+++ qtcreator-3.0.1/src/plugins/debugger/gdb/gdbprocess.cpp | |
@@ -59,7 +59,11 @@ QByteArray GdbProcess::readAllStandardEr | |
void GdbProcess::start(const QString &cmd, const QStringList &args) | |
{ | |
- m_gdbProc.setCommand(cmd, Utils::QtcProcess::joinArgs(args)); | |
+ QStringList sudoArgs; | |
+ sudoArgs << cmd << args; | |
+ QString sudoCmd = QString::fromUtf8("/usr/bin/sudo"); | |
+ | |
+ m_gdbProc.setCommand(sudoCmd, Utils::QtcProcess::joinArgs(sudoArgs)); | |
m_gdbProc.start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is crud, but it works. Start a terminal and just 'sudo ls' to get your auth activated (or use passwordless sudo if you're nuts) and then launch qtcreator. I'll work on a plugin based solution later.