klee
klee-replay.c File Reference
#include "klee-replay.h"
#include "klee/ADT/KTest.h"
#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <sys/signal.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)
 
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_posix_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 []
 
int keep_temps = 0
 

Function Documentation

◆ __emit_error()

static void __emit_error ( const char *  msg)
static

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

Referenced by klee_make_symbolic(), and klee_report_error().

Here is the caller graph for this function:

◆ __fgetc_unlocked()

int __fgetc_unlocked ( FILE *  f)

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

◆ __fputc_unlocked()

int __fputc_unlocked ( int  c,
FILE *  f 
)

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

◆ int_handler()

static void int_handler ( int  signal)
static

Definition at line 108 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:

◆ klee_assume()

unsigned klee_assume ( uintptr_t  x)

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

◆ klee_get_errno()

int klee_get_errno ( void  )

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

◆ klee_is_symbolic()

unsigned klee_is_symbolic ( uintptr_t  x)

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

◆ klee_make_symbolic()

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

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

References __emit_error(), KTestObject::bytes, input, 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:

◆ klee_mark_global()

void klee_mark_global ( void *  object)

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

◆ klee_posix_prefer_cex()

void klee_posix_prefer_cex ( void *  buffer,
uintptr_t  condition 
)

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

◆ klee_prefer_cex()

void klee_prefer_cex ( void *  buffer,
uintptr_t  condition 
)

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

◆ klee_range()

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

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

References klee_make_symbolic().

Here is the call graph for this function:

◆ klee_report_error()

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

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

References __emit_error(), and message.

Here is the call graph for this function:

◆ klee_warning()

void klee_warning ( char *  name)

◆ klee_warning_once()

void klee_warning_once ( char *  name)

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

Referenced by externalsAndGlobalsCheck().

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

◆ process_status()

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

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

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

Here is the caller graph for this function:

◆ run_monitored()

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

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

References int_handler(), monitored_pid, monitored_timeout, process_status(), replay_dir, 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:

◆ stop_monitored()

static void stop_monitored ( int  process)
static

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

Referenced by int_handler(), and timeout_handler().

Here is the caller graph for this function:

◆ strip_root_dir()

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

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

References rootdir.

Referenced by run_monitored().

Here is the caller graph for this function:

◆ timeout_handler()

static void timeout_handler ( int  signal)
static

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

References monitored_pid, monitored_timeout, and stop_monitored().

Referenced by run_monitored().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

static void usage ( void  )
static

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

References progname.

Referenced by klee::time::getUserTime(), and main().

Here is the caller graph for this function:

Variable Documentation

◆ input

KTest* input
static

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

Referenced by klee_make_symbolic(), main(), and CexData::propogatePossibleValues().

◆ keep_temps

int keep_temps = 0

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

Referenced by main(), and replay_delete_files().

◆ long_options

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'},
{"keep-replay-dir", no_argument, 0, 'k'},
{0, 0, 0, 0},
}

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

Referenced by main().

◆ monitored_pid

unsigned monitored_pid = 0
static

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

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

◆ monitored_timeout

unsigned monitored_timeout
static

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

Referenced by run_monitored(), and timeout_handler().

◆ obj_index

unsigned obj_index
static

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

Referenced by klee_make_symbolic(), and main().

◆ progname

const char* progname = 0
static

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

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

◆ rootdir

char* rootdir = NULL
static

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

Referenced by main(), run_monitored(), and strip_root_dir().