2016年11月2日 星期三

Nemiver - A wonderful tool for tracing code and debug in Linux

Overview

    This article will introduce a package that can facilitate tracing code and debug in Linux.

Motivation

    In my opinion, to see how the program run is the best way to understand its implementation.  Therefore, I often use debugger to explore a program at the first time.  By using the debugger, you can not only see which code block is actually accessed by a process but also save a lot of time to include all header and source files (as you might do for code editors) since all you need is feed the debugger with the binary program.
    However, the traditional tools in Linux (such as gdb or DDD) are not user-friendly, such as not display the code as colorful texts as well as the texts size can't be adjusted, as shown follows.  In the next section, I'll introduce a new tool that can remedy these drawbacks.

Nemiver   

     Nemiver is a Debugger that I have found recently.  As shown below, it not only display the code gracefully, but also be able to change the text size and editor theme.  The following code is about to perform Merge Sort to std::list.  As you can see, the lower half panel display the value of each local variables and even each elements of the std::list.  Furthermore, if the process is in the member function of a certain class, you can also see the data member displayed.

Trouble Shooting

    Sometimes you might encounter the following situation (a window pop out and says "Cannot find file '/build/.../linux/raise.c'..."), it might due to an exception thrown by your code or the process fail to pass a certain assert statement.

You can click the "Target Terminal" tab in the bottom of panel to get more information.

沒有留言:

張貼留言