klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
klee-replay.c File Reference
#include "klee-replay.h"
#include "klee/Internal/ADT/KTest.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <getopt.h>
#include <errno.h>
#include <time.h>
#include <unistd.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <sys/capability.h>
Include dependency graph for klee-replay.c:

Go to the source code of this file.

Functions

static void __emit_error (const char *msg)
 
static void stop_monitored (int process)
 
static void int_handler (int signal)
 
static void timeout_handler (int signal)
 
void process_status (int status, time_t elapsed, const char *pfx)
 
static char * strip_root_dir (char *executable, char *rootdir)
 
static void run_monitored (char *executable, int argc, char **argv)
 
void ensure_capsyschroot (const char *executable)
 
static void usage (void)
 
int main (int argc, char **argv)
 
int __fputc_unlocked (int c, FILE *f)
 
int __fgetc_unlocked (FILE *f)
 
int klee_get_errno ()
 
void klee_warning (char *name)
 
void klee_warning_once (char *name)
 
unsigned klee_assume (uintptr_t x)
 
unsigned klee_is_symbolic (uintptr_t x)
 
void klee_prefer_cex (void *buffer, uintptr_t condition)
 
void klee_make_symbolic (void *addr, size_t nbytes, const char *name)
 
int klee_range (int start, int end, const char *name)
 
void klee_report_error (const char *file, int line, const char *message, const char *suffix)
 
void klee_mark_global (void *object)
 

Variables

static KTestinput
 
static unsigned obj_index
 
static const char * progname = 0
 
static unsigned monitored_pid = 0
 
static unsigned monitored_timeout
 
static char * rootdir = NULL
 
static struct option long_options []
 

Function Documentation

static void __emit_error ( const char *  msg)
static

Definition at line 477 of file klee-replay.c.

Referenced by klee_make_symbolic(), and klee_report_error().

Here is the caller graph for this function:

int __fgetc_unlocked ( FILE *  f)

Definition at line 382 of file klee-replay.c.

int __fputc_unlocked ( int  c,
FILE *  f 
)

Definition at line 378 of file klee-replay.c.

void ensure_capsyschroot ( const char *  executable)

Definition at line 225 of file klee-replay.c.

Referenced by main().

Here is the caller graph for this function:

static void int_handler ( int  signal)
static

Definition at line 91 of file klee-replay.c.

References monitored_pid, progname, and stop_monitored().

Referenced by run_monitored().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned klee_assume ( uintptr_t  x)

Definition at line 398 of file klee-replay.c.

int klee_get_errno ( )

Definition at line 386 of file klee-replay.c.

unsigned klee_is_symbolic ( uintptr_t  x)

Definition at line 405 of file klee-replay.c.

void klee_make_symbolic ( void *  addr,
size_t  nbytes,
const char *  name 
)

klee_make_symbolic - Make the contents of the object pointer to by

  • addr symbolic.
  • addr - The start of the object.
  • nbytes - The number of bytes to make symbolic; currently this must be the entire contents of the object.
  • name - An optional name, used for identifying the object in messages, output files, etc.

Definition at line 413 of file klee-replay.c.

References __emit_error(), KTestObject::bytes, KTestObject::name, KTestObject::numBytes, KTest::numObjects, obj_index, and KTest::objects.

Referenced by klee_range().

Here is the call graph for this function:

Here is the caller graph for this function:

void klee_mark_global ( void *  object)

Definition at line 471 of file klee-replay.c.

void klee_prefer_cex ( void *  buffer,
uintptr_t  condition 
)

Definition at line 409 of file klee-replay.c.

int klee_range ( int  begin,
int  end,
const char *  name 
)

klee_range - Construct a symbolic value in the signed interval [begin,end).

  • name - An optional name, used for identifying the object in messages, output files, etc.

Definition at line 443 of file klee-replay.c.

References klee_make_symbolic().

Here is the call graph for this function:

void klee_report_error ( const char *  file,
int  line,
const char *  message,
const char *  suffix 
)

Definition at line 466 of file klee-replay.c.

References __emit_error().

Here is the call graph for this function:

void klee_warning ( char *  name)

Definition at line 390 of file klee-replay.c.

Referenced by externalsAndGlobalsCheck(), KleeHandler::KleeHandler(), KleeHandler::processTestCase(), and klee::Executor::processTimers().

Here is the caller graph for this function:

void klee_warning_once ( char *  name)

Definition at line 394 of file klee-replay.c.

Referenced by externalsAndGlobalsCheck().

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 252 of file klee-replay.c.

References KTest::args, ensure_capsyschroot(), kTest_fromFile(), long_options, KTest::numArgs, obj_index, progname, replay_create_files(), rootdir, run_monitored(), and usage().

Here is the call graph for this function:

void process_status ( int  status,
time_t  elapsed,
const char *  pfx 
)

Definition at line 118 of file klee-replay.c.

References progname.

Referenced by create_char_dev(), create_pipe(), and run_monitored().

Here is the caller graph for this function:

static void run_monitored ( char *  executable,
int  argc,
char **  argv 
)
static

Definition at line 150 of file klee-replay.c.

References int_handler(), monitored_pid, monitored_timeout, process_status(), rootdir, strip_root_dir(), and timeout_handler().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void stop_monitored ( int  process)
static

Definition at line 45 of file klee-replay.c.

Referenced by int_handler(), and timeout_handler().

Here is the caller graph for this function:

static char* strip_root_dir ( char *  executable,
char *  rootdir 
)
inlinestatic

Definition at line 146 of file klee-replay.c.

Referenced by run_monitored().

Here is the caller graph for this function:

static void timeout_handler ( int  signal)
static

Definition at line 104 of file klee-replay.c.

References monitored_pid, monitored_timeout, progname, and stop_monitored().

Referenced by run_monitored().

Here is the call graph for this function:

Here is the caller graph for this function:

static void usage ( void  )
static

Definition at line 241 of file klee-replay.c.

References progname.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

KTest* input
static

Definition at line 30 of file klee-replay.c.

Referenced by CexData::propogatePossibleValues().

struct option long_options[]
static
Initial value:
= {
{"create-files-only", required_argument, 0, 'f'},
{"chroot-to-dir", required_argument, 0, 'r'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0},
}

Definition at line 38 of file klee-replay.c.

Referenced by main().

unsigned monitored_pid = 0
static

Definition at line 34 of file klee-replay.c.

Referenced by int_handler(), run_monitored(), and timeout_handler().

unsigned monitored_timeout
static

Definition at line 35 of file klee-replay.c.

Referenced by run_monitored(), and timeout_handler().

unsigned obj_index
static

Definition at line 31 of file klee-replay.c.

Referenced by klee_make_symbolic(), and main().

const char* progname = 0
static

Definition at line 33 of file klee-replay.c.

Referenced by int_handler(), main(), process_status(), timeout_handler(), and usage().

char* rootdir = NULL
static

Definition at line 37 of file klee-replay.c.

Referenced by main(), and run_monitored().