gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22821 - monkey/branches/MonkeyBacktracking/monkey/src/monk


From: gnunet
Subject: [GNUnet-SVN] r22821 - monkey/branches/MonkeyBacktracking/monkey/src/monkey
Date: Sun, 22 Jul 2012 16:39:48 +0200

Author: safey
Date: 2012-07-22 16:39:48 +0200 (Sun, 22 Jul 2012)
New Revision: 22821

Modified:
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gdbmi_prg_control.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_edb.h
Log:
Monkey/Seaspider paths conflict resolved

Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-07-22 13:47:17 UTC (rev 22820)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-07-22 14:39:48 UTC (rev 22821)
@@ -14,7 +14,7 @@
 extern void sendMail(const char *messageContents, const char *reportFileName,
                     const char *emailAddress);
 
-
+static int crashExpressionFoundInEDB = MONKEY_YES;
 static int async_c = 0;
 static char *signalMeaning = NULL;
 static char *signalName = NULL;
@@ -211,7 +211,6 @@
                /* Change current GDB frame to the one containing source code */
                gmi_stack_select_frame(cntxt->gdb_handle,
                                           cntxt->gdb_frames->level);
-               //gmi_exec_display_expression_syntax(cntxt->gdb_handle, 
cntxt->gdb_frames->line);
 
                return GDB_STATE_STOPPED;
     }
@@ -357,7 +356,7 @@
     return 0;
 }
 
-
+#if 0
 static struct Expression *getFaultyExpression(struct Function *function)
 {
     struct Expression *faultyExpression = NULL;
@@ -376,6 +375,7 @@
 
     return faultyExpression;
 }
+#endif
 
 
 static int isAssignment(const char *expressionSyntax)
@@ -392,10 +392,6 @@
 {
     struct Expression *tmp;
 
-
-    faultyExpression = getFaultyExpression(function);
-
-    if (NULL != faultyExpression) {
        tmp = function->expressionListHead;
        while (NULL != tmp) {
                if (MONKEY_YES == tmp->isCall) {
@@ -435,26 +431,7 @@
            }
                tmp = tmp->next;
        }
-    }
-    /* Set watch points on the faulty-expression's subexpressions */
-//      if (NULL != faultyExpression) {
-//              tmp = expressionListHead;
-//              while (NULL != tmp) {
-//                      if (tmp != faultyExpression) {
-//                              /* Only subexpressions are interesting */
-//                               watchPoint = 
gmi_break_watch(cntxt->gdb_handle, wm_write, tmp->expressionSyntax);
-//                               if (!watchPoint)
-//                                 {
-//                                      printf("Error in setting 
watchpoint\n");
-//                                      return 1;
-//                                 }
-//                               printf("Watchpoint %d for expression: %s\n", 
watchPoint->number, watchPoint->exp);
-//                               mi_free_wp(watchPoint);
-//                      }
-//                      tmp = tmp->next;
-//              }
-//              return MONKEY_OK;
-//      }
+
     return MONKEY_OK;
 }
 
@@ -465,10 +442,7 @@
                   struct MONKEY_ACTION_Context *cntxt)
 {
     struct Expression *tmp;
-    faultyExpression = getFaultyExpression(function);
 
-
-    if (NULL != faultyExpression) {
        tmp = function->expressionListHead;
        while (NULL != tmp) {
                if (MONKEY_YES == tmp->isCall) {
@@ -498,7 +472,6 @@
                                                        removedExpression);
            }
        }
-    }
     return MONKEY_OK;
 }
 
@@ -619,11 +592,18 @@
                                              &scopeEndCallback,
                                              &endScope);
     if (endScope <= 0) {
-       ret = MONKEY_NO;
-       goto cleanup;
+       /* crash expression not found in the EDB, get the end scope of the 
crash function */
+       crashExpressionFoundInEDB = MONKEY_NO;
+       ret = MONKEY_EDB_expression_function_end_scope(edbCntxt, 
cntxt->gdb_frames->file,
+                       cntxt->gdb_frames->line,
+                       &scopeEndCallback, &endScope);
+       if (endScope <= 0) {
+               ret = MONKEY_NO;
+               goto cleanup;
+       }
     }
 
