gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22541 - in monkey/branches/MonkeyBacktracking/monkey: . sr


From: gnunet
Subject: [GNUnet-SVN] r22541 - in monkey/branches/MonkeyBacktracking/monkey: . src/monkey
Date: Sun, 8 Jul 2012 00:23:59 +0200

Author: safey
Date: 2012-07-08 00:23:59 +0200 (Sun, 08 Jul 2012)
New Revision: 22541

Added:
   
monkey/branches/MonkeyBacktracking/monkey/ref_bug_division_by_zero_loop_nodepth_rpt.xml
Modified:
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c
Log:
Stack trace info populated for all frames.
XML writer escapes special characters in inner text.
Adding a new ref

Added: 
monkey/branches/MonkeyBacktracking/monkey/ref_bug_division_by_zero_loop_nodepth_rpt.xml
===================================================================
--- 
monkey/branches/MonkeyBacktracking/monkey/ref_bug_division_by_zero_loop_nodepth_rpt.xml
                             (rev 0)
+++ 
monkey/branches/MonkeyBacktracking/monkey/ref_bug_division_by_zero_loop_nodepth_rpt.xml
     2012-07-07 22:23:59 UTC (rev 22541)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<crash category="Division By Zero" function="main" line="14" 
file="bug_division_by_zero_loop.c" >
+<history><epoch step="0" >
+<trace><function name="main" line="14" file="bug_division_by_zero_loop.c" 
depth="0" >
+<expressions><expression name="result/k" >
+Not Evaluated</expression>
+<expression name="i&lt;5" >
+1</expression>
+<expression name="i" >
+1</expression>
+</expressions>
+</function>
+</trace>
+</epoch>
+</history>
+</crash>


Property changes on: 
monkey/branches/MonkeyBacktracking/monkey/ref_bug_division_by_zero_loop_nodepth_rpt.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-07-07 16:12:28 UTC (rev 22540)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-07-07 22:23:59 UTC (rev 22541)
@@ -408,6 +408,11 @@
                }
            if (tmp != faultyExpression) {
                if (MONKEY_NO == isAssignment(tmp->expressionSyntax)) { // We 
should NOT evaluate assignments, otherwise subsequent expression evaluations 
will be spoiled
+                       if (strcmp(tmp->expressionSyntax, "NULL") == 0) {
+                               tmp->expressionValue = "0x0";
+                               tmp = tmp->next;
+                               continue;
+                       }
                    tmp->expressionValue =
                        gmi_data_evaluate_expression(cntxt->gdb_handle,
                                                     tmp->
@@ -475,7 +480,12 @@
                        continue;
                }
            if (MONKEY_NO == isAssignment(tmp->expressionSyntax)) {
-                       const char *eval;
+               const char *eval;
+               if (strcmp(tmp->expressionSyntax, "NULL") == 0) {
+                               tmp->expressionValue = "0x0";
+                               tmp = tmp->next;
+                               continue;
+               }
                        eval =
                                gmi_data_evaluate_expression(cntxt->gdb_handle,
                                                         tmp->expressionSyntax);
@@ -744,6 +754,7 @@
 
     /* Now, dive deeper into the stack trace */
     cntxt->gdb_frames = cntxt->gdb_frames->next;
+
     if (NULL == cntxt->gdb_frames) {
                /* Cleanup function static variables that are used across 
recursive calls */
 cleanup:
@@ -756,6 +767,8 @@
                //}
     } else {
                /* Recursively inspect the database for deeper frames */
+       gmi_stack_select_frame(cntxt->gdb_handle, cntxt->gdb_frames->level);
+       gmi_stack_info_frame(cntxt->gdb_handle);
                ret = MONKEY_ACTION_inspect_expression_database(cntxt);
     }
     return ret;

Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c   
2012-07-07 16:12:28 UTC (rev 22540)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c   
2012-07-07 22:23:59 UTC (rev 22541)
@@ -85,6 +85,17 @@
        return NULL;
 }
 
+static char* escapeSpecialCharacters(const char * s) {
+       char* escaped;
+       escaped = MONKEY_str_replace_all (s, "&", "&amp;"); // & (escaping amp 
character MUST be the first, otherwise, it will spoil the other escaped 
characters
+       escaped = MONKEY_str_replace_all (escaped, "\"", "&quot;"); // single 
quote
+       escaped = MONKEY_str_replace_all (escaped, "'", "&apos;"); // double 
quotes
+       escaped = MONKEY_str_replace_all (escaped, "<", "&lt;"); // less than
+       escaped = MONKEY_str_replace_all (escaped, ">", "&gt;");// greater than
+
+       return escaped;
+}
+
 int MONKEY_XML_WRITER_write_document(FILE* file, struct MONKEY_XML_Node *root) 
{
        struct MONKEY_XML_Node *tmp = root->childrenListHead;
        struct XmlAttribute *tmpAttribute = root->attributeListHead;
@@ -94,19 +105,13 @@
                fprintf(file, "<%s ", root->name);
                while (NULL != tmpAttribute) {
                        /* Escaping special characters in attribute values */
-                       tmpAttribute->value = MONKEY_str_replace_all 
(tmpAttribute->value, "&", "&amp;"); // & (escaping amp character MUST be the 
first, otherwise, it will spoil the other escaped characters
-                       tmpAttribute->value = MONKEY_str_replace_all 
(tmpAttribute->value, "\"", "&quot;"); // single quote
-                       tmpAttribute->value = MONKEY_str_replace_all 
(tmpAttribute->value, "'", "&apos;"); // double quotes
-                       tmpAttribute->value = MONKEY_str_replace_all 
(tmpAttribute->value, "<", "&lt;"); // less than
-                       tmpAttribute->value = MONKEY_str_replace_all 
(tmpAttribute->value, ">", "&gt;");// greater than
-
-                       fprintf(file, "%s=\"%s\" ", tmpAttribute->name, 
tmpAttribute->value);
+                       fprintf(file, "%s=\"%s\" ", tmpAttribute->name, 
escapeSpecialCharacters(tmpAttribute->value));
                        tmpAttribute = tmpAttribute->next;
                }
                fprintf(file, ">\n");
        }
        if (NULL != root->innerText)
-               fprintf(file, "%s", root->innerText);
+               fprintf(file, "%s", escapeSpecialCharacters(root->innerText));
 
        while (NULL != tmp) {
                MONKEY_XML_WRITER_write_document(file, tmp);




reply via email to

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