Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
ffevotte committed May 19, 2017
2 parents b17d5f3 + 9c5ad17 commit 519dd9a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ This version is based on Valgrind-3.12.0.
- Continuous integration using the Travis system.
- Improve Delta-Debugging customization through environment variables.

### Changed

- There is no need anymore for an external, statically compiled libc/libm.


---

## v0.9.0 - 2017-03-31

Expand Down
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CXXFLAGS = \
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@)
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) \
-lm -lc
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@)
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
verrou_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LINK = \
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ Build and install:
make install


### Load the environment

In order to actually use Verrou, you must load the correct environment. This can
be done using:

source PREFIX/env.sh


### Test (optional)

#### General tests
Expand Down
12 changes: 6 additions & 6 deletions verrou_dd
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def runCmd(cmd, fname, envvars=None):
if envvars is None:
envvars = {}

with open("%s.out"%fname, "w") as fout, \
open("%s.err"%fname, "w") as ferr:
env = copy.deepcopy(os.environ)
for var in envvars:
env[var] = envvars[var]
return subprocess.call(cmd, env=env, stdout=fout, stderr=ferr)
with open("%s.out"%fname, "w") as fout:
with open("%s.err"%fname, "w") as ferr:
env = copy.deepcopy(os.environ)
for var in envvars:
env[var] = envvars[var]
return subprocess.call(cmd, env=env, stdout=fout, stderr=ferr)

def prepareOutput(dirname):
shutil.rmtree(dirname, ignore_errors=True)
Expand Down
20 changes: 16 additions & 4 deletions vr_fpRepr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,19 @@ inline REALTYPE nextAfter(REALTYPE a){

template<>
inline double nextAfter<double>(double a){
return nextafter(a,DBL_MAX );
double res=a;
__uint64_t* resU=reinterpret_cast<__uint64_t*>(&res);
(*resU)+=1;
return res;
};


template<>
inline float nextAfter<float>(float a){
return nextafterf(a,FLT_MAX );
float res=a;
__uint32_t* resU=reinterpret_cast<__uint32_t*>(&res);
(*resU)+=1;
return res;
};


Expand All @@ -226,11 +232,17 @@ inline REALTYPE nextPrev(REALTYPE a){

template<>
inline double nextPrev<double>(double a){
return nextafter(a,-DBL_MAX );
double res=a;
__uint64_t* resU=reinterpret_cast<__uint64_t*>(&res);
(*resU)-=1;
return res;
};


template<>
inline float nextPrev<float>(float a){
return nextafterf(a,-FLT_MAX );
float res=a;
__uint32_t* resU=reinterpret_cast<__uint32_t*>(&res);
(*resU)-=1;
return res;
};
11 changes: 8 additions & 3 deletions vr_rand.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#pragma once

extern "C" {
#include "pub_tool_libcproc.h"
}

class vrRand{
public:
Expand All @@ -49,7 +52,9 @@ public:
};

inline void setTimeSeed(unsigned int pid){
unsigned int seed=time(NULL) + pid;
struct vki_timeval now;
VG_(gettimeofday)(&now, NULL);
unsigned int seed = now.tv_usec + pid;
VG_(umsg)("First seed : %u\n",seed);
setSeed(seed);
};
Expand Down Expand Up @@ -90,13 +95,13 @@ private:
// srand(c);
vr_next_=c;
}

inline int privaterand(){
// rand();
vr_next_ = vr_next_ * 1103515245 + 12345;
return (unsigned int)(vr_next_/65536) % 32768;
}

inline int privateRAND_MAX()const{
// return RAND_MAX;
return 32767;
Expand Down

0 comments on commit 519dd9a

Please sign in to comment.