Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Problem with PTP-Debug

    Hi, I'm new with Bug-zilla, so I post this here.
   I have a problem with pointer and array when using PTP-Debuger to view them, so I decide to write a small test program as follow :

#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>

// case 1
typedef int case1_array1[2];
typedef int case1_array2[2][2];
// case 2
typedef int * pint;
typedef pint case2_array1[2];
typedef pint case2_array2[2][2];

int case2_create_array1(case2_array1  arr){
    arr[0] = malloc(sizeof(int));
    arr[1] = malloc(sizeof(int));
    *arr[0] = 0;
    *arr[1] = 1;
    return 0;
}

void case2_free_array1(case2_array1 arr){
    free(arr[0]);
    free(arr[1]);
}

int case2_create_array2(case2_array2  arr){
    arr[0][0] = malloc(sizeof(int));
    arr[0][1] = malloc(sizeof(int));
    arr[1][0] = malloc(sizeof(int));
    arr[1][1] = malloc(sizeof(int));
    *arr[0][0] = 0;
    *arr[0][1] = 1;
    *arr[1][0] = 2;
    *arr[1][1] = 3;
    return 0;
}

void case2_free_array2(case2_array2 arr){
    free(arr[0][0]);
    free(arr[0][1]);
    free(arr[1][0]);
    free(arr[1][1]);
}

int main(int argc, char ** argv){
    case1_array1 case1_var1;
    case1_array2 case1_var2;
    case2_array1 case2_var1;
    case2_array2 case2_var2;
    int case3_var1[2];
    int case3_var2[2][2];
  
    case2_create_array1(case2_var1);
    case2_create_array2(case2_var2);

    return 0;
}

    The problem is with variable view tab when I try to expand these variable:
- Every thing is ok with case3_var1 and case3_var2.
- With case2_var1 and case2_var2, I got the following error :
         An internal error occurred during : "Retrieving Children"
- With case1_var1 everything seem ok. But with case1_var2, the first expand, it's ok, i got too line "0" and "1", when expand  "0" or "1" all processes terminated immediately. After that, If I re-debug the program, variable view didn't show any thing unless I restart eclipse.

When debuging with CDT, every thing is OK.

PS : I'm using PTP 1.1.


Shape Yahoo! in your own image. Join our Network Research Panel today!

Back to the top