I recently changed from Windows where I was using Qt Creator to Ubuntu.

The problem is that Qt Creator in Ubuntu can't properly debug due to some problem attaching ptrace to the program which was cause by a security upgrade as I found out. The only way to debug is to mess with the system settings and change the ptrace variable configuration but I'm not comfortable with this, as it compromises security.

So my question is, is there anything close to Qt Creator or Visual Studio debugger in Linux? I mean being able to track variable values and pointers, etc.

If not what's the standard debugger for Linux? I don't mind using console tools as long as they offer the same functionality

  • 1
    For reference, this is recorded as QtCreator bug #3509. And also see this Q&A for the "mess with the system settings" stuff you're talking about: Receiving error while trying to debug in QtProject – gertvdijk Apr 6 '13 at 20:04
  • @gertvdijk - If they're really concerned about squashing the bug, they'll put together a dbus service that uses polkit to ask for priv escalation and add a creator plug-in to "toggle pthread enabled" – RobotHumans Apr 7 '13 at 18:03

Have you looked at gdb? It's a command line interface tool.

Another option is to go with Eclipse C/C++, which is a full fledged C and C++ IDE that provides front-end for gdb (CDT GNU Toolchain Debug).

I have not used the latter as am pretty comfortable with gdb.

| improve this answer | |

Without ptrace, I can't think of a debugger that will work. This other question has an answer that describes how to temporarily disable the ptrace restriction. It's not a gaping security problem to disable it temporarily for debugging. Generally, however, users don't need that functionality and there's no reason to allow it without reason.

Saying having ptrace enabled at all ever is a problem is a lot like saying plugging in an Ethernet cable is a problem. While it can be construed as correct, debugging without debugging permissions is not possible.

| improve this answer | |
  • As commented in the bug report, this is possible provided the process structure would be reorganized. – gertvdijk Apr 7 '13 at 18:08
  • I looked at it as a plug-in as opposed to reorganizing structure so there isn't any difference between Lin/Win/Mac and you just have one more click before you debug (and a meaningful error message). – RobotHumans Apr 7 '13 at 19:15

I can recommend gdb (it comes in package with GCC/g++ compiler suite I think - also you can use Qt Creator in Ubuntu). I have used it with and without ptrace and I don't really spot the difference, to be honest. But that's just maybe the way am developing. Also worth mentioning is Intel compiler: free for non-commercial use, and it has debugger integrated with Eclipse. However, it also requires to disable ptrace.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.