[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25666 - monkey/trunk/pathologist/src/pathologist
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25666 - monkey/trunk/pathologist/src/pathologist |
Date: |
Sat, 29 Dec 2012 21:25:46 +0100 |
Author: teichm
Date: 2012-12-29 21:25:46 +0100 (Sat, 29 Dec 2012)
New Revision: 25666
Modified:
monkey/trunk/pathologist/src/pathologist/action_api.c
monkey/trunk/pathologist/src/pathologist/edb_api.c
monkey/trunk/pathologist/src/pathologist/pathologist_edb.h
Log:
now only evaluates globals which appear in sourcefiles from the stacktrace
Modified: monkey/trunk/pathologist/src/pathologist/action_api.c
===================================================================
--- monkey/trunk/pathologist/src/pathologist/action_api.c 2012-12-29
20:20:53 UTC (rev 25665)
+++ monkey/trunk/pathologist/src/pathologist/action_api.c 2012-12-29
20:25:46 UTC (rev 25666)
@@ -535,6 +535,7 @@
{
int ret = MONKEY_OK;
int stackDepth = 0;
+ char* file_names = NULL;
struct Function *function = NULL;
struct Trace *trace = NULL;
@@ -589,20 +590,32 @@
// Do value analysis for relevant expressions
analyzeExpressionValues(function, cntxt);
+ // add current filename to the list
+ char* tmp = file_names;
+ MONKEY_asprintf(&file_names,
+ "%s OR file_name LIKE \'%%%s\'",
+ file_names,
+ cntxt->gdb_frames->file);
+ MONKEY_free_non_null(tmp);
/* Now, dive deeper into the stack trace */
cntxt->gdb_frames = cntxt->gdb_frames->next;
}
+
// Retrieve globals from the database
+ file_names += 10; // cut the first 10 chars "(null) OR "
MONKEY_EDB_get_globals( edbCntxt,
+ file_names,
&iterateGlobals, trace);
+ file_names -= 10;
// Do value analysis for globals
analyzeGlobalsValues(trace, cntxt);
cleanup:
MONKEY_EDB_disconnect(edbCntxt);
+ MONKEY_free_non_null(file_names);
return ret;
}
Modified: monkey/trunk/pathologist/src/pathologist/edb_api.c
===================================================================
--- monkey/trunk/pathologist/src/pathologist/edb_api.c 2012-12-29 20:20:53 UTC
(rev 25665)
+++ monkey/trunk/pathologist/src/pathologist/edb_api.c 2012-12-29 20:25:46 UTC
(rev 25666)
@@ -272,27 +272,29 @@
int
-MONKEY_EDB_get_globals (struct MONKEY_EDB_Context *cntxt,
+MONKEY_EDB_get_globals( struct MONKEY_EDB_Context *cntxt,
+ const char *file_names,
MONKEY_ExpressionIterator iter,
void *iter_cls) {
- int err;
- char *errMsg;
- char *query;
- if (MONKEY_asprintf
- (&query,
- "select distinct expr_syntax, is_call from Expression where
start_lineno = 0 and end_lineno = 32767") == -1)
- {
- fprintf(stderr, "Memory allocation problem occurred!\n");
- return MONKEY_NO;
+ int ret = MONKEY_OK;
+ char *errMsg;
+ char *query;
+ if( MONKEY_asprintf(&query,
+ "SELECT DISTINCT expr_syntax,
is_call FROM Expression WHERE (%s) AND start_lineno = 0 AND end_lineno = 32767",
+ file_names) == -1 ) {
+ fprintf(stderr, "Memory allocation problem occurred!\n");
+ ret = MONKEY_NO;
+ goto fin;
}
- 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;
+ if( sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg) )
{
+ fprintf(stderr, "Error occurred while executing Database query.
`%s'", errMsg);
+ ret = MONKEY_NO;
+ goto fin;
}
- return MONKEY_OK;
+fin:
+ MONKEY_free_non_null(query);
+ return MONKEY_NO;
}
/**
Modified: monkey/trunk/pathologist/src/pathologist/pathologist_edb.h
===================================================================
--- monkey/trunk/pathologist/src/pathologist/pathologist_edb.h 2012-12-29
20:20:53 UTC (rev 25665)
+++ monkey/trunk/pathologist/src/pathologist/pathologist_edb.h 2012-12-29
20:25:46 UTC (rev 25666)
@@ -105,6 +105,7 @@
int
MONKEY_EDB_get_globals (struct MONKEY_EDB_Context *cntxt,
+ const char* file_names,
MONKEY_ExpressionIterator iter,
void *iter_cls);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25666 - monkey/trunk/pathologist/src/pathologist,
gnunet <=