- Added '--extend-nonreads' switch. It is totally untested, and I hope

Gijs will have a look at it and tell me whether it actually works.
This commit is contained in:
ccremers 2005-06-21 11:04:34 +00:00
parent b6e9841c0f
commit 464920907b
3 changed files with 52 additions and 4 deletions

View File

@ -73,9 +73,11 @@ switchesInit (int argc, char **argv)
switches.reportClaims = 0; // default don't report on claims
switches.xml = 0; // default no xml output
switches.human = false; // not human friendly by default
switches.reportMemory;
switches.reportTime;
switches.reportStates;
switches.reportMemory = 0;
switches.reportTime = 0;
switches.reportStates = 0;
switches.extendNonReads = 0; // default off
// Obsolete
switches.latex = 0; // latex output?
@ -449,6 +451,20 @@ switcher (const int process, int index)
}
}
if (detect (' ', "extend-nonreads", 0))
{
if (!process)
{
/* discourage: hide
*/
}
else
{
switches.extendNonReads = 1;
return index;
}
}
/* ==================
* External options
*/

View File

@ -55,6 +55,8 @@ struct switchdata
int reportMemory; //!< Memory display switch.
int reportTime; //!< Time display switch.
int reportStates; //!< Progress display switch. (traversed states)
int extendNonReads; //!< Show further events in arachne xml output.
//! Latex output switch.
/**
* Obsolete. Use globalLatex instead.

View File

@ -711,9 +711,36 @@ xmlOutRuns (const System sys)
Roledef rd;
int index;
//! Test whether to display this event
/**
* Could be integrated into a single line on the while loop,
* but that makes it rather hard to understand.
*/
int showthis (void)
{
if (rd != NULL)
{
if (index < sys->runs[run].step)
{
return true;
}
else
{
if (switches.extendNonReads)
{
if (rd->type != READ)
{
return true;
}
}
}
}
return false;
}
index = 0;
rd = sys->runs[run].start;
while (rd != NULL && index < sys->runs[run].step)
while (showthis ())
{
xmlOutEvent (sys, rd, run, index);
index++;
@ -752,6 +779,9 @@ xmlOutSemitrace (const System sys)
xmlIndentPrint ();
printf ("<attack");
/* add trace length attribute */
/* Note that this is the length of the attack leading up to the broken
* claim, thus without any run extensions (--extend-nonreads).
*/
printf (" tracelength=\"%i\"", get_semitrace_length ());
/* add attack id attribute (within this scyther call) */
printf (" id=\"%i\"", sys->attackid);