Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. C++ Tools List on Linux
Forum Updated to NodeBB v4.3 + New Features

C++ Tools List on Linux

Scheduled Pinned Locked Moved C++ Gurus
6 Posts 3 Posters 5.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ryadav
    wrote on last edited by
    #1

    I am moving my Windows C++ skills to the Linux platform and would like to know what are some of the tools I can use to diagnosis a process.

    Can people list the tools they use on the Linux system for C++ coding & diagnostics.

    Some of the tools I love to use on Windows are WinDbg, Resource Hacker & all the System Internal tools.

    http://technet.microsoft.com/en-us/sysinternals

    I am looking for equivalent tools on Linux. Please note I am looking for answers specific to bare C++ hacking on Linux and not tools specific to QT apps.

    I know about gdb for debugging a process.

    If I want to monitor the memory usage of a specific process, what else can I use beside top?

    I've heard of Valgrind for detecting memory leaks, is there some other way to determine memory leaks??

    What is a good way to benchmark a process? I know netbeans has some cool stuff.

    How do I determine what modules link to a binary or are loaded in a running process?

    Also is there a system logger on Linux? On Window I can use of OS Event Logging and Performance monitoring counters. Is there an equivalent on Linux?

    Thanks All

    Kind Regards,
    Rajinder Yadav

    SafetyNet Test Driven Development
    http://safetynet.devmentor.org

    1 Reply Last reply
    0
    • frankcyblogic.deF Offline
      frankcyblogic.deF Offline
      frankcyblogic.de
      wrote on last edited by
      #2

      Valgrind is actually a whole suite of tools: memory profiling, cache profiling, etc... When it comes to performance counters I would recommend oprofile. If your are looking for something more Windowish, try the zoom profiler. One thing you may have noticed: people in the Linux/Unix environment use shells, so you will have to learn one, first.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ryadav
        wrote on last edited by
        #3

        I've been using Linux at home exclusively for a year and I feel comfortable with the shell. Most of my focus has been with web 2.0 hacking, primarily Ruby on Rails. I recently fell in love with QT and have been able to transfer my Windows MFC skills over to QT GUI coding in very short order.

        I figure it's time I got more familiar with C++ system tools on Linux.

        What is the web-site for zoom profile??

        Kind Regards,
        Rajinder Yadav

        SafetyNet Test Driven Development
        http://safetynet.devmentor.org

        1 Reply Last reply
        0
        • frankcyblogic.deF Offline
          frankcyblogic.deF Offline
          frankcyblogic.de
          wrote on last edited by
          #4

          "rotateright.com":http://rotateright.com. You were listing only GUI frontends from Windows, thought you are looking for a similar experience on Linux. By the way it is called "Qt", with small 't'.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            ryadav
            wrote on last edited by
            #5

            Thanks for the link, I really like both the tools you mentioned!

            Window unfortunately is primarily gui front-end driven, have you see the power of cmd.exe, it's antiquated msdos! I haven't come across many C++ developer who use the command line on Windows, including myself. On Linux it seems to be the other way around, which I actually find more productive with some things.

            btw, Qt got it, small 't', don't want to upset the Trolls ;-)

            Kind Regards,
            Rajinder Yadav

            SafetyNet Test Driven Development
            http://safetynet.devmentor.org

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              [quote author="ryadav" date="1298140567"]If I want to monitor the memory usage of a specific process, what else can I use beside top?
              [/quote]
              ksysguard or one of a million other system monitors ;-)

              [quote author="ryadav" date="1298140567"]
              What is a good way to benchmark a process? I know netbeans has some cool stuff.
              [/quote]
              QTestLib has some support for benchmarking. Have a read of the "docs":http://doc.qt.nokia.com/latest/qtestlib-manual.html#creating-a-benchmark.

              Remember to run your benchmarks on a release build.

              You can also use valgrind --callgrind to get a trace of where your app spends each fraction of its time. You can view the output with kcachegrind. This will let you know where to focus your optimisation efforts.

              [quote author="ryadav" date="1298140567"]
              How do I determine what modules link to a binary or are loaded in a running process?

              Also is there a system logger on Linux? On Window I can use of OS Event Logging and Performance monitoring counters. Is there an equivalent on Linux?
              [/quote]

              To see what dynamic libraries are needed by an app at runtime use:
              @ldd /path/to/lib/or/app@

              You can use strace to get a trace of every syscall made by your application. Use it like:

              @strace myapp@

              The output will be very verbose so it is often useful to redirect it into a file that you can grep later.

              Another useful tool is "lsof" which will tell you about all of the open file handles your application has.

              Do not be afraid to make use of qDebug() statements. You can easily disable them in a release build by defining QT_NO_DEBUG_OUTPUT. ie just add

              @
              CONFIG(release, debug|release) {
              DEFINES += QT_NO_DEBUG_OUTPUT
              }
              @

              to your .pro file.

              I'm sure you'll pick up many more tips/tricks as you go along.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved