--- rpl/src/gestion_pile_systeme.c 2011/04/11 12:10:06 1.25 +++ rpl/src/gestion_pile_systeme.c 2011/04/14 13:18:54 1.26 @@ -307,13 +307,13 @@ trace(struct_processus *s_etat_processus long delta; + struct_liste_chainee *l_variable; + struct_liste_chainee *l_candidat; + struct_liste_pile_systeme *l_element_courant; unsigned char *tampon; - unsigned long p; - unsigned long v; - l_element_courant = (*s_etat_processus).l_base_pile_systeme; i = 0; @@ -353,7 +353,7 @@ trace(struct_processus *s_etat_processus if ((*l_element_courant).retour_definition == 'Y') { - fprintf(flux, "RTRN "); + fprintf(flux, "RTN "); if ((*l_element_courant).origine_routine_evaluation == 'Y') { @@ -370,32 +370,40 @@ trace(struct_processus *s_etat_processus // Calcul de la routine de départ + l_variable = (struct_liste_chainee *) + (*(*(*s_etat_processus) + .l_liste_variables_par_niveau).precedent).donnee; candidat = (*s_etat_processus) .longueur_definitions_chainees; - p = 0; + l_candidat = NULL; + + // l_variable balaie les variables de niveau 0. - for(v = 0; v < (*s_etat_processus).nombre_variables; v++) + while(l_variable != NULL) { - if ((*s_etat_processus).s_liste_variables[v].niveau - == 0) + if ((*(*((struct_variable *) (*l_variable).donnee)) + .objet).type == ADR) { delta = (*l_element_courant).adresse_retour - (*((unsigned long *) - ((*(*s_etat_processus) - .s_liste_variables[v].objet).objet))); + (*(*((struct_variable *) (*l_variable) + .donnee)).objet).objet)); if ((delta > 0) && (delta < candidat)) { candidat = delta; - p = v + 1; + l_candidat = l_variable; } } + + l_variable = (*l_variable).suivant; } - if (p > 0) + if (l_candidat != NULL) { - fprintf(flux, "\n Call from %s", (*s_etat_processus) - .s_liste_variables[p - 1].nom); + fprintf(flux, "\n Call from %s", + (*((struct_variable *) (*l_candidat).donnee)) + .nom); } else { @@ -427,27 +435,32 @@ trace(struct_processus *s_etat_processus // Calcul de la routine de départ - p = 0; + l_variable = (struct_liste_chainee *) + (*(*(*s_etat_processus) + .l_liste_variables_par_niveau).precedent).donnee; + candidat = (*s_etat_processus) + .longueur_definitions_chainees; + l_candidat = NULL; + + // l_variable balaie les variables de niveau 0. - for(v = 0; v < (*s_etat_processus).nombre_variables; v++) + while(l_variable != NULL) { - if ((*s_etat_processus).s_liste_variables[v].niveau - == 0) + if ( (*(*l_variable).donnee).objet == + (*l_element_courant).pointeur_adresse_retour) { - if ((*s_etat_processus).s_liste_variables[v].objet - == (*l_element_courant) - .pointeur_adresse_retour) - { - p = v + 1; - break; - } + l_candidat = l_variable; + break; } + + l_variable = (*l_variable).suivant; } - if (p > 0) + if (l_candidat != NULL) { - fprintf(flux, "\n Branch to %s", (*s_etat_processus) - .s_liste_variables[p - 1].nom); + fprintf(flux, "\n Branch to %s", + (*((struct_variable *) (*l_candidat).donnee)) + .nom); } else {