[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21478 - monkey/branches/MonkeyBacktracking/monkey/src/monk
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21478 - monkey/branches/MonkeyBacktracking/monkey/src/monkey |
Date: |
Mon, 14 May 2012 16:18:40 +0200 |
Author: safey
Date: 2012-05-14 16:18:40 +0200 (Mon, 14 May 2012)
New Revision: 21478
Modified:
monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey.c
monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_action.h
Log:
Minor fixes. Source file name issue with Assertion failures on x86 machines
resolved. Backtracking issue with Assertion failures on x86 machines still
pending.
Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
2012-05-14 13:45:34 UTC (rev 21477)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
2012-05-14 14:18:40 UTC (rev 21478)
@@ -16,12 +16,9 @@
static int async_c = 0;
-static int stepBackCount = 0;
static char *signalMeaning = NULL;
static int stoppedInSharedLib = MONKEY_NO;
static int failureFunctionStartLine = 0; // start line number of the
function in which the failure occurs
-static struct Expression *expressionListHead = NULL;
-static struct Expression *expressionListTail = NULL;
static struct WatchInfo *watchInfoListHead = NULL;
static struct WatchInfo *watchInfoListTail = NULL;
static struct Expression *faultyExpression = NULL;
@@ -187,6 +184,9 @@
/* Reaching this line means that the program has stopped
abnormally OR we are in backtracking mode, and it's a step backward */
cntxt->gdb_frames = gmi_stack_list_frames(cntxt->gdb_handle);
+ while (NULL == cntxt->gdb_frames->file)
+ cntxt->gdb_frames = cntxt->gdb_frames->next;
+
if (MONKEY_YES != isInCodeBase(cntxt->gdb_frames->file)) {
do {
cntxt->gdb_frames = cntxt->gdb_frames->next;
@@ -195,7 +195,7 @@
if (MONKEY_YES == cntxt->run_reverse) {
/* We are in backtracking mode, we need to move
GDB from the shared library to our source code */
stoppedInSharedLib = MONKEY_YES;
- *gmi_break_insert(cntxt->gdb_handle,
cntxt->gdb_frames->file,
+ gmi_break_insert(cntxt->gdb_handle,
cntxt->gdb_frames->file,
cntxt->gdb_frames->line);
gmi_exec_continue_reverse(cntxt->gdb_handle);
while (!mi_get_response(cntxt->gdb_handle))
@@ -1186,73 +1186,72 @@
}
-int MONKEY_ACTION_format_report(struct MONKEY_ACTION_Context
- *cntxt)
-{
- switch (cntxt->debug_mode) {
- case DEBUG_MODE_GDB:
- if (cntxt->bug_detected == BUG_NULL_POINTER) {
- MONKEY_asprintf(&(cntxt->debug_report),
- "Bug detected in
file:%s\nfunction:%s\nline:%d\nreason:%s\nreceived signal:%s\n%s\n Details:\n
Expression:%s is NULL\n",
- cntxt->gdb_frames->file,
- cntxt->gdb_frames->func,
- cntxt->gdb_frames->line,
- mi_reason_enum_to_str(cntxt->gdb_stop_reason->
- reason),
- cntxt->gdb_stop_reason->signal_name,
- cntxt->gdb_stop_reason->signal_meaning,
- cntxt->gdb_null_variable);
- } else if (NULL == cntxt->inspect_expression) {
- const char *expToString =
- expressionListToString(expressionListHead);
+//int MONKEY_ACTION_format_report(struct MONKEY_ACTION_Context
+// *cntxt)
+//{
+// switch (cntxt->debug_mode) {
+// case DEBUG_MODE_GDB:
+// if (cntxt->bug_detected == BUG_NULL_POINTER) {
+// MONKEY_asprintf(&(cntxt->debug_report),
+// "Bug detected in
file:%s\nfunction:%s\nline:%d\nreason:%s\nreceived signal:%s\n%s\n Details:\n
Expression:%s is NULL\n",
+// cntxt->gdb_frames->file,
+// cntxt->gdb_frames->func,
+// cntxt->gdb_frames->line,
+// mi_reason_enum_to_str(cntxt->gdb_stop_reason->
+// reason),
+// cntxt->gdb_stop_reason->signal_name,
+// cntxt->gdb_stop_reason->signal_meaning,
+// cntxt->gdb_null_variable);
+// } else if (NULL == cntxt->inspect_expression) {
+// const char *expToString =
+// expressionListToString(expressionListHead);
+//
+// if (cntxt->bug_detected == BUG_ARITHMETIC) {
+// MONKEY_asprintf(&(cntxt->debug_report),
+// "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nArithmetic
Exception: Division by Zero suspected\nExpression evaluation:\n%s\n",
+// cntxt->gdb_frames->file,
+// cntxt->gdb_frames->func,
+// cntxt->gdb_frames->line,
+// cntxt->gdb_stop_reason->signal_name,
+// cntxt->gdb_stop_reason->signal_meaning,
+// expToString);
+// } else if (cntxt->bug_detected == BUG_ABORT) {
+// /* Assertion Failure */
+// MONKEY_asprintf(&(cntxt->debug_report),
+// "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nAssertion
Failure\nExpression evaluation:\n%s\n",
+// cntxt->gdb_frames->file,
+// cntxt->gdb_frames->func,
+// cntxt->gdb_frames->line,
+// cntxt->gdb_stop_reason->signal_name,
+// cntxt->gdb_stop_reason->signal_meaning,
+// expToString);
+// }
+// } else {
+// /* Inspection of user-defined expression */
+// /*
+// MONKEY_asprintf(&(cntxt->debug_report),
+// "Inspection of expression: %s in function: %s, file:%s\nHit
Number: \t \tValue:\n%s",
+// cntxt->inspect_expression, cntxt->inspect_function,
cntxt->binary_name, watchInfoListToString(watchInfoListHead));
+// */
+// }
+// break;
+// case DEBUG_MODE_VALGRIND:
+// MONKEY_asprintf(&(cntxt->debug_report),
+// "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\n Details:\n Memory Check
from Valgrind:\n%s",
+// cntxt->gdb_frames->file, cntxt->gdb_frames->func,
+// cntxt->gdb_frames->line,
+// cntxt->gdb_stop_reason->signal_name,
+// cntxt->gdb_stop_reason->signal_meaning,
+// getValgrindOutput(cntxt));
+// break;
+// default:
+// break;
+// }
+//
+// cntxt->debug_mode = DEBUG_MODE_REPORT_READY;
+// return MONKEY_OK;
+//}
- if (cntxt->bug_detected == BUG_ARITHMETIC) {
- MONKEY_asprintf(&(cntxt->debug_report),
- "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nArithmetic
Exception: Division by Zero suspected\nExpression evaluation:\n%s\n",
- cntxt->gdb_frames->file,
- cntxt->gdb_frames->func,
- cntxt->gdb_frames->line,
- cntxt->gdb_stop_reason->signal_name,
- cntxt->gdb_stop_reason->signal_meaning,
- expToString);
- } else if (cntxt->bug_detected == BUG_ABORT) {
- /* Assertion Failure */
- MONKEY_asprintf(&(cntxt->debug_report),
- "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nAssertion
Failure\nExpression evaluation:\n%s\n",
- cntxt->gdb_frames->file,
- cntxt->gdb_frames->func,
- cntxt->gdb_frames->line,
- cntxt->gdb_stop_reason->signal_name,
- cntxt->gdb_stop_reason->signal_meaning,
- expToString);
- }
- } else {
- /* Inspection of user-defined expression */
- /*
- MONKEY_asprintf(&(cntxt->debug_report),
- "Inspection of expression: %s in function: %s, file:%s\nHit
Number: \t \tValue:\n%s",
- cntxt->inspect_expression, cntxt->inspect_function,
cntxt->binary_name, watchInfoListToString(watchInfoListHead));
- */
- }
- break;
- case DEBUG_MODE_VALGRIND:
- MONKEY_asprintf(&(cntxt->debug_report),
- "Bug detected in
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\n Details:\n Memory Check
from Valgrind:\n%s",
- cntxt->gdb_frames->file, cntxt->gdb_frames->func,
- cntxt->gdb_frames->line,
- cntxt->gdb_stop_reason->signal_name,
- cntxt->gdb_stop_reason->signal_meaning,
- getValgrindOutput(cntxt));
- break;
- default:
- break;
- }
-
- cntxt->debug_mode = DEBUG_MODE_REPORT_READY;
- return MONKEY_OK;
-}
-
-
int MONKEY_ACTION_delete_context(struct MONKEY_ACTION_Context
*cntxt)
{
Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey.c
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey.c
2012-05-14 13:45:34 UTC (rev 21477)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey.c
2012-05-14 14:18:40 UTC (rev 21478)
@@ -34,7 +34,7 @@
static char *mode = NULL;
static char *dumpFileName = NULL;
static char *binaryName = NULL;
-static const char *binaryArgs = NULL;
+static char *binaryArgs = NULL;
static char *emailAddress = NULL;
static char *edbFilePath = NULL;
static char *gdbBinaryPath = NULL;
@@ -242,7 +242,7 @@
}
-const char * buildBinaryArgs(int argc, const char **argv) {
+const char * buildBinaryArgs(int argc, char **argv) {
char * res = MONKEY_strdup("");
char * tmp;
int i;
@@ -280,7 +280,8 @@
binaryName = MONKEY_strdup(argv[++i]);
checkRequiredArgs();
/* All remaining args are considered program arguments
*/
- binaryArgs = buildBinaryArgs(argc - (i + 1),
&argv[++i]);
+ i++;
+ binaryArgs = buildBinaryArgs(argc - i, &argv[i]);
break;
}
else if (strcmp("-d", argv[i]) == 0) {
Modified: monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_action.h
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_action.h
2012-05-14 13:45:34 UTC (rev 21477)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/monkey_action.h
2012-05-14 14:18:40 UTC (rev 21478)
@@ -38,7 +38,7 @@
struct MONKEY_ACTION_Context
{
const char *binary_name;
- const char *binaryArgs;
+ char *binaryArgs;
const char *email_address;
const char *expression_database_path;
const char *gdb_binary_path;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21478 - monkey/branches/MonkeyBacktracking/monkey/src/monkey,
gnunet <=