-    if (cntxt->scope_depth > 0) {
+    if (cntxt->scope_depth > 0 && MONKEY_YES == crashExpressionFoundInEDB) {
        /* Means we need to look is scopes outer than the one where the problem 
occurred */
        struct ScopeEnd *scopeEndPtr;
        int index = 1;

Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c      
2012-07-22 13:47:17 UTC (rev 22820)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c      
2012-07-22 14:39:48 UTC (rev 22821)
@@ -107,7 +107,7 @@
 
          if (MONKEY_asprintf
                  (&query,
-                  "select distinct end_lineno from Expression where file_name 
LIKE \'%%/%s\' and start_lineno >= %d and start_lineno < %d and end_lineno > %d 
order by end_lineno",
+                  "select distinct end_lineno from Expression where file_name 
LIKE \'%%%s\' and start_lineno >= %d and start_lineno < %d and end_lineno > %d 
order by end_lineno",
                   file_name, function_beginning, scope_in_question_start, 
scope_in_question_end) == -1)
                {
                  fprintf(stderr,
@@ -126,7 +126,38 @@
          return MONKEY_OK;
 }
 
+int
+MONKEY_EDB_expression_function_end_scope(struct MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int start_lineno,
+               MONKEY_ExpressionIterator
+               iter, void *iter_cls)
+{
+         int err;
+         char *errMsg;
+         char *query;
 
+         if (MONKEY_asprintf
+             (&query,
+              "select MAX(end_lineno) from Expression where file_name LIKE 
\'%%%s\' and start_lineno < %d",
+              file_name, start_lineno) == -1)
+           {
+             fprintf(stderr,
+                         "Memory allocation problem occurred during creating 
database query!\n");
+             return MONKEY_NO;
+           }
+
+         err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+         if (err)
+           {
+             fprintf(stderr,
+                         "Error occurred while executing Database query. `%s'",
+                         errMsg);
+             return MONKEY_NO;
+           }
+         return MONKEY_OK;
+}
+
 int
 MONKEY_EDB_function_start_line_for_scope(struct MONKEY_EDB_Context
                *cntxt, const char *file_name,
@@ -140,7 +171,7 @@
 
          if (MONKEY_asprintf
              (&query,
-              "select MIN(start_lineno) from Expression where file_name LIKE 
\'%%/%s\' and end_lineno >= %d",
+              "select MIN(start_lineno) from Expression where file_name LIKE 
\'%%%s\' and end_lineno >= %d",
               file_name, scope_end) == -1)
            {
              fprintf(stderr,
@@ -183,7 +214,7 @@
 
   if (MONKEY_asprintf
       (&query,
-       "select end_lineno from Expression where file_name LIKE \'%%/%s\' and 
start_lineno = %d",
+       "select end_lineno from Expression where file_name LIKE \'%%%s\' and 
start_lineno = %d",
        file_name, start_line_no) == -1)
     {
       fprintf(stderr,
@@ -218,7 +249,7 @@
 
   if (MONKEY_asprintf
       (&query,
-       "select end_lineno from Expression where file_name LIKE \'%%/%s\' and 
expr_syntax = %s",
+       "select end_lineno from Expression where file_name LIKE \'%%%s\' and 
expr_syntax = %s",
        file_name, expr_syntax) == -1)
     {
       fprintf(stderr,
@@ -251,7 +282,7 @@
   char *query;
   if (MONKEY_asprintf
          (&query,
-          "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%/%s\' and start_lineno >= %d and end_lineno <= %d",
+          "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%%s\' and start_lineno >= %d and end_lineno <= %d",
           file_name, start_line_no, end_line_no) == -1)
        {
          fprintf(stderr,
@@ -294,7 +325,7 @@
   char *query;
   if (MONKEY_asprintf
       (&query,
-       "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%/%s\' and start_lineno <= %d and end_lineno = %d",
+       "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%%s\' and start_lineno <= %d and end_lineno = %d",
        file_name, start_line_no, end_line_no) == -1)
     {
       fprintf(stderr,
@@ -326,7 +357,7 @@
   char *query;
   if (MONKEY_asprintf
       (&query,
-       "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%/%s\' and start_lineno = %d and end_lineno = %d",
+       "select expr_syntax, start_lineno, is_call from Expression where 
file_name LIKE \'%%%s\' and start_lineno = %d and end_lineno = %d",
        file_name, start_line_no, end_line_no) == -1)
     {
       fprintf(stderr,

Modified: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gdbmi_prg_control.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/gdbmi_prg_control.c    
2012-07-22 13:47:17 UTC (rev 22820)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gdbmi_prg_control.c    
2012-07-22 14:39:48 UTC (rev 22821)
@@ -129,11 +129,6 @@
 mi_send(h, "-interpreter-exec mi record\n");
 }
 
-void mi_exec_display_expression_syntax(mi_h *h, int lineNo)
-{
-mi_send(h, "-interpreter-exec console list\n");
-}
-
 void mi_exec_next(mi_h *h, int count)
 {
  if (count>1)
@@ -399,12 +394,6 @@
        return 1;
 }
 
-int gmi_exec_display_expression_syntax(mi_h *h, int lineNo)
-{
-       mi_exec_display_expression_syntax(h, lineNo);
-       return 1;
-}
-
 /**[txh]********************************************************************
 
   Description:

Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_edb.h
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_edb.h   
2012-07-22 13:47:17 UTC (rev 22820)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_edb.h   
2012-07-22 14:39:48 UTC (rev 22821)
@@ -53,6 +53,12 @@
                iter, void *iter_cls);
 
 int
+MONKEY_EDB_expression_function_end_scope(struct MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int start_lineno,
+               MONKEY_ExpressionIterator
+               iter, void *iter_cls);
+int
 MONKEY_EDB_function_start_line_for_scope(struct MONKEY_EDB_Context
                *cntxt, const char *file_name,
                int scope_end,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]