0

I am hoping to find an app with GUI that allows the user to do dynamic analysis for code comprehension. Note that the main goal here code comprehension by the human reader, and not other uses of dynamic analysis of code for testing etc.

The app should at the very minimum support C and C++. It might also support assembly.

To this end, I envision a GUI window that is divided into two halves - left half and right half. The left half displays the code file the user opens (much like a normal text editor, perhaps with some IDE capability). The right half displays the variables initialised and the current values of variables (if C or C++), or displays the current values set in registers, flags, stack, memory locations (if assembly).

Why did I use the word “current”? That’s because one key function I am hoping the app to have is the allowance of the user to “cycle” through each statement in the code using up and down arrow, or other, keys on the keyboard. Eg, for this code:

int64_t v1 = a2; // r13
    int64_t v2 = (int64_t)"c:d:l:"; // rbx
    int64_t v3 = *(int64_t *)0x100001020; // r12
    int64_t v4 = 0; // r14
    int64_t v5 = (int64_t)"c:d:l:"; // 0x100000979393412
    int64_t v6 = a2; // 0x100000976392411
    int64_t v7 = 0; // 0x1000009ce
    int32_t v8 = 0;
    int32_t v9;
    while (true) {
        int32_t v10 = _getopt((int32_t)a1, (char **)v6, (char *)v5); // 0x10000097c397416
        int32_t v11;
        if (v10 > 99) {
            int32_t v12 = v10; // 0x10000097c397422
            int32_t v13 = v8;
            while (true) {
                int32_t v14 = v12; // 0x10000097c402
                while (true) {
…

The left window in the program will “highlight” the first statement by default:

int64_t v1 = a2; 

Then when the user presses the down arrow key, the highlight will go to:

int64_t v2 = (int64_t)"c:d:l:";

And so forth… (And vice-versa for up arrow key)

And what should show on the right half of the window is the gradual progression of the new initialisation of variables, the setting of values in those variables, the destruction of variables as they are destroyed, as the user/reader goes down each line of code. So when the user is at:

int64_t v1 = a2; 

It should show on the right-pane there’s only one variable initialised:

Type    Variable   Value
int64_t  v1          a2

And by the time he’s at:

int64_t v4 = 0;

It should show on the right:

Type     Variable   Value
int64_t  v1          a2
int64_t  v2          (int64_t)"c:d:l:"
int64_t  v3          *(int64_t *)0x100001020
int64_t  v4          0

User can then really be able to see clearly the change of the variables as he progresses through to the code.

There should be other features as well eg.: (1) there should be tracking of other aspects of the code other than just variable values. These include A. the functions defined and available for calling so far, B. The typedefs defined so far, C. The classes defined so far. (2) suppport for branches and loops, (3) support for multiple-file programs and calling of functions. The app should automatically bring the user to the correct file or function’s code when the function is called when he cycles through the code.

Any suggestions? I really need something that can support “cycling” with up and down arrow keys.

Your Answer

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

Browse other questions tagged or ask your own question.