|
From: Nicholas N. <nj...@ca...> - 2004-02-10 23:44:36
|
CVS commit by nethercote:
Added support for epoll.
M +50 -1 coregrind/vg_syscalls.c 1.83
M +0 -1 coregrind/vg_unsafe.h 1.24
M +13 -0 include/vg_kerneliface.h 1.13
--- valgrind/coregrind/vg_syscalls.c #1.82:1.83
@@ -2129,5 +2129,5 @@ POST(fcntl)
{
if (arg2 == VKI_F_DUPFD)
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(resolve_filename)(res));
}
@@ -3946,4 +3946,50 @@ POST(poll)
}
+PRE(epoll_create)
+{
+ /* int epoll_create(int size) */
+ MAYBE_PRINTF("epoll_create ( %d )\n", arg1);
+}
+
+POST(epoll_create)
+{
+ if (!fd_allowed(res, "open", tid)) {
+ VG_(close)(res);
+ res = -VKI_EMFILE;
+ } else {
+ if (VG_(clo_track_fds))
+ record_fd_open (tid, res, NULL);
+ }
+}
+
+PRE(epoll_ctl)
+{
+ /* int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) */
+ static const char* epoll_ctl_s[3] = {
+ "EPOLL_CTL_ADD",
+ "EPOLL_CTL_DEL",
+ "EPOLL_CTL_MOD"
+ };
+ MAYBE_PRINTF("epoll_ctl ( %d, %s, %d, %p )\n",
+ arg1, ( arg2<3 ? epoll_ctl_s[arg2] : "?" ), arg3, arg4);
+ SYSCALL_TRACK( pre_mem_read, tid, "epoll_ctl(event)",
+ arg4, sizeof(struct vki_epoll_event) );
+}
+
+PRE(epoll_wait)
+{
+ /* int epoll_wait(int epfd, struct epoll_event * events,
+ int maxevents, int timeout) */
+ MAYBE_PRINTF("epoll_wait ( %d, %p, %d, %d )\n", arg1, arg2, arg3, arg4);
+ SYSCALL_TRACK( pre_mem_write, tid, "epoll_wait(events)",
+ arg2, sizeof(struct vki_epoll_event)*arg3);
+}
+
+POST(epoll_wait)
+{
+ if (res > 0)
+ VG_TRACK( post_mem_write, arg2, sizeof(struct vki_epoll_event)*res ) ;
+}
+
PRE(readlink)
{
@@ -5202,4 +5248,7 @@ static const struct sys_info sys_info[]
SYSBA(pipe, False),
SYSBA(poll, True),
+ SYSBA(epoll_create, False),
+ SYSB_(epoll_ctl, False),
+ SYSBA(epoll_wait, True),
SYSBA(readlink, False),
SYSBA(readv, True),
--- valgrind/include/vg_kerneliface.h #1.12:1.13
@@ -510,4 +510,17 @@ struct vki_pollfd {
+/* sys/epoll.h */
+typedef union vki_epoll_data {
+ void *ptr;
+ Int fd;
+ UInt u32;
+ ULong u64;
+} vki_epoll_data_t;
+
+struct vki_epoll_event {
+ UInt events; /* Epoll events */
+ vki_epoll_data_t data; /* User data variable */
+};
+
/*
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-12 14:35:37
|
CVS commit by nethercote:
Now doing pre_mem_read()s on the args to execve(), so eg. Memcheck can check
them. Added a regtest for this.
A memcheck/tests/execve.c 1.1 [no copyright]
A memcheck/tests/execve.stderr.exp 1.1
A memcheck/tests/execve.vgtest 1.1
M +17 -2 coregrind/vg_syscalls.c 1.84
M +4 -1 memcheck/tests/Makefile.am 1.31
--- valgrind/coregrind/vg_syscalls.c #1.83:1.84
@@ -1811,4 +1811,16 @@ PRE(capset)
}
+// Pre_read a char** argument.
+void pre_argv_envp(Addr a, ThreadId tid, Char* s1, Char* s2)
+{
+ while (True) {
+ Addr a_deref = deref_Addr( tid, a, s1 );
+ if (0 == a_deref)
+ break;
+ SYSCALL_TRACK( pre_mem_read_asciiz, tid, s2, a_deref );
+ a += sizeof(char*);
+ }
+}
+
PRE(execve)
{
@@ -1816,6 +1828,9 @@ PRE(execve)
char *const argv [],
char *const envp[]); */
- MAYBE_PRINTF("execve ( %p(%s), %p, %p ) --- NOT CHECKED\n",
- arg1, arg1, arg2, arg3);
+ MAYBE_PRINTF("execve ( %p(%s), %p, %p )\n", arg1, arg1, arg2, arg3);
+
+ SYSCALL_TRACK( pre_mem_read_asciiz, tid, "execve(filename)", arg1 );
+ pre_argv_envp( arg2, tid, "execve(argv)", "execve(argv[i])" );
+ pre_argv_envp( arg3, tid, "execve(envp)", "execve(envp[i])" );
/* Erk. If the exec fails, then the following will have made a
--- valgrind/memcheck/tests/Makefile.am #1.30:1.31
@@ -25,4 +25,5 @@
errs1.stderr.exp errs1.vgtest \
exitprog.stderr.exp exitprog.vgtest \
+ execve.stderr.exp execve.vgtest \
fprw.stderr.exp fprw.vgtest \
fwrite.stderr.exp fwrite.stdout.exp fwrite.vgtest \
@@ -69,5 +70,6 @@
badaddrvalue badfree badjump badloop badrw brk buflen_check \
clientperm custom_alloc \
- doublefree error_counts errs1 exitprog fprw fwrite inits inline \
+ doublefree error_counts errs1 exitprog execve \
+ fprw fwrite inits inline \
malloc1 malloc2 malloc3 manuel1 manuel2 manuel3 \
memalign_test memcmptest mmaptest nanoleak new_nothrow null_socket \
@@ -94,4 +96,5 @@
error_counts_SOURCES = error_counts.c
errs1_SOURCES = errs1.c
+execve_SOURCES = execve.c
exitprog_SOURCES = exitprog.c
fprw_SOURCES = fprw.c
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-15 15:36:02
|
CVS commit by nethercote:
This patch fixes getrlimit(RLIMIT_FILENO) to return VG_(max_fd) as the soft
limit for file descriptors to try and prevent the target programming realising
that the reserved file descriptors exist. It also appears to fix
sysconf(_SC_OPEN_MAX) so that must be going through the same system call.
M +3 -0 coregrind/vg_syscalls.c 1.86
M +3 -1 none/tests/Makefile.am 1.25
--- valgrind/coregrind/vg_syscalls.c #1.85:1.86
@@ -2488,4 +2488,7 @@ POST(getrlimit)
if (res == 0)
VG_TRACK( post_mem_write, arg2, sizeof(struct rlimit) );
+
+ if (res == 0 && arg1 == VKI_RLIMIT_NOFILE)
+ ((struct rlimit *)arg2)->rlim_cur = VG_(max_fd);
}
--- valgrind/none/tests/Makefile.am #1.24:1.25
@@ -8,4 +8,5 @@
bt_literal.stderr.exp bt_literal.stdout.exp \
bt_literal.vgtest \
+ closeall.stderr.exp closeall.vgtest \
coolo_sigaction.stderr.exp \
coolo_sigaction.stdout.exp coolo_sigaction.vgtest \
@@ -53,5 +54,5 @@
check_PROGRAMS = \
- args bitfield1 bt_everything bt_literal coolo_strlen \
+ args bitfield1 bt_everything bt_literal closeall coolo_strlen \
cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
fucomip insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2 \
@@ -70,4 +71,5 @@
bt_everything_SOURCES = bt_everything.c
bt_literal_SOURCES = bt_literal.c
+closeall_SOURCES = closeall.c
cpuid_SOURCES = cpuid_c.c cpuid_s.s
coolo_strlen_SOURCES = coolo_strlen.c
|
|
From: Tom H. <th...@cy...> - 2004-02-15 16:11:03
|
In message <200...@of...>
Nicholas Nethercote <nj...@ca...> wrote:
> CVS commit by nethercote:
>
> This patch fixes getrlimit(RLIMIT_FILENO) to return VG_(max_fd) as the soft
> limit for file descriptors to try and prevent the target programming realising
> that the reserved file descriptors exist. It also appears to fix
> sysconf(_SC_OPEN_MAX) so that must be going through the same system call.
>
>
> M +3 -0 coregrind/vg_syscalls.c 1.86
> M +3 -1 none/tests/Makefile.am 1.25
Looks like you forgot the new files for the tests again ;-)
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-15 16:16:10
|
On Sun, 15 Feb 2004, Tom Hughes wrote: > Looks like you forgot the new files for the tests again ;-) Just checking you were paying attention... good stuff N |
|
From: Dirk M. <dm...@gm...> - 2004-02-15 17:17:26
|
On Sunday 15 February 2004 17:13, Nicholas Nethercote wrote: > Just checking you were paying attention... good stuff just for your information, those lines with question marks in front of them when you type cvs update (or cvscheck), they tell you which files are unknown to the CVS server - so that you can add them to CVS or to .cvsignore. |
|
From: Nicholas N. <nj...@ca...> - 2004-02-22 19:42:32
|
CVS commit by nethercote: Update and add various .cvsignore files. A massif/.cvsignore 1.1 A massif/docs/.cvsignore 1.1 A massif/hp2ps/.cvsignore 1.1 A massif/tests/.cvsignore 1.1 M +1 -0 memcheck/tests/.cvsignore 1.9 M +18 -0 none/tests/.cvsignore 1.9 M +1 -0 tests/.cvsignore 1.4 --- valgrind/memcheck/tests/.cvsignore #1.8:1.9 @@ -13,4 +13,5 @@ error_counts errs1 +execve exitprog filter_leak_check_size --- valgrind/none/tests/.cvsignore #1.8:1.9 @@ -5,4 +5,5 @@ bt_everything bt_literal +closeall coolo_sigaction coolo_strlen @@ -10,4 +11,5 @@ dastest discard +exec-sigmask floored fork @@ -15,4 +17,16 @@ fucomip gxx304 +insn_basic +insn_basic.c +insn_cmov +insn_cmov.c +insn_mmx +insn_mmx.c +insn_mmxext +insn_mmxext.c +insn_sse +insn_sse.c +insn_sse2 +insn_sse2.c map_unmap munmap_exe @@ -29,4 +43,7 @@ shorts smc1 +syscall-restart1 +syscall-restart2 +system pth_atfork1 pth_cancel1 @@ -44,3 +61,4 @@ *.stdout.out *.stderr.out +tls yield --- valgrind/tests/.cvsignore #1.3:1.4 @@ -1,4 +1,5 @@ Makefile.in Makefile +cputest vg_regtest true |
|
From: Nicholas N. <nj...@ca...> - 2004-02-23 16:18:20
|
CVS commit by nethercote:
Added various functions that make instrumentation easier, particularly
doing C calls.
M +185 -30 coregrind/vg_instrument.c 1.11
M +45 -6 include/vg_skin.h.base 1.14
--- valgrind/coregrind/vg_instrument.c #1.10:1.11
@@ -37,55 +37,209 @@
-void VG_(call_helper_0_0)(UCodeBlock* cb, Addr f)
+void VG_(lit_to_reg)(UCodeBlock* cb, UInt lit, UInt t)
{
- uInstr0(cb, CCALL, 0);
- uCCall(cb, f, 0, 0, 0);
+ uInstr2 (cb, MOV, 4, Literal, 0, TempReg, t);
+ uLiteral(cb, lit);
}
-void VG_(call_helper_1_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt regparms_n)
+UInt VG_(lit_to_newreg)(UCodeBlock* cb, UInt lit)
{
- UInt t1 = newTemp(cb);
+ UInt t = newTemp(cb);
+ uInstr2 (cb, MOV, 4, Literal, 0, TempReg, t);
+ uLiteral(cb, lit);
+ return t;
+}
+// f()
+void VG_(ccall_0_0)(UCodeBlock* cb, Addr f)
+{
+ uInstr0(cb, CCALL, 0);
+ uCCall(cb, f, 0, 0, /*retval*/False);
+}
+
+// f(reg)
+void VG_(ccall_R_0)(UCodeBlock* cb, Addr f, UInt t1, UInt regparms_n)
+{
sk_assert(regparms_n <= 1);
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
- uLiteral(cb, arg1);
uInstr1(cb, CCALL, 0, TempReg, t1);
- uCCall(cb, f, 1, regparms_n, 0);
+ uCCall(cb, f, 1, regparms_n, /*retval*/False);
}
-void VG_(call_helper_2_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt arg2,
+// f(lit)
+void VG_(ccall_L_0)(UCodeBlock* cb, Addr f, UInt lit1, UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ VG_(ccall_R_0)(cb, f, t1, regparms_n);
+}
+
+// reg = f(reg)
+void VG_(ccall_R_R)(UCodeBlock* cb, Addr f, UInt t1, UInt t_ret,
UInt regparms_n)
{
- UInt t1 = newTemp(cb);
- UInt t2 = newTemp(cb);
+ sk_assert(regparms_n <= 1);
+ sk_assert(t1 < VG_(get_num_temps)(cb)); // help catch lits accidentally passed in
+ uInstr3(cb, CCALL, 0, TempReg, t1, NoValue, 0, TempReg, t_ret);
+ uCCall(cb, f, 1, regparms_n, /*retval*/True);
+}
+// reg = f(lit)
+void VG_(ccall_L_R)(UCodeBlock* cb, Addr f, UInt lit1, UInt t_ret,
+ UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ VG_(ccall_R_R)(cb, f, t1, t_ret, regparms_n);
+}
+
+// f(reg, reg)
+void VG_(ccall_RR_0)(UCodeBlock* cb, Addr f, UInt t1, UInt t2, UInt regparms_n)
+{
sk_assert(regparms_n <= 2);
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
- uLiteral(cb, arg1);
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t2);
- uLiteral(cb, arg2);
+ sk_assert(t1 < VG_(get_num_temps)(cb));
+ sk_assert(t2 < VG_(get_num_temps)(cb));
uInstr2(cb, CCALL, 0, TempReg, t1, TempReg, t2);
- uCCall(cb, f, 2, regparms_n, 0);
+ uCCall(cb, f, 2, regparms_n, /*retval*/False);
}
-void VG_(set_global_var)(UCodeBlock* cb, Addr globvar_ptr, UInt val)
+// f(reg, lit)
+void VG_(ccall_RL_0)(UCodeBlock* cb, Addr f, UInt t1, UInt lit2,
+ UInt regparms_n)
{
- Int t_gv = newTemp(cb);
- Int t_val = newTemp(cb);
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ VG_(ccall_RR_0)(cb, f, t1, t2, regparms_n);
+}
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_val);
- uLiteral(cb, val);
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_gv);
- uLiteral(cb, globvar_ptr);
- uInstr2(cb, STORE, 4, TempReg, t_val, TempReg, t_gv);
+// f(lit, reg)
+void VG_(ccall_LR_0)(UCodeBlock* cb, Addr f, UInt lit1, UInt t2,
+ UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ VG_(ccall_RR_0)(cb, f, t1, t2, regparms_n);
}
-void VG_(set_global_var_tempreg)(UCodeBlock* cb, Addr globvar_ptr, UInt t_val)
+// f(lit, lit)
+void VG_(ccall_LL_0)(UCodeBlock* cb, Addr f, UInt lit1, UInt lit2,
+ UInt regparms_n)
{
- Int t_gv = newTemp(cb);
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ VG_(ccall_RR_0)(cb, f, t1, t2, regparms_n);
+}
- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_gv);
- uLiteral(cb, globvar_ptr);
- uInstr2(cb, STORE, 4, TempReg, t_val, TempReg, t_gv);
+// reg = f(reg, reg)
+void VG_(ccall_RR_R)(UCodeBlock* cb, Addr f, UInt t1, UInt t2, UInt t_ret,
+ UInt regparms_n)
+{
+ sk_assert(regparms_n <= 2);
+ sk_assert(t1 < VG_(get_num_temps)(cb));
+ sk_assert(t2 < VG_(get_num_temps)(cb));
+ uInstr3(cb, CCALL, 0, TempReg, t1, TempReg, t2, TempReg, t_ret);
+ uCCall(cb, f, 2, regparms_n, /*retval*/True);
+}
+
+// reg = f(reg, lit)
+void VG_(ccall_RL_R)(UCodeBlock* cb, Addr f, UInt t1, UInt lit2, UInt t_ret,
+ UInt regparms_n)
+{
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ VG_(ccall_RR_R)(cb, f, t1, t2, t_ret, regparms_n);
+}
+
+// reg = f(lit, reg)
+void VG_(ccall_LR_R)(UCodeBlock* cb, Addr f, UInt lit1, UInt t2, UInt t_ret,
+ UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ VG_(ccall_RR_R)(cb, f, t1, t2, t_ret, regparms_n);
+}
+
+// reg = f(lit, lit)
+void VG_(ccall_LL_R)(UCodeBlock* cb, Addr f, UInt lit1, UInt lit2, UInt t_ret,
+ UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit2);
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ VG_(ccall_RR_R)(cb, f, t1, t2, t_ret, regparms_n);
+}
+
+// f(reg, reg, reg)
+void VG_(ccall_RRR_0)(UCodeBlock* cb, Addr f, UInt t1, UInt t2,
+ UInt t3, UInt regparms_n)
+{
+ sk_assert(regparms_n <= 3);
+ sk_assert(t1 < VG_(get_num_temps)(cb));
+ sk_assert(t2 < VG_(get_num_temps)(cb));
+ sk_assert(t3 < VG_(get_num_temps)(cb));
+ uInstr3(cb, CCALL, 0, TempReg, t1, TempReg, t2, TempReg, t3);
+ uCCall(cb, f, 3, regparms_n, /*retval*/False);
+}
+
+// f(reg, lit, lit)
+void VG_(ccall_RLL_0)(UCodeBlock* cb, Addr f, UInt t1, UInt lit2,
+ UInt lit3, UInt regparms_n)
+{
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ UInt t3 = VG_(lit_to_newreg)(cb, lit3);
+ VG_(ccall_RRR_0)(cb, f, t1, t2, t3, regparms_n);
+}
+
+// f(lit, lit, reg)
+void VG_(ccall_LLR_0)(UCodeBlock* cb, Addr f, UInt lit1, UInt lit2,
+ UInt t3, UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ VG_(ccall_RRR_0)(cb, f, t1, t2, t3, regparms_n);
+}
+
+// f(lit, lit, lit)
+void VG_(ccall_LLL_0)(UCodeBlock* cb, Addr f, UInt lit1, UInt lit2,
+ UInt lit3, UInt regparms_n)
+{
+ UInt t1 = VG_(lit_to_newreg)(cb, lit1);
+ UInt t2 = VG_(lit_to_newreg)(cb, lit2);
+ UInt t3 = VG_(lit_to_newreg)(cb, lit3);
+ VG_(ccall_RRR_0)(cb, f, t1, t2, t3, regparms_n);
+}
+
+void VG_(reg_to_globvar)(UCodeBlock* cb, UInt t, UInt* globvar_ptr)
+{
+ Int t_gv = VG_(lit_to_newreg)(cb, (UInt)globvar_ptr);
+ uInstr2(cb, STORE, 4, TempReg, t, TempReg, t_gv);
+}
+
+void VG_(lit_to_globvar)(UCodeBlock* cb, UInt lit, UInt* globvar_ptr)
+{
+ Int t_lit = VG_(lit_to_newreg)(cb, lit);
+ VG_(reg_to_globvar)(cb, t_lit, globvar_ptr);
+}
+
+/*--------------------------------------------------------------------
+ Old versions of these functions, for backwards compatibility
+ --------------------------------------------------------------------*/
+
+void VG_(call_helper_0_0)(UCodeBlock* cb, Addr f)
+{
+ VG_(ccall_0_0)(cb, f);
+}
+
+void VG_(call_helper_1_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt regparms_n)
+{
+ VG_(ccall_L_0)(cb, f, arg1, regparms_n);
+}
+
+void VG_(call_helper_2_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt arg2,
+ UInt regparms_n)
+{
+ VG_(ccall_LL_0)(cb, f, arg1, arg2, regparms_n);
+}
+
+void VG_(set_global_var)(UCodeBlock* cb, Addr globvar_ptr, UInt val)
+{
+ VG_(lit_to_globvar)(cb, val, (UInt*)globvar_ptr);
+}
+
+void VG_(set_global_var_tempreg)(UCodeBlock* cb, Addr globvar_ptr, UInt t_val)
+{
+ VG_(reg_to_globvar)(cb, t_val, (UInt*)globvar_ptr);
}
--- valgrind/include/vg_skin.h.base #1.13:1.14
@@ -846,5 +846,5 @@
up to three arguments (or two if the functions has a return value).
Arguments and return value must be word-sized. More arguments can
- be faked with global variables (eg. use VG_(set_global_var)()).
+ be faked with global variables (eg. use VG_(lit_to_globvar)()).
Seven possibilities: 'arg[123]' show where args go, 'ret' shows
@@ -1117,4 +1117,48 @@
/* ------------------------------------------------------------------ */
/* Higher-level UInstr sequence builders */
+
+extern void VG_(lit_to_reg) ( UCodeBlock* cb, UInt lit, UInt t );
+extern UInt VG_(lit_to_newreg) ( UCodeBlock* cb, UInt lit );
+
+#define CB_F UCodeBlock* cb, Addr f
+#define EV extern void
+#define RPn UInt regparms_n
+
+/* Various CCALL builders, of the form "ccall_<args>_<retval>". 'R'
+ represents a TempReg, 'L' represents a literal, '0' represents nothing
+ (ie. no args, or no return value). */
+
+EV VG_(ccall_0_0) ( CB_F );
+
+EV VG_(ccall_R_0) ( CB_F, UInt r1, RPn );
+EV VG_(ccall_L_0) ( CB_F, UInt r1, RPn );
+EV VG_(ccall_R_R) ( CB_F, UInt r1, UInt r_ret, RPn );
+EV VG_(ccall_L_R) ( CB_F, UInt r1, UInt r_ret, RPn );
+
+EV VG_(ccall_RR_0) ( CB_F, UInt r1, UInt r2, RPn );
+EV VG_(ccall_RL_0) ( CB_F, UInt r1, UInt r2, RPn );
+EV VG_(ccall_LR_0) ( CB_F, UInt r1, UInt r2, RPn );
+EV VG_(ccall_LL_0) ( CB_F, UInt r1, UInt r2, RPn );
+EV VG_(ccall_RR_R) ( CB_F, UInt r1, UInt r2, UInt r_ret, RPn );
+EV VG_(ccall_RL_R) ( CB_F, UInt r1, UInt r2, UInt r_ret, RPn );
+EV VG_(ccall_LR_R) ( CB_F, UInt r1, UInt r2, UInt r_ret, RPn );
+EV VG_(ccall_LL_R) ( CB_F, UInt r1, UInt r2, UInt r_ret, RPn );
+
+EV VG_(ccall_RRR_0) ( CB_F, UInt r1, UInt r2, UInt r3, RPn );
+EV VG_(ccall_RLL_0) ( CB_F, UInt r1, UInt r2, UInt r3, RPn );
+EV VG_(ccall_LLR_0) ( CB_F, UInt r1, UInt r2, UInt r3, RPn );
+EV VG_(ccall_LLL_0) ( CB_F, UInt r1, UInt r2, UInt r3, RPn );
+
+#undef CB_F
+#undef EV
+#undef RPn
+
+/* One way around the 3-arg C function limit is to pass args via global
+ * variables... ugly, but it works. */
+void VG_(reg_to_globvar)(UCodeBlock* cb, UInt t, UInt* globvar_ptr);
+void VG_(lit_to_globvar)(UCodeBlock* cb, UInt lit, UInt* globvar_ptr);
+
+
+/* Old, deprecated versions of some of the helpers (DO NOT USE) */
extern void VG_(call_helper_0_0) ( UCodeBlock* cb, Addr f);
extern void VG_(call_helper_1_0) ( UCodeBlock* cb, Addr f, UInt arg1,
@@ -1122,10 +1166,5 @@
extern void VG_(call_helper_2_0) ( UCodeBlock* cb, Addr f, UInt arg1, UInt arg2,
UInt regparms_n);
-
-/* One way around the 3-arg C function limit is to pass args via global
- * variables... ugly, but it works. This one puts a literal in there. */
extern void VG_(set_global_var) ( UCodeBlock* cb, Addr globvar_ptr, UInt val);
-
-/* This one puts the contents of a TempReg in the global variable. */
extern void VG_(set_global_var_tempreg) ( UCodeBlock* cb, Addr globvar_ptr,
UInt t_val);
|
|
From: Jeremy F. <je...@go...> - 2004-02-24 23:44:05
|
CVS commit by fitzhardinge:
Fix the use of brk. This change removes the requirement for the "real" brk
segment to be moved up to stage2's brk segment. Instead, Valgrind's
use of brk is simulated with mmap. In order to prevent any unwanted use
of the process brk segment, it also sets the RLIMIT_DATA to 0, which will
make brk always fail. glibc's malloc will use mmap to allocate if brk
fails. We try to intercept glibc's brk, but malloc seems to always use the
library-internal version. (The client's use of brk has always been simulated,
and is unaffected by this change.)
A coregrind/vg_glibc.c 1.1 [no copyright]
M +1 -0 coregrind/Makefile.am 1.67
M +0 -1 coregrind/stage1.c 1.7
M +4 -30 coregrind/ume.c 1.9
M +1 -2 coregrind/ume.h 1.5
M +2 -0 coregrind/vg_include.h 1.182
M +11 -1 coregrind/vg_main.c 1.146
M +70 -28 coregrind/vg_mylibc.c 1.70
M +20 -6 coregrind/vg_syscalls.c 1.89
M +11 -1 include/vg_kerneliface.h 1.14
--- valgrind/coregrind/Makefile.am #1.66:1.67
@@ -51,4 +51,5 @@
vg_execontext.c \
vg_from_ucode.c \
+ vg_glibc.c \
vg_hashtable.c \
vg_helpers.S \
--- valgrind/coregrind/stage1.c #1.6:1.7
@@ -163,5 +163,4 @@ static void hoops(void)
*/
info.map_base = 0xb0000000;
- info.setbrk = 1; /* ask do_exec to move the brk-base */
info.argv = NULL;
--- valgrind/coregrind/ume.c #1.8:1.9
@@ -91,4 +91,5 @@
#include "ume.h"
+#include "vg_include.h"
static int padfile = -1;
@@ -310,5 +311,5 @@ struct elfinfo *readelf(int fd, const ch
/* Map an ELF file. Returns the brk address. */
-ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base, int setbrk)
+ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base)
{
int i;
@@ -331,31 +332,4 @@ ESZ(Addr) mapelf(struct elfinfo *e, ESZ(
}
- if (setbrk) {
- /* sneaking up on the brk limit works better than actually
- jumping directly there. Unfortunately, setting the brk is
- tested against the datasize rlimit, even though we're not
- actually using any memory. */
- char *b = sbrk(0);
- char *initb = (char *)PGROUNDUP(b);
-
- while(b < (char *)elfbrk) {
- unsigned delta = (char *)elfbrk - b;
- static const unsigned limit = 256*1024*1024;
- char *bb;
-
- if (delta > limit)
- delta = limit;
- //printf("elfbrk=%p b=%p delta=%u\n", elfbrk, b, delta);
- bb = sbrk(delta);
- if (bb != b) {
- fprintf(stderr, "sbrk failed while adjusting brk base: "
- "perhaps we hit the datasize ulimit?\n");
- return 0;
- }
- b += delta;
- }
- munmap(initb, (char *)PGROUNDDN(elfbrk)-initb);
- }
-
for(i = 0; i < e->e.e_phnum; i++) {
ESZ(Phdr) *ph = &e->p[i];
@@ -509,5 +483,5 @@ static int load_ELF(char *hdr, int len,
}
- info->brkbase = mapelf(e, 0, info->setbrk); /* map the executable */
+ info->brkbase = mapelf(e, 0); /* map the executable */
if (info->brkbase == 0)
@@ -529,5 +503,5 @@ static int load_ELF(char *hdr, int len,
baseoff = base - interp_addr;
- mapelf(interp, (ESZ(Addr))baseoff, 0);
+ mapelf(interp, (ESZ(Addr))baseoff);
close(interp->fd);
--- valgrind/coregrind/ume.h #1.4:1.5
@@ -44,5 +44,4 @@ typedef ESZ(Addr) addr_t;
struct exeinfo
{
- int setbrk; /* INPUT: if true, set the brk segment base */
addr_t map_base; /* INPUT: if non-zero, base address of mappings */
@@ -83,5 +82,5 @@ struct elfinfo
struct elfinfo *readelf(int fd, const char *filename);
-ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base, int setbrk);
+ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base);
struct ume_auxv
--- valgrind/coregrind/vg_include.h #1.181:1.182
@@ -1360,4 +1360,6 @@ extern Addr VG_(valgrind_mmap_end);
extern Addr VG_(valgrind_end);
+extern vki_rlimit VG_(client_rlimit_data); /* client's original rlimit data */
+
/* stage1 executable file descriptor */
extern Int VG_(vgexecfd);
--- valgrind/coregrind/vg_main.c #1.145:1.146
@@ -106,4 +106,6 @@ Addr VG_(valgrind_mmap_end); /* valgrin
Addr VG_(valgrind_end);
+vki_rlimit VG_(client_rlimit_data);
+
/* This is set early to indicate whether this CPU has the
SSE/fxsave/fxrestor features. */
@@ -1365,5 +1367,4 @@ static void load_client(char* cl_argv[],
info->map_base = VG_(client_mapbase);
- info->setbrk = False;
info->exe_base = VG_(client_base);
@@ -2665,4 +2666,5 @@ int main(int argc, char **argv)
UInt * client_auxv;
VgSchedReturnCode src;
+ vki_rlimit zero = { 0, 0 };
//============================================================
@@ -2672,4 +2674,12 @@ int main(int argc, char **argv)
//============================================================
+ // Get the current process datasize rlimit, and set it to zero.
+ // This prevents any internal uses of brk() from having any effect.
+ // We remember the old value so we can restore it on exec, so that
+ // child processes will have a reasonable brk value.
+ VG_(getrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
+ zero.rlim_max = VG_(client_rlimit_data).rlim_max;
+ VG_(setrlimit)(VKI_RLIMIT_DATA, &zero);
+
//--------------------------------------------------------------
// Check we were launched by stage1
--- valgrind/coregrind/vg_mylibc.c #1.69:1.70
@@ -245,4 +245,23 @@ Int VG_(gettid)(void)
------------------------------------------------------------------ */
+static Int munmap_inner(void *start, UInt length)
+{
+ return VG_(do_syscall)(__NR_munmap, (UInt)start, (UInt)length );
+}
+
+static Addr mmap_inner(void *start, UInt length, UInt prot, UInt flags, UInt fd, UInt offset)
+{
+ UInt args[6];
+
+ args[0] = (UInt)start;
+ args[1] = length;
+ args[2] = prot;
+ args[3] = flags & ~(VKI_MAP_NOSYMS|VKI_MAP_CLIENT);
+ args[4] = fd;
+ args[5] = offset;
+
+ return VG_(do_syscall)(__NR_mmap, (UInt)(&(args[0])) );
+}
+
/* Returns -1 on failure. */
void* VG_(mmap)( void* start, UInt length,
@@ -250,5 +269,4 @@ void* VG_(mmap)( void* start, UInt lengt
{
Addr res;
- UInt args[6];
if (!(flags & VKI_MAP_FIXED)) {
@@ -260,11 +278,5 @@ void* VG_(mmap)( void* start, UInt lengt
}
- args[0] = (UInt)start;
- args[1] = length;
- args[2] = prot;
- args[3] = flags & ~(VKI_MAP_NOSYMS|VKI_MAP_CLIENT);
- args[4] = fd;
- args[5] = offset;
- res = VG_(do_syscall)(__NR_mmap, (UInt)(&(args[0])) );
+ res = mmap_inner(start, length, prot, flags, fd, offset);
if (!VG_(is_kerror)(res)) {
@@ -306,5 +318,5 @@ void* VG_(mmap)( void* start, UInt lengt
Int VG_(munmap)( void* start, Int length )
{
- Int res = VG_(do_syscall)(__NR_munmap, (UInt)start, (UInt)length );
+ Int res = munmap_inner(start, length);
if (!VG_(is_kerror)(res))
VG_(unmap_range)((Addr)start, length);
@@ -373,9 +385,47 @@ Int VG_(nanosleep)( const struct vki_tim
}
+extern Char _end;
+Char *VG_(curbrk) = NULL;
+extern void *__curbrk; /* in glibc */
+
void* VG_(brk) ( void* end_data_segment )
{
- Int res;
- res = VG_(do_syscall)(__NR_brk, (UInt)end_data_segment);
- return (void*)( VG_(is_kerror)(res) ? -1 : res );
+ Addr end;
+ Addr brkpage;
+ Addr endpage;
+
+ if (VG_(curbrk) == NULL) {
+ VG_(curbrk) = &_end;
+ __curbrk = (void *)VG_(curbrk);
+ }
+
+ end = (Addr)end_data_segment;
+ brkpage = PGROUNDUP(VG_(curbrk));
+ endpage = PGROUNDUP(end);
+
+ if (0 && VG_(curbrk) != __curbrk)
+ VG_(printf)("__curbrk changed unexpectedly: VG_(curbrk)=%p, __curbrk=%p\n",
+ VG_(curbrk), __curbrk);
+
+ if (0)
+ VG_(printf)("brk(end_data_segment=%p); brkpage=%p endpage=%p end=%p curbrk=%p &_end=%p\n",
+ end_data_segment, brkpage, endpage, end, VG_(curbrk), &_end);
+
+ if (endpage < (Addr)&_end) {
+ __curbrk = (void *)VG_(curbrk);
+ return (void *)VG_(curbrk);
+ }
+
+ if (brkpage != endpage) {
+ if (brkpage > endpage)
+ munmap_inner((void *)brkpage, brkpage-endpage);
+ else
+ mmap_inner((void *)brkpage, endpage-brkpage,
+ VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
+ VKI_MAP_FIXED|VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS, -1, 0);
+ }
+ VG_(curbrk) = (Char *)__curbrk = end_data_segment;
+
+ return end_data_segment;
}
@@ -1533,4 +1583,7 @@ Int VG_(system) ( Char* cmd )
Char* argv[4];
+ /* restore the DATA rlimit for the child */
+ VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
+
if (envp == NULL) {
Int i;
@@ -1617,22 +1670,11 @@ void* VG_(get_memory_from_mmap) ( Int nB
static UInt tot_alloc = 0;
void* p;
-
-#if 0
- p = VG_(mmap)( (void *)VG_(valgrind_base), nBytes,
- VKI_PROT_READ | VKI_PROT_WRITE | VKI_PROT_EXEC,
- VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS, -1, 0 );
-#else
- /* use brk, because it will definitely be in the valgrind address space */
- {
Char *b = VG_(brk)(0);
p = (void *)PGROUNDUP(b);
-
b = VG_(brk)(p + PGROUNDUP(nBytes));
if (b != (p + PGROUNDUP(nBytes)))
p = (void *)-1;
- }
-#endif
if (p != ((void*)(-1))) {
--- valgrind/coregrind/vg_syscalls.c #1.88:1.89
@@ -1995,4 +1995,7 @@ PRE(execve)
}
+ /* restore the DATA rlimit for the child */
+ VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
+
res = VG_(do_syscall)(__NR_execve, arg1, arg2, arg3);
@@ -2483,14 +2486,20 @@ PRE(getrlimit)
MAYBE_PRINTF("getrlimit ( %d, %p )\n", arg1,arg2);
SYSCALL_TRACK( pre_mem_write, tid, "getrlimit(rlim)", arg2,
- sizeof(struct rlimit) );
+ sizeof(struct vki_rlimit) );
}
POST(getrlimit)
{
- if (res == 0)
- VG_TRACK( post_mem_write, arg2, sizeof(struct rlimit) );
+ VG_TRACK( post_mem_write, arg2, sizeof(struct vki_rlimit) );
- if (res == 0 && arg1 == VKI_RLIMIT_NOFILE)
- ((struct rlimit *)arg2)->rlim_cur = VG_(max_fd);
+ switch(arg1) {
+ case VKI_RLIMIT_NOFILE:
+ ((vki_rlimit *)arg2)->rlim_cur = VG_(max_fd);
+ break;
+
+ case VKI_RLIMIT_DATA:
+ *((vki_rlimit *)arg2) = VG_(client_rlimit_data);
+ break;
+ }
}
@@ -4246,5 +4255,10 @@ PRE(setrlimit)
MAYBE_PRINTF("setrlimit ( %d, %p )\n", arg1,arg2);
SYSCALL_TRACK( pre_mem_read, tid, "setrlimit(rlim)",
- arg2, sizeof(struct rlimit) );
+ arg2, sizeof(struct vki_rlimit) );
+
+ if (arg1 == VKI_RLIMIT_DATA) {
+ VG_(client_rlimit_data) = *(vki_rlimit *)arg2;
+ res = 0;
+ }
}
--- valgrind/include/vg_kerneliface.h #1.13:1.14
@@ -699,5 +699,15 @@ typedef struct vki_rlimit {
} vki_rlimit;
-#define VKI_RLIMIT_NOFILE 7
+#define VKI_RLIMIT_CPU 0 /* CPU time in ms */
+#define VKI_RLIMIT_FSIZE 1 /* Maximum filesize */
+#define VKI_RLIMIT_DATA 2 /* max data size */
+#define VKI_RLIMIT_STACK 3 /* max stack size */
+#define VKI_RLIMIT_CORE 4 /* max core file size */
+#define VKI_RLIMIT_RSS 5 /* max resident set size */
+#define VKI_RLIMIT_NPROC 6 /* max number of processes */
+#define VKI_RLIMIT_NOFILE 7 /* max number of open files */
+#define VKI_RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
+#define VKI_RLIMIT_AS 9 /* address space limit */
+#define VKI_RLIMIT_LOCKS 10 /* maximum file locks held */
/* Socket stuff. */
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-24 23:58:51
|
CVS commit by nethercote:
Check new fds are not within Valgrind's reserved range. Still one case for
recvmsg() where I'm not sure if it should be checked, and if so, what error
should be returned if the check fails.
M +49 -18 coregrind/vg_syscalls.c 1.90
M +1 -0 include/vg_kerneliface.h 1.15
--- valgrind/coregrind/vg_syscalls.c #1.89:1.90
@@ -858,4 +858,6 @@ void check_cmsg_for_fds(Int tid, struct
for (i = 0; i < fdc; i++)
if(VG_(clo_track_fds))
+ // XXX: must we check the range on these fds with
+ // fd_allowed()?
record_fd_open (tid, fds[i], VG_(resolve_filename)(fds[i]));
}
@@ -2146,7 +2148,13 @@ PRE(fcntl)
POST(fcntl)
{
- if (arg2 == VKI_F_DUPFD)
+ if (arg2 == VKI_F_DUPFD) {
+ if (!fd_allowed(res, "fcntl(DUPFD)", tid)) {
+ VG_(close)(res);
+ res = -VKI_EMFILE;
+ } else {
if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(resolve_filename)(res));
+ }
+ }
}
@@ -2179,7 +2187,13 @@ PRE(fcntl64)
POST(fcntl64)
{
- if (arg2 == VKI_F_DUPFD)
- if(VG_(clo_track_fds))
+ if (arg2 == VKI_F_DUPFD) {
+ if (!fd_allowed(res, "fcntl64(DUPFD)", tid)) {
+ VG_(close)(res);
+ res = -VKI_EMFILE;
+ } else {
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(resolve_filename)(res));
+ }
+ }
}
@@ -3879,5 +3893,5 @@ POST(open)
res = -VKI_EMFILE;
} else {
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(arena_strdup)(VG_AR_CORE, (Char*)arg1));
}
@@ -3923,5 +3937,5 @@ POST(creat)
res = -VKI_EMFILE;
} else {
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(arena_strdup)(VG_AR_CORE, (Char*)arg1));
}
@@ -3948,5 +3962,5 @@ POST(pipe)
} else {
VG_TRACK( post_mem_write, arg1, 2*sizeof(int) );
- if(VG_(clo_track_fds)) {
+ if (VG_(clo_track_fds)) {
record_fd_open(tid, p[0], NULL);
record_fd_open(tid, p[1], NULL);
@@ -4497,12 +4511,22 @@ POST(socketcall)
switch (arg1 /* request */) {
- case SYS_SOCKETPAIR:
- /* XXX TODO: check return fd against VG_(max_fd) */
+ case SYS_SOCKETPAIR: {
+ Int fd1 = ((UInt*)((UInt*)arg2)[3])[0];
+ Int fd2 = ((UInt*)((UInt*)arg2)[3])[1];
VG_TRACK( post_mem_write, ((UInt*)arg2)[3], 2*sizeof(int) );
- if(VG_(clo_track_fds)) {
- record_fd_open(tid, ((UInt*)((UInt*)arg2)[3])[0], NULL);
- record_fd_open(tid, ((UInt*)((UInt*)arg2)[3])[1], NULL);
+ if (!fd_allowed(fd1, "socketcall.socketpair", tid) ||
+ !fd_allowed(fd2, "socketcall.socketpair", tid)) {
+ VG_(close)(fd1);
+ VG_(close)(fd2);
+ res = -VKI_EMFILE;
+ } else {
+ VG_TRACK( post_mem_write, ((UInt*)arg2)[3], 2*sizeof(int) );
+ if (VG_(clo_track_fds)) {
+ record_fd_open(tid, fd1, NULL);
+ record_fd_open(tid, fd2, NULL);
+ }
}
break;
+ }
case SYS_SOCKET:
@@ -4511,5 +4535,5 @@ POST(socketcall)
res = -VKI_EMFILE;
} else {
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, NULL);
}
@@ -4537,5 +4561,5 @@ POST(socketcall)
buf_and_len_post_check ( tid, res, addr_p, addrlen_p,
"socketcall.accept(addrlen_out)" );
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, NULL);
}
@@ -4933,6 +4957,13 @@ POST(futex)
if (!VG_(is_kerror)(res)) {
VG_TRACK( post_mem_write, arg1, sizeof(int) );
- if (arg2 == VKI_FUTEX_FD && VG_(clo_track_fds))
- record_fd_open(tid, res, NULL);
+ if (arg2 == VKI_FUTEX_FD) {
+ if (!fd_allowed(res, "futex", tid)) {
+ VG_(close)(res);
+ res = -VKI_ENFILE;
+ } else {
+ if (VG_(clo_track_fds))
+ record_fd_open(tid, res, VG_(arena_strdup)(VG_AR_CORE, (Char*)arg1));
+ }
+ }
}
}
--- valgrind/include/vg_kerneliface.h #1.14:1.15
@@ -375,4 +375,5 @@ struct vki_ucontext {
#define VKI_EEXIST 17 /* File exists */
#define VKI_EINVAL 22 /* Invalid argument */
+#define VKI_ENFILE 23 /* File table overflow */
#define VKI_EMFILE 24 /* Too many open files */
#define VKI_ENOSYS 38 /* Function not implemented */
|
|
From: Dirk M. <mu...@kd...> - 2004-02-28 21:25:18
|
CVS commit by mueller:
adding suppressions for Redhat 7.2, patch by Tom Hughes
M +38 -15 glibc-2.2.supp 1.22
--- valgrind/glibc-2.2.supp #1.21:1.22
@@ -155,19 +155,27 @@
#-------- Data races
-#{
-# _dl_lookup_symbol/fixup/_dl_runtime_resolve
-# helgrind:Eraser
-# fun:_dl_lookup_symbol
-# fun:fixup
-# fun:_dl_runtime_resolve
-#}
-#
-#{
-# _dl_lookup_versioned_symbol/fixup/_dl_runtime_resolve
-# helgrind:Eraser
-# fun:_dl_lookup_versioned_symbol
-# fun:fixup
-# fun:_dl_runtime_resolve
-#}
+{
+ _dl_lookup_symbol/fixup/_dl_runtime_resolve
+ Helgrind:Eraser
+ fun:_dl_lookup_symbol
+ fun:fixup
+ fun:_dl_runtime_resolve
+}
+
+{
+ _dl_lookup_versioned_symbol/fixup/_dl_runtime_resolve
+ Helgrind:Eraser
+ fun:_dl_lookup_versioned_symbol
+ fun:fixup
+ fun:_dl_runtime_resolve
+}
+
+{
+ _dl_fini/exit/__libc_start_main
+ Helgrind:Eraser
+ fun:_dl_fini
+ fun:exit
+ fun:__libc_start_main
+}
#-------- Threading bugs?
@@ -335,4 +343,12 @@
fun:_dl_catch_error
}
+{
+ _dl_relocate_object/dl_main/_dl_sysdep_start/_dl_start_final(Cond)
+ Memcheck:Cond
+ fun:_dl_relocate_object
+ fun:dl_main
+ fun:_dl_sysdep_start
+ fun:_dl_start_final
+}
{
@@ -344,4 +360,11 @@
}
+{
+ _dl_init/ld-2.2.4.so(Cond)
+ Memcheck:Cond
+ fun:_dl_start
+ obj:/lib/ld-2.2.4.so
+}
+
#-------------------
{
|
|
From: Tom H. <th...@cy...> - 2004-02-29 12:45:55
|
CVS commit by thughes:
Add an extra suppression for glibc 2.3.2 on RedHat 8.0 systems.
M +7 -0 glibc-2.3.supp 1.11
--- valgrind/glibc-2.3.supp #1.10:1.11
@@ -131,4 +131,11 @@
}
{
+ _dl_lookup_versioned_symbol/ld-2.3.2.so/ld-2.3.2.so
+ Helgrind:Eraser
+ fun:_dl_lookup_versioned_symbol
+ obj:/lib/ld-2.3.2.so
+ obj:/lib/ld-2.3.2.so
+}
+{
_dl_fini
Helgrind:Eraser
|
|
From: Tom H. <th...@cy...> - 2004-02-29 13:04:40
|
CVS commit by thughes:
Added some extra suppressions for glibc 2.2.5 on RedHat 7.3 systems.
M +16 -0 glibc-2.2.supp 1.23
--- valgrind/glibc-2.2.supp #1.22:1.23
@@ -172,4 +172,12 @@
{
+ _dl_lookup_versioned_symbol_internal/fixup/_dl_runtime_resolve
+ Helgrind:Eraser
+ fun:_dl_lookup_versioned_symbol_internal
+ fun:fixup
+ fun:_dl_runtime_resolve
+}
+
+{
_dl_fini/exit/__libc_start_main
Helgrind:Eraser
@@ -351,4 +359,12 @@
fun:_dl_start_final
}
+{
+ _dl_relocate_object_internal/dl_main/_dl_sysdep_start/_dl_start_final(Cond)
+ Memcheck:Cond
+ fun:_dl_relocate_object_internal
+ fun:dl_main
+ fun:_dl_sysdep_start
+ fun:_dl_start_final
+}
{
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-29 15:53:53
|
CVS commit by nethercote:
Patch from Bartosz Taudul: latest GCC requires regparm(n) attributes on both
function declarations and definitions.
M +8 -8 helgrind/hg_main.c 1.72
M +8 -8 memcheck/mc_include.h 1.19
--- valgrind/helgrind/hg_main.c #1.71:1.72
@@ -3104,40 +3104,40 @@ static void eraser_mem_write(Addr a, UIn
#undef DEBUG_STATE
-static void eraser_mem_help_read_1(Addr a)
+REGPARM(1) static void eraser_mem_help_read_1(Addr a)
{
eraser_mem_read(a, 1, VG_(get_current_tid)());
}
-static void eraser_mem_help_read_2(Addr a)
+REGPARM(1) static void eraser_mem_help_read_2(Addr a)
{
eraser_mem_read(a, 2, VG_(get_current_tid)());
}
-static void eraser_mem_help_read_4(Addr a)
+REGPARM(1) static void eraser_mem_help_read_4(Addr a)
{
eraser_mem_read(a, 4, VG_(get_current_tid)());
}
-static void eraser_mem_help_read_N(Addr a, UInt size)
+REGPARM(2) static void eraser_mem_help_read_N(Addr a, UInt size)
{
eraser_mem_read(a, size, VG_(get_current_tid)());
}
-static void eraser_mem_help_write_1(Addr a, UInt val)
+REGPARM(2) static void eraser_mem_help_write_1(Addr a, UInt val)
{
if (*(UChar *)a != val)
eraser_mem_write(a, 1, VG_(get_current_tid)());
}
-static void eraser_mem_help_write_2(Addr a, UInt val)
+REGPARM(2) static void eraser_mem_help_write_2(Addr a, UInt val)
{
if (*(UShort *)a != val)
eraser_mem_write(a, 2, VG_(get_current_tid)());
}
-static void eraser_mem_help_write_4(Addr a, UInt val)
+REGPARM(2) static void eraser_mem_help_write_4(Addr a, UInt val)
{
if (*(UInt *)a != val)
eraser_mem_write(a, 4, VG_(get_current_tid)());
}
-static void eraser_mem_help_write_N(Addr a, UInt size)
+REGPARM(2) static void eraser_mem_help_write_N(Addr a, UInt size)
{
eraser_mem_write(a, size, VG_(get_current_tid)());
--- valgrind/memcheck/mc_include.h #1.18:1.19
@@ -122,14 +122,14 @@ extern void MC_(helper_value_check0_fail
/* Functions defined in mc_main.c */
-extern void MC_(helperc_STOREV4) ( Addr, UInt );
-extern void MC_(helperc_STOREV2) ( Addr, UInt );
-extern void MC_(helperc_STOREV1) ( Addr, UInt );
+extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV4) ( Addr, UInt );
+extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV2) ( Addr, UInt );
+extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV1) ( Addr, UInt );
-extern UInt MC_(helperc_LOADV1) ( Addr );
-extern UInt MC_(helperc_LOADV2) ( Addr );
-extern UInt MC_(helperc_LOADV4) ( Addr );
+extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV1) ( Addr );
+extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV2) ( Addr );
+extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV4) ( Addr );
-extern void MC_(fpu_write_check) ( Addr addr, Int size );
-extern void MC_(fpu_read_check) ( Addr addr, Int size );
+extern __attribute__ ((regparm(2))) void MC_(fpu_write_check) ( Addr addr, Int size );
+extern __attribute__ ((regparm(2))) void MC_(fpu_read_check) ( Addr addr, Int size );
|
|
From: Tom H. <th...@cy...> - 2004-03-06 13:00:45
|
CVS commit by thughes:
Treat INT with an operand other than 0x80 as an undefined instruction.
CCMAIL: 768...@bu...
A none/tests/filter_int 1.1
A none/tests/int.c 1.1 [no copyright]
A none/tests/int.stderr.exp 1.1
A none/tests/int.stdout.exp 1.1
A none/tests/int.vgtest 1.1
M +1 -1 coregrind/vg_to_ucode.c 1.132
M +1 -0 none/tests/.cvsignore 1.11
M +3 -1 none/tests/Makefile.am 1.30
--- valgrind/coregrind/vg_to_ucode.c #1.131:1.132
@@ -5447,5 +5447,5 @@ static Addr disInstr ( UCodeBlock* cb, A
case 0xCD: /* INT imm8 */
d32 = getUChar(eip); eip++;
- if (d32 != 0x80) VG_(core_panic)("disInstr: INT but not 0x80 !");
+ if (d32 != 0x80) goto decode_failure;
/* It's important that all ArchRegs carry their up-to-date value
at this point. So we declare an end-of-block here, which
--- valgrind/none/tests/.cvsignore #1.10:1.11
@@ -29,4 +29,5 @@
insn_sse2
insn_sse2.c
+int
map_unmap
munmap_exe
--- valgrind/none/tests/Makefile.am #1.29:1.30
@@ -32,4 +32,5 @@
insn_sse.stderr.exp insn_sse.stdout.exp insn_sse.vgtest \
insn_sse2.stderr.exp insn_sse2.stdout.exp insn_sse2.vgtest \
+ int.stderr.exp int.stdout.exp int.vgtest \
map_unmap.stdout.exp map_unmap.vgtest \
mremap.stdout.exp mremap.vgtest \
@@ -59,5 +60,5 @@
cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
fucomip insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2 \
- munmap_exe map_unmap mremap rcl_assert \
+ int munmap_exe map_unmap mremap rcl_assert \
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
pth_blockedsig pushpopseg \
@@ -96,4 +97,5 @@
insn_sse2_SOURCES = insn_sse2.def
insn_sse2_LDADD = -lm
+int_SOURCES = int.c
map_unmap_SOURCES = map_unmap.c
mremap_SOURCES = mremap.c
|
|
From: Tom H. <th...@cy...> - 2004-03-07 19:48:39
|
CVS commit by thughes: Add some alternate regression test results for older libc's. A corecheck/tests/fdleak_creat.stderr.exp2 1.1 A memcheck/tests/mismatches.stderr.exp2 1.1 |
|
From: Tom H. <th...@cy...> - 2004-03-09 08:59:06
|
CVS commit by thughes: Fix expected standard error output for mmxext tests to resolve differences in the amount of whitespace left with different skins. M +0 -2 addrcheck/tests/insn_mmxext.stderr.exp 1.2 M +0 -2 cachegrind/tests/insn_mmxext.stderr.exp 1.2 M +0 -2 helgrind/tests/insn_mmxext.stderr.exp 1.2 M +0 -2 memcheck/tests/insn_mmxext.stderr.exp 1.2 --- valgrind/addrcheck/tests/insn_mmxext.stderr.exp #1.1:1.2 @@ -1,2 +0,0 @@ - - --- valgrind/cachegrind/tests/insn_mmxext.stderr.exp #1.1:1.2 @@ -1,2 +0,0 @@ - - --- valgrind/helgrind/tests/insn_mmxext.stderr.exp #1.1:1.2 @@ -1,2 +0,0 @@ - - --- valgrind/memcheck/tests/insn_mmxext.stderr.exp #1.1:1.2 @@ -1,2 +0,0 @@ - - |
|
From: Tom H. <th...@cy...> - 2004-03-09 10:08:33
|
CVS commit by thughes: Anonymise path names for libc's built with debg symbols. M +3 -0 corecheck/tests/filter_fdleak 1.3 M +4 -1 memcheck/tests/filter_stderr 1.11 --- valgrind/corecheck/tests/filter_fdleak #1.2:1.3 @@ -16,4 +16,7 @@ sed "s/(in \/.*libc.*)$/(in \/...libc...)/" | +# Anonymise paths like "xxx (../sysdeps/unix/sysv/linux/quux.c:129)" +sed "s/(\.\.\/sysdeps\/unix\/sysv\/linux\/.*\.c:[0-9]*)$/(in \/...libc...)/" | + # Anonymise paths like "__libc_start_main (../foo/bar/libc-quux.c:129)" sed "s/__libc_\(.*\) (.*)$/__libc_\1 (...libc...)/" | --- valgrind/memcheck/tests/filter_stderr #1.10:1.11 @@ -17,5 +17,8 @@ # Anonymise paths like "(within /foo/bar/libc-baz.so)" -sed "s/(within \/.*libc.*)$/(within \/...libc...)/" | +sed "s/(within \/.*libc.*)$/(within \/...libc...)/" | + +# Anonymise paths like "xxx (../sysdeps/unix/sysv/linux/quux.c:129)" +sed "s/(\.\.\/sysdeps\/unix\/sysv\/linux\/.*\.c:[0-9]*)$/(in \/...libc...)/" | # Anonymise paths like "__libc_start_main (../foo/bar/libc-quux.c:129)" |
|
From: Jeremy F. <je...@go...> - 2004-03-12 11:02:40
|
CVS commit by fitzhardinge:
Fix "make distcheck", and also make sure that the generated archive
contains everything needed to "make regtest". Bump the version.
M +3 -3 Makefile.am 1.64
M +1 -4 configure.in 1.106
M +4 -4 addrcheck/Makefile.am 1.48
M +5 -1 addrcheck/tests/Makefile.am 1.6
M +2 -2 cachegrind/Makefile.am 1.43
M +5 -2 cachegrind/tests/Makefile.am 1.11
M +2 -2 corecheck/Makefile.am 1.42
M +5 -5 coregrind/Makefile.am 1.70
M +2 -2 example/Makefile.am 1.6
M +4 -4 helgrind/Makefile.am 1.46
M +5 -2 helgrind/tests/Makefile.am 1.6
M +2 -2 lackey/Makefile.am 1.43
M +4 -4 massif/Makefile.am 1.2
M +1 -1 massif/hp2ps/Makefile.am 1.4
M +4 -4 memcheck/Makefile.am 1.48
M +5 -2 memcheck/tests/Makefile.am 1.33
M +3 -3 none/Makefile.am 1.43
M +15 -24 none/tests/Makefile.am 1.31
--- valgrind/Makefile.am #1.63:1.64
@@ -52,6 +52,6 @@
all-local:
- mkdir -p .in_place
- rm -f $(addprefix .in_place/,default.supp $(SUPP_FILES))
- ln -s $(addprefix ../,default.supp $(SUPP_FILES)) $(top_srcdir)/.in_place
+ mkdir -p $(top_builddir)/.in_place
+ rm -f $(addprefix $(top_builddir)/.in_place/,default.supp $(SUPP_FILES))
+ ln -s $(addprefix $(top_srcdir)/../,default.supp $(SUPP_FILES)) $(top_builddir)/.in_place
--- valgrind/configure.in #1.105:1.106
@@ -2,5 +2,5 @@
AC_INIT(coregrind/vg_main.c) # give me a source file, any source file...
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(valgrind, 2.1.0)
+AM_INIT_AUTOMAKE(valgrind, 2.1.1)
AM_MAINTAINER_MODE
@@ -358,7 +358,4 @@
auxprogs/Makefile
coregrind/Makefile
- coregrind/arch/Makefile
- coregrind/arch/x86-linux/Makefile
- coregrind/arch/x86-freebsd/Makefile
coregrind/demangle/Makefile
coregrind/docs/Makefile
--- valgrind/addrcheck/Makefile.am #1.47:1.48
@@ -9,5 +9,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_addrcheck.so vgpreload_addrcheck.so
@@ -22,6 +22,6 @@
vgpreload_addrcheck_so_SOURCES =
-vgpreload_addrcheck_so_LDADD = $(top_srcdir)/coregrind/vg_replace_malloc.o
-vgpreload_addrcheck_so_DEPENDENCIES = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_addrcheck_so_LDADD = $(top_builddir)/coregrind/vg_replace_malloc.o
+vgpreload_addrcheck_so_DEPENDENCIES = $(top_builddir)/coregrind/vg_replace_malloc.o
vgpreload_addrcheck_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
@@ -29,3 +29,3 @@
mkdir -p $(inplacedir)
-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
- ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
+ ln -f -s $(addprefix $(top_builddir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
--- valgrind/addrcheck/tests/Makefile.am #1.5:1.6
@@ -1,7 +1,11 @@
noinst_SCRIPTS = filter_stderr
+INSN_TESTS=insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
+
EXTRA_DIST = $(noinst_SCRIPTS) \
badrw.stderr.exp badrw.vgtest \
fprw.stderr.exp fprw.vgtest \
insn_basic.vgtest insn_cmov.vgtest insn_mmx.vgtest \
- insn_mmxext.vgtest insn_sse.vgtest insn_sse2.vgtest
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+ $(addsuffix .stdout.exp,$(INSN_TESTS)) \
+ $(addsuffix .vgtest,$(INSN_TESTS))
--- valgrind/cachegrind/Makefile.am #1.42:1.43
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
bin_SCRIPTS = cg_annotate
@@ -21,3 +21,3 @@
mkdir -p $(inplacedir)
-rm -f $(inplacedir)/$(val_PROGRAMS)
- ln -f -s $(top_srcdir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
+ ln -f -s $(top_builddir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
--- valgrind/cachegrind/tests/Makefile.am #1.10:1.11
@@ -1,10 +1,13 @@
noinst_SCRIPTS = filter_stderr filter_cachesim_discards
+INSN_TESTS=insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
+
EXTRA_DIST = $(noinst_SCRIPTS) \
chdir.vgtest chdir.stderr.exp \
dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp \
fpu-28-108.vgtest fpu-28-108.stderr.exp \
- insn_basic.vgtest insn_cmov.vgtest insn_mmx.vgtest \
- insn_mmxext.vgtest insn_sse.vgtest insn_sse2.vgtest
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+ $(addsuffix .stdout.exp,$(INSN_TESTS)) \
+ $(addsuffix .vgtest,$(INSN_TESTS))
check_PROGRAMS = \
--- valgrind/corecheck/Makefile.am #1.41:1.42
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_corecheck.so
@@ -17,3 +17,3 @@
mkdir -p $(inplacedir)
-rm -f $(inplacedir)/$(val_PROGRAMS)
- ln -f -s $(top_srcdir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
+ ln -f -s $(top_builddir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
--- valgrind/coregrind/Makefile.am #1.69:1.70
@@ -1,9 +1,9 @@
-SUBDIRS = arch x86 demangle . docs
+SUBDIRS = x86 demangle . docs
add_includes = -I$(srcdir)/demangle -I$(top_srcdir)/include -I$(srcdir)/x86
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
AM_CPPFLAGS = $(add_includes) -DVG_LIBDIR="\"$(valdir)"\"
@@ -77,8 +77,8 @@
vg_transtab.c \
vg_ldt.c
-stage2_DEPENDENCIES = $(srcdir)/valgrind.vs $(srcdir)/x86/stage2.lds
+stage2_DEPENDENCIES = $(srcdir)/valgrind.vs x86/stage2.lds
stage2_LDFLAGS=-Wl,--export-dynamic -Wl,-e,_ume_entry -g \
-Wl,-defsym,kickstart_base=0xb8000000 \
- -Wl,-T,$(srcdir)/x86/stage2.lds \
+ -Wl,-T,x86/stage2.lds \
-Wl,-version-script $(srcdir)/valgrind.vs
stage2_LDADD= \
@@ -145,5 +145,5 @@
to=$(inplacedir)/$$(echo $$i | sed 's,libpthread.so,libpthread.so.0,'); \
rm -f $$$to; \
- ln -sf $(top_srcdir)/$(subdir)/$$i $$to; \
+ ln -sf $(top_builddir)/$(subdir)/$$i $$to; \
done
--- valgrind/example/Makefile.am #1.5:1.6
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_example.so
@@ -17,4 +17,4 @@
mkdir -p $(inplacedir)
-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
- ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
+ ln -f -s $(addprefix $(top_builddir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
--- valgrind/helgrind/Makefile.am #1.45:1.46
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_helgrind.so vgpreload_helgrind.so
@@ -15,6 +15,6 @@
vgpreload_helgrind_so_SOURCES =
-vgpreload_helgrind_so_LDADD = $(top_srcdir)/coregrind/vg_replace_malloc.o
-vgpreload_helgrind_so_DEPENDENCIES = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_helgrind_so_LDADD = $(top_builddir)/coregrind/vg_replace_malloc.o
+vgpreload_helgrind_so_DEPENDENCIES = $(top_builddir)/coregrind/vg_replace_malloc.o
vgpreload_helgrind_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
@@ -26,3 +26,3 @@
mkdir -p $(inplacedir)
-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
- ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
+ ln -f -s $(addprefix $(top_builddir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
--- valgrind/helgrind/tests/Makefile.am #1.5:1.6
@@ -1,10 +1,13 @@
noinst_SCRIPTS = filter_stderr
+INSN_TESTS=insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
+
EXTRA_DIST = $(noinst_SCRIPTS) \
allok.stderr.exp allok.vgtest \
deadlock.stderr.exp deadlock.vgtest \
inherit.stderr.exp inherit.vgtest \
- insn_basic.vgtest insn_cmov.vgtest insn_mmx.vgtest \
- insn_mmxext.vgtest insn_sse.vgtest insn_sse2.vgtest \
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+ $(addsuffix .stdout.exp,$(INSN_TESTS)) \
+ $(addsuffix .vgtest,$(INSN_TESTS)) \
race.stderr.exp race.vgtest \
race2.stderr.exp race2.vgtest \
--- valgrind/lackey/Makefile.am #1.42:1.43
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_lackey.so
@@ -18,3 +18,3 @@
mkdir -p $(inplacedir)
-rm -f $(inplacedir)/$(val_PROGRAMS)
- ln -f -s $(top_srcdir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
+ ln -f -s $(top_builddir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
--- valgrind/massif/Makefile.am #1.1:1.2
@@ -7,5 +7,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_massif.so vgpreload_massif.so
@@ -15,6 +15,6 @@
vgpreload_massif_so_SOURCES =
-vgpreload_massif_so_LDADD = $(top_srcdir)/coregrind/vg_replace_malloc.o
-vgpreload_massif_so_DEPENDENCIES = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_massif_so_LDADD = $(top_builddir)/coregrind/vg_replace_malloc.o
+vgpreload_massif_so_DEPENDENCIES = $(top_builddir)/coregrind/vg_replace_malloc.o
vgpreload_massif_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
@@ -22,3 +22,3 @@
mkdir -p $(inplacedir)
-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
- ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
+ ln -f -s $(addprefix $(top_builddir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
--- valgrind/massif/hp2ps/Makefile.am #1.3:1.4
@@ -1,5 +1,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
AM_CPPFLAGS = $(add_includes)
--- valgrind/memcheck/Makefile.am #1.47:1.48
@@ -10,5 +10,5 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_memcheck.so vgpreload_memcheck.so
@@ -16,6 +16,6 @@
vgpreload_memcheck_so_SOURCES = \
mac_replace_strmem.c
-vgpreload_memcheck_so_LDADD = $(top_srcdir)/coregrind/vg_replace_malloc.o
-vgpreload_memcheck_so_DEPENDENCIES = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_memcheck_so_LDADD = $(top_builddir)/coregrind/vg_replace_malloc.o
+vgpreload_memcheck_so_DEPENDENCIES = $(top_builddir)/coregrind/vg_replace_malloc.o
vgpreload_memcheck_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
@@ -47,3 +47,3 @@
mkdir -p $(inplacedir)
-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
- ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
+ ln -f -s $(addprefix $(top_builddir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)
--- valgrind/memcheck/tests/Makefile.am #1.32:1.33
@@ -8,4 +8,6 @@
filter_tronical
+INSN_TESTS=insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
+
EXTRA_DIST = $(noinst_SCRIPTS) \
badaddrvalue.stderr.exp \
@@ -30,6 +32,7 @@
inits.stderr.exp inits.vgtest \
inline.stderr.exp inline.stdout.exp inline.vgtest \
- insn_basic.vgtest insn_cmov.vgtest insn_mmx.vgtest \
- insn_mmxext.vgtest insn_sse.vgtest insn_sse2.vgtest \
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+ $(addsuffix .stdout.exp,$(INSN_TESTS)) \
+ $(addsuffix .vgtest,$(INSN_TESTS)) \
malloc1.stderr.exp malloc1.vgtest \
malloc2.stderr.exp malloc2.vgtest \
--- valgrind/none/Makefile.am #1.42:1.43
@@ -7,13 +7,13 @@
valdir = $(libdir)/valgrind
-inplacedir = $(top_srcdir)/.in_place
+inplacedir = $(top_builddir)/.in_place
val_PROGRAMS = vgskin_none.so
vgskin_none_so_SOURCES = nl_main.c
-vgskin_none_so_LDFLAGS = -shared -Wl,-rpath,$(top_srcdir)/coregrind
+vgskin_none_so_LDFLAGS = -shared
all-local:
mkdir -p $(inplacedir)
-rm -f $(inplacedir)/$(val_PROGRAMS)
- ln -f -s $(top_srcdir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
+ ln -f -s $(top_builddir)/$(subdir)/$(val_PROGRAMS) $(inplacedir)/$(val_PROGRAMS)
--- valgrind/none/tests/Makefile.am #1.30:1.31
@@ -1,3 +1,6 @@
-noinst_SCRIPTS = filter_cpuid filter_none_discards filter_stderr
+noinst_SCRIPTS = filter_cpuid filter_none_discards filter_stderr filter_int gen_insn_test.pl
+
+CLEANFILES = $(addsuffix .c,$(INSN_TESTS))
+INSN_TESTS=insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2
EXTRA_DIST = $(noinst_SCRIPTS) \
@@ -17,6 +20,5 @@
discard.stderr.exp discard.stdout.exp \
discard.vgtest \
- exec-sigmask.vgtest
- exec-sigmask.stdout.exp exec-sigmask.stderr.exp \
+ exec-sigmask.vgtest exec-sigmask.stdout.exp exec-sigmask.stderr.exp \
floored.stderr.exp floored.stdout.exp \
floored.vgtest \
@@ -26,13 +28,10 @@
fucomip.stderr.exp fucomip.vgtest \
gxx304.stderr.exp gxx304.vgtest \
- insn_basic.stderr.exp insn_basic.stdout.exp insn_basic.vgtest \
- insn_cmov.stderr.exp insn_cmov.stdout.exp insn_cmov.vgtest \
- insn_mmx.stderr.exp insn_mmx.stdout.exp insn_mmx.vgtest \
- insn_mmxext.stderr.exp insn_mmxext.stdout.exp insn_mmxext.vgtest \
- insn_sse.stderr.exp insn_sse.stdout.exp insn_sse.vgtest \
- insn_sse2.stderr.exp insn_sse2.stdout.exp insn_sse2.vgtest \
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+ $(addsuffix .stdout.exp,$(INSN_TESTS)) \
+ $(addsuffix .vgtest,$(INSN_TESTS)) \
int.stderr.exp int.stdout.exp int.vgtest \
- map_unmap.stdout.exp map_unmap.vgtest \
- mremap.stdout.exp mremap.vgtest \
+ map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
+ mremap.stderr.exp mremap.stdout.exp mremap.vgtest \
munmap_exe.stderr.exp munmap_exe.vgtest \
pth_blockedsig.stderr.exp \
@@ -53,11 +52,11 @@
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
- system.stdout.exp system.vgtest
- yield.stdout.exp yield.vgtest
+ system.stderr.exp system.vgtest \
+ yield.stderr.exp yield.stdout.exp yield.vgtest
check_PROGRAMS = \
args bitfield1 bt_everything bt_literal closeall coolo_strlen \
cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
- fucomip insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2 \
+ fucomip $(INSN_TESTS) \
int munmap_exe map_unmap mremap rcl_assert \
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
@@ -138,12 +137,4 @@
fpu_lazy_eflags.o: CFLAGS += -O2 -mcpu=pentiumpro -march=pentiumpro
-# rebuild instruction tests if test generator changes
-insn_basic.c: gen_insn_test.pl
-insn_cmov.c: gen_insn_test.pl
-insn_mmx.c: gen_insn_test.pl
-insn_mmxext.c: gen_insn_test.pl
-insn_sse.c: gen_insn_test.pl
-insn_sse2.c: gen_insn_test.pl
-
-.def.c:
- $(PERL) gen_insn_test.pl < $< > $@
+.def.c: $(srcdir)/gen_insn_test.pl
+ $(PERL) $(srcdir)/gen_insn_test.pl < $< > $@
|
|
From: Nicholas N. <nj...@ca...> - 2004-03-12 11:32:58
|
On Fri, 12 Mar 2004, Jeremy Fitzhardinge wrote: > CVS commit by fitzhardinge: > > Fix "make distcheck", and also make sure that the generated archive > contains everything needed to "make regtest". Oh, well done! You've become quite the automake hacker... N |
|
From: Jeremy F. <je...@go...> - 2004-03-12 16:51:27
|
On Fri, 2004-03-12 at 03:22, Nicholas Nethercote wrote: > > Fix "make distcheck", and also make sure that the generated archive > > contains everything needed to "make regtest". > > Oh, well done! You've become quite the automake hacker... Not really. There's a lot of crap which really should be fixed up, but I'm not sure how. There really shouldn't have been so many modified files - there's a lot of copying which should be macro expansion. J |
|
From: Julian S. <js...@ac...> - 2004-03-12 21:18:16
|
CVS commit by jseward: Update for 2.1.1. M +77 -0 NEWS 1.16 --- valgrind/NEWS #1.15:1.16 @@ -1,3 +1,80 @@ +Unstable (cvs head) release 2.1.1 (12 March 2004) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +2.1.1 contains some internal structure changes needed for V's +long-term future. These don't affect end-users. Most notable +user-visible changes are: + +* Greater isolation between Valgrind and the program being run, so + the program is less likely to inadvertently kill Valgrind by + doing wild writes. + +* Massif: a new space profiling tool. Try it! It's cool, and it'll + tell you in detail where and when your C/C++ code is allocating heap. + Draws pretty .ps pictures of memory use against time. A potentially + powerful tool for making sense of your program's space use. + +* Fixes for many bugs, including support for more SSE2/SSE3 instructions, + various signal/syscall things, and various problems with debug + info readers. + +* Support for glibc-2.3.3 based systems. + +We are now doing automatic overnight build-and-test runs on a variety +of distros. As a result, we believe 2.1.1 builds and runs on: +Red Hat 7.2, 7.3, 8.0, 9, Fedora Core 1, SuSE 8.2, SuSE 9. + + +The following bugs, and probably many more, have been fixed. These +are listed at http://bugs.kde.org. Reporting a bug for valgrind in +the http://bugs.kde.org is much more likely to get you a fix than +mailing developers directly, so please continue to keep sending bugs +there. + +69616 glibc 2.3.2 w/NPTL is massively different than what valgrind expects +69856 I don't know how to instrument MMXish stuff (Helgrind) +73892 valgrind segfaults starting with Objective-C debug info + (fix for S-type stabs) +73145 Valgrind complains too much about close(<reserved fd>) +73902 Shadow memory allocation seems to fail on RedHat 8.0 +68633 VG_N_SEMAPHORES too low (V itself was leaking semaphores) +75099 impossible to trace multiprocess programs +76839 the `impossible' happened: disInstr: INT but not 0x80 ! +76762 vg_to_ucode.c:3748 (dis_push_segreg): Assertion `sz == 4' failed. +76747 cannot include valgrind.h in c++ program +76223 parsing B(3,10) gave NULL type => impossible happens +75604 shmdt handling problem +76416 Problems with gcc 3.4 snap 20040225 +75614 using -gstabs when building your programs the `impossible' happened +75787 Patch for some CDROM ioctls CDORM_GET_MCN, CDROM_SEND_PACKET, +75294 gcc 3.4 snapshot's libstdc++ have unsupported instructions. + (REP RET) +73326 vg_symtab2.c:272 (addScopeRange): Assertion `range->size > 0' failed. +72596 not recognizing __libc_malloc +69489 Would like to attach ddd to running program +72781 Cachegrind crashes with kde programs +73055 Illegal operand at DXTCV11CompressBlockSSE2 (more SSE opcodes) +73026 Descriptor leak check reports port numbers wrongly +71705 README_MISSING_SYSCALL_OR_IOCTL out of date +72643 Improve support for SSE/SSE2 instructions +72484 valgrind leaves it's own signal mask in place when execing +72650 Signal Handling always seems to restart system calls +72006 The mmap system call turns all errors in ENOMEM +71781 gdb attach is pretty useless +71180 unhandled instruction bytes: 0xF 0xAE 0x85 0xE8 +69886 writes to zero page cause valgrind to assert on exit +71791 crash when valgrinding gimp 1.3 (stabs reader problem) +69783 unhandled syscall: 218 +69782 unhandled instruction bytes: 0x66 0xF 0x2B 0x80 +70385 valgrind fails if the soft file descriptor limit is less + than about 828 +69529 "rep; nop" should do a yield +70827 programs with lots of shared libraries report "mmap failed" + for some of them when reading symbols +71028 glibc's strnlen is optimised enough to confuse valgrind + + + + Unstable (cvs head) release 2.1.0 (15 December 2003) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
From: Julian S. <js...@ac...> - 2004-03-13 00:49:50
|
CVS commit by jseward: head --> 2.1.2-CVS so as to distinguish it from everything else :-) M +1 -1 configure.in 1.107 --- valgrind/configure.in #1.106:1.107 @@ -2,5 +2,5 @@ AC_INIT(coregrind/vg_main.c) # give me a source file, any source file... AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(valgrind, 2.1.1) +AM_INIT_AUTOMAKE(valgrind, 2.1.2-CVS) AM_MAINTAINER_MODE |
|
From: Jeremy F. <je...@go...> - 2004-03-13 02:07:10
|
CVS commit by fitzhardinge:
Fix bug 69872. This change adds a coredumper to vg_signal.c. This means
that when the client is killed by a coredumping signal, Valgrind will
generate the coredump itself, which is full of client state, rather than
Valgrind state; this core file will therefore be useful to the developer
in debugging their program.
The corefile generated is named vgcore.pidNNNNN (and maybe with .M on
the end in case of duplicates). If you set a logfile with --logfile,
then this name will be used as the basename for the core file, so that
both the core and the logs will be next to each other.
Valgrind respects the RLIMIT_CORE limit when generating the file; if the
limit is set to 0, then it will not generate one.
M +1 -0 coregrind/vg_include.h 1.185
M +12 -13 coregrind/vg_main.c 1.147
M +5 -0 coregrind/vg_memory.c 1.52
M +402 -0 coregrind/vg_signals.c 1.60
M +3 -3 coregrind/vg_syscalls.c 1.92
M +0 -1 coregrind/vg_unsafe.h 1.25
M +118 -0 include/vg_kerneliface.h 1.16
--- valgrind/coregrind/vg_include.h #1.184:1.185
@@ -1567,4 +1567,5 @@ extern Addr VG_(find_map_space)(Addr bas
extern Segment *VG_(find_segment)(Addr a);
+extern Segment *VG_(first_segment)(void);
extern Segment *VG_(next_segment)(Segment *);
--- valgrind/coregrind/vg_main.c #1.146:1.147
@@ -48,5 +48,4 @@
#include <sys/ptrace.h>
#include <sys/signal.h>
-#include <sys/user.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -312,10 +311,10 @@ void VG_(start_debugger) ( Int tid )
if (VG_(is_running_thread)( tid )) {
- regs.xcs = VG_(baseBlock)[VGOFF_(m_cs)];
- regs.xss = VG_(baseBlock)[VGOFF_(m_ss)];
- regs.xds = VG_(baseBlock)[VGOFF_(m_ds)];
- regs.xes = VG_(baseBlock)[VGOFF_(m_es)];
- regs.xfs = VG_(baseBlock)[VGOFF_(m_fs)];
- regs.xgs = VG_(baseBlock)[VGOFF_(m_gs)];
+ regs.cs = VG_(baseBlock)[VGOFF_(m_cs)];
+ regs.ss = VG_(baseBlock)[VGOFF_(m_ss)];
+ regs.ds = VG_(baseBlock)[VGOFF_(m_ds)];
+ regs.es = VG_(baseBlock)[VGOFF_(m_es)];
+ regs.fs = VG_(baseBlock)[VGOFF_(m_fs)];
+ regs.gs = VG_(baseBlock)[VGOFF_(m_gs)];
regs.eax = VG_(baseBlock)[VGOFF_(m_eax)];
regs.ebx = VG_(baseBlock)[VGOFF_(m_ebx)];
@@ -331,10 +330,10 @@ void VG_(start_debugger) ( Int tid )
ThreadState* tst = & VG_(threads)[ tid ];
- regs.xcs = tst->m_cs;
- regs.xss = tst->m_ss;
- regs.xds = tst->m_ds;
- regs.xes = tst->m_es;
- regs.xfs = tst->m_fs;
- regs.xgs = tst->m_gs;
+ regs.cs = tst->m_cs;
+ regs.ss = tst->m_ss;
+ regs.ds = tst->m_ds;
+ regs.es = tst->m_es;
+ regs.fs = tst->m_fs;
+ regs.gs = tst->m_gs;
regs.eax = tst->m_eax;
regs.ebx = tst->m_ebx;
--- valgrind/coregrind/vg_memory.c #1.51:1.52
@@ -552,4 +552,9 @@ Segment *VG_(find_segment)(Addr a)
}
+Segment *VG_(first_segment)(void)
+{
+ return VG_(SkipNode_First)(&sk_segments);
+}
+
Segment *VG_(next_segment)(Segment *s)
{
--- valgrind/coregrind/vg_signals.c #1.59:1.60
@@ -1278,4 +1278,393 @@ void VG_(kill_self)(Int sigNo)
/*
+ Dump core
+
+ Generate a standard ELF core file corresponding to the client state
+ at the time of a crash.
+ */
+#include <elf.h>
+#ifndef NT_PRXFPREG
+#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
+#endif /* NT_PRXFPREG */
+
+/* If true, then this Segment may be mentioned in the core */
+static Bool may_dump(const Segment *seg)
+{
+ return (seg->flags & SF_VALGRIND) == 0 && VG_(is_client_addr)(seg->addr);
+}
+
+/* If true, then this Segment's contents will be in the core */
+static Bool should_dump(const Segment *seg)
+{
+ return may_dump(seg); // && (seg->prot & VKI_PROT_WRITE);
+}
+
+static void fill_ehdr(Elf32_Ehdr *ehdr, Int num_phdrs)
+{
+ VG_(memset)(ehdr, 0, sizeof(ehdr));
+
+ VG_(memcpy)(ehdr->e_ident, ELFMAG, SELFMAG);
+ ehdr->e_ident[EI_CLASS] = ELFCLASS32;
+ ehdr->e_ident[EI_DATA] = ELFDATA2LSB;
+ ehdr->e_ident[EI_VERSION] = EV_CURRENT;
+ ehdr->e_ident[EI_OSABI] = ELFOSABI_LINUX;
+
+ ehdr->e_type = ET_CORE;
+ ehdr->e_machine = EM_386;
+ ehdr->e_version = EV_CURRENT;
+ ehdr->e_entry = 0;
+ ehdr->e_phoff = sizeof(Elf32_Ehdr);
+ ehdr->e_shoff = 0;
+ ehdr->e_flags = 0;
+ ehdr->e_ehsize = sizeof(Elf32_Ehdr);
+ ehdr->e_phentsize = sizeof(Elf32_Phdr);
+ ehdr->e_phnum = num_phdrs;
+ ehdr->e_shentsize = 0;
+ ehdr->e_shnum = 0;
+ ehdr->e_shstrndx = 0;
+
+}
+
+static void fill_phdr(Elf32_Phdr *phdr, const Segment *seg, UInt off, Bool write)
+{
+ write = write && should_dump(seg);
+
+ VG_(memset)(phdr, 0, sizeof(*phdr));
+
+ phdr->p_type = PT_LOAD;
+ phdr->p_offset = off;
+ phdr->p_vaddr = seg->addr;
+ phdr->p_paddr = 0;
+ phdr->p_filesz = write ? seg->len : 0;
+ phdr->p_memsz = seg->len;
+ phdr->p_flags = 0;
+
+ if (seg->prot & VKI_PROT_READ)
+ phdr->p_flags |= PF_R;
+ if (seg->prot & VKI_PROT_WRITE)
+ phdr->p_flags |= PF_W;
+ if (seg->prot & VKI_PROT_EXEC)
+ phdr->p_flags |= PF_X;
+
+ phdr->p_align = VKI_BYTES_PER_PAGE;
+}
+
+struct note {
+ struct note *next;
+ Elf32_Nhdr note;
+ Char name[0];
+};
+
+static UInt note_size(const struct note *n)
+{
+ return sizeof(Elf32_Nhdr) + ROUNDUP(VG_(strlen)(n->name)+1, 4) + ROUNDUP(n->note.n_descsz, 4);
+}
+
+static void add_note(struct note **list, const Char *name, UInt type, const void *data, UInt datasz)
+{
+ Int namelen = VG_(strlen)(name)+1;
+ Int notelen = sizeof(struct note) +
+ ROUNDUP(namelen, 4) +
+ ROUNDUP(datasz, 4);
+ struct note *n = VG_(arena_malloc)(VG_AR_CORE, notelen);
+
+ VG_(memset)(n, 0, notelen);
+
+ n->next = *list;
+ *list = n;
+
+ n->note.n_type = type;
+ n->note.n_namesz = namelen;
+ n->note.n_descsz = datasz;
+
+ VG_(memcpy)(n->name, name, namelen);
+ VG_(memcpy)(n->name+ROUNDUP(namelen,4), data, datasz);
+}
+
+static void write_note(Int fd, const struct note *n)
+{
+ VG_(write)(fd, &n->note, note_size(n));
+}
+
+static void fill_prpsinfo(const ThreadState *tst, struct elf_prpsinfo *prpsinfo)
+{
+ Char *name;
+
+ VG_(memset)(prpsinfo, 0, sizeof(*prpsinfo));
+
+ switch(tst->status) {
+ case VgTs_Runnable:
+ prpsinfo->pr_sname = 'R';
+ break;
+
+ case VgTs_WaitJoinee:
+ prpsinfo->pr_sname = 'Z';
+ prpsinfo->pr_zomb = 1;
+ break;
+
+ case VgTs_WaitJoiner:
+ case VgTs_WaitMX:
+ case VgTs_WaitCV:
+ case VgTs_WaitSys:
+ case VgTs_Sleeping:
+ prpsinfo->pr_sname = 'S';
+ break;
+
+ case VgTs_Empty:
+ /* ? */
+ break;
+ }
+
+ prpsinfo->pr_uid = 0;
+ prpsinfo->pr_gid = 0;
+
+ name = VG_(resolve_filename)(VG_(clexecfd));
+
+ if (name != NULL) {
+ Char *n = name+VG_(strlen)(name)-1;
+
+ while(n > name && *n != '/')
+ n--;
+ if (n != name)
+ n++;
+
+ VG_(strncpy)(prpsinfo->pr_fname, n, sizeof(prpsinfo->pr_fname));
+ }
+}
+
+static void fill_prstatus(const ThreadState *tst, struct elf_prstatus *prs, const vki_ksiginfo_t *si)
+{
+ struct user_regs_struct *regs;
+
+ VG_(memset)(prs, 0, sizeof(*prs));
+
+ prs->pr_info.si_signo = si->si_signo;
+ prs->pr_info.si_code = si->si_code;
+ prs->pr_info.si_errno = 0;
+
+ prs->pr_cursig = si->si_signo;
+
+ prs->pr_pid = VG_(main_pid) + tst->tid; /* just to distinguish threads from each other */
+ prs->pr_ppid = 0;
+ prs->pr_pgrp = VG_(main_pgrp);
+ prs->pr_sid = VG_(main_pgrp);
+
+ regs = (struct user_regs_struct *)prs->pr_reg;
+
+ vg_assert(sizeof(*regs) == sizeof(prs->pr_reg));
+
+ if (VG_(is_running_thread)(tst->tid)) {
+ regs->eflags = VG_(baseBlock)[VGOFF_(m_eflags)];
+ regs->esp = VG_(baseBlock)[VGOFF_(m_esp)];
+ regs->eip = VG_(baseBlock)[VGOFF_(m_eip)];
+
+ regs->ebx = VG_(baseBlock)[VGOFF_(m_ebx)];
+ regs->ecx = VG_(baseBlock)[VGOFF_(m_ecx)];
+ regs->edx = VG_(baseBlock)[VGOFF_(m_edx)];
+ regs->esi = VG_(baseBlock)[VGOFF_(m_esi)];
+ regs->edi = VG_(baseBlock)[VGOFF_(m_edi)];
+ regs->ebp = VG_(baseBlock)[VGOFF_(m_ebp)];
+ regs->eax = VG_(baseBlock)[VGOFF_(m_eax)];
+
+ regs->cs = VG_(baseBlock)[VGOFF_(m_cs)];
+ regs->ds = VG_(baseBlock)[VGOFF_(m_ds)];
+ regs->ss = VG_(baseBlock)[VGOFF_(m_ss)];
+ regs->es = VG_(baseBlock)[VGOFF_(m_es)];
+ regs->fs = VG_(baseBlock)[VGOFF_(m_fs)];
+ regs->gs = VG_(baseBlock)[VGOFF_(m_gs)];
+ } else {
+ regs->eflags = tst->m_eflags;
+ regs->esp = tst->m_esp;
+ regs->eip = tst->m_eip;
+
+ regs->ebx = tst->m_ebx;
+ regs->ecx = tst->m_ecx;
+ regs->edx = tst->m_edx;
+ regs->esi = tst->m_esi;
+ regs->edi = tst->m_edi;
+ regs->ebp = tst->m_ebp;
+ regs->eax = tst->m_eax;
+
+ regs->cs = tst->m_cs;
+ regs->ds = tst->m_ds;
+ regs->ss = tst->m_ss;
+ regs->es = tst->m_es;
+ regs->fs = tst->m_fs;
+ regs->gs = tst->m_gs;
+ }
+}
+
+static void fill_fpu(const ThreadState *tst, elf_fpregset_t *fpu)
+{
+ const Char *from;
+
+ if (VG_(is_running_thread)(tst->tid)) {
+ from = (const Char *)&VG_(baseBlock)[VGOFF_(m_ssestate)];
+ } else {
+ from = (const Char *)&tst->m_sse;
+ }
+
+ if (VG_(have_ssestate)) {
+ UShort *to;
+ Int i;
+
+ /* This is what the kernel does */
+ VG_(memcpy)(fpu, from, 7*sizeof(long));
+
+ to = (UShort *)&fpu->st_space[0];
+ from += 18 * sizeof(UShort);
+
+ for(i = 0; i < 8; i++, to += 5, from += 8)
+ VG_(memcpy)(to, from, 5*sizeof(UShort));
+ } else
+ VG_(memcpy)(fpu, from, sizeof(*fpu));
+}
+
+static void fill_xfpu(const ThreadState *tst, elf_fpxregset_t *xfpu)
+{
+ UShort *from;
+
+ if (VG_(is_running_thread)(tst->tid))
+ from = (UShort *)&VG_(baseBlock)[VGOFF_(m_ssestate)];
+ else
+ from = (UShort *)tst->m_sse;
+
+ VG_(memcpy)(xfpu, from, sizeof(*xfpu));
+}
+
+static void make_coredump(ThreadId tid, const vki_ksiginfo_t *si, UInt max_size)
+{
+ Char buf[1000];
+ Char *basename = "vgcore";
+ Char *coreext = "";
+ Int seq = 0;
+ Int core_fd;
+ Segment *seg;
+ Elf32_Ehdr ehdr;
+ Elf32_Phdr *phdrs;
+ Int num_phdrs;
+ Int i;
+ UInt off;
+ struct note *notelist, *note;
+ UInt notesz;
+ struct elf_prpsinfo prpsinfo;
+ struct elf_prstatus prstatus;
+
+ if (VG_(clo_logfile_name) != NULL) {
+ coreext = ".core";
+ basename = VG_(clo_logfile_name);
+ }
+
+ for(;;) {
+ if (seq == 0)
+ VG_(sprintf)(buf, "%s%s.pid%d",
+ basename, coreext, VG_(main_pid));
+ else
+ VG_(sprintf)(buf, "%s%s.pid%d.%d",
+ basename, coreext, VG_(main_pid), seq);
+ seq++;
+
+ core_fd = VG_(open)(buf,
+ VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,
+ VKI_S_IRUSR|VKI_S_IWUSR);
+ if (core_fd >= 0)
+ break;
+
+ if (core_fd != -VKI_EEXIST)
+ return; /* can't create file */
+ }
+
+ /* First, count how many memory segments to dump */
+ num_phdrs = 1; /* start with notes */
+ for(seg = VG_(first_segment)();
+ seg != NULL;
+ seg = VG_(next_segment)(seg)) {
+ if (!may_dump(seg))
+ continue;
+
+ num_phdrs++;
+ }
+
+ fill_ehdr(&ehdr, num_phdrs);
+
+ /* Second, work out their layout */
+ phdrs = VG_(arena_malloc)(VG_AR_CORE, sizeof(*phdrs) * num_phdrs);
+
+ for(i = 1; i < VG_N_THREADS; i++) {
+ elf_fpregset_t fpu;
+
+ if (VG_(threads)[i].status == VgTs_Empty)
+ continue;
+
+ if (VG_(have_ssestate)) {
+ elf_fpxregset_t xfpu;
+
+ fill_xfpu(&VG_(threads)[i], &xfpu);
+ add_note(¬elist, "LINUX", NT_PRXFPREG, &xfpu, sizeof(xfpu));
+ }
+
+ fill_fpu(&VG_(threads)[i], &fpu);
+ add_note(¬elist, "CORE", NT_FPREGSET, &fpu, sizeof(fpu));
+
+ fill_prstatus(&VG_(threads)[i], &prstatus, si);
+ add_note(¬elist, "CORE", NT_PRSTATUS, &prstatus, sizeof(prstatus));
+ }
+
+ fill_prpsinfo(&VG_(threads)[tid], &prpsinfo);
+ add_note(¬elist, "CORE", NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo));
+
+ for(note = notelist, notesz = 0; note != NULL; note = note->next)
+ notesz += note_size(note);
+
+ off = sizeof(ehdr) + sizeof(*phdrs) * num_phdrs;
+
+ phdrs[0].p_type = PT_NOTE;
+ phdrs[0].p_offset = off;
+ phdrs[0].p_vaddr = 0;
+ phdrs[0].p_paddr = 0;
+ phdrs[0].p_filesz = notesz;
+ phdrs[0].p_memsz = 0;
+ phdrs[0].p_flags = 0;
+ phdrs[0].p_align = 0;
+
+ off += notesz;
+
+ off = PGROUNDUP(off);
+
+ for(seg = VG_(first_segment)(), i = 1;
+ seg != NULL;
+ seg = VG_(next_segment)(seg), i++) {
+ if (!may_dump(seg))
+ continue;
+
+ fill_phdr(&phdrs[i], seg, off, (seg->len + off) < max_size);
+
+ off += phdrs[i].p_filesz;
+ }
+
+ /* write everything out */
+ VG_(write)(core_fd, &ehdr, sizeof(ehdr));
+ VG_(write)(core_fd, phdrs, sizeof(*phdrs) * num_phdrs);
+
+ for(note = notelist; note != NULL; note = note->next)
+ write_note(core_fd, note);
+
+ VG_(lseek)(core_fd, phdrs[1].p_offset, VKI_SEEK_SET);
+
+ for(seg = VG_(first_segment)(), i = 1;
+ seg != NULL;
+ seg = VG_(next_segment)(seg), i++) {
+ if (!should_dump(seg))
+ continue;
+
+ vg_assert(VG_(lseek)(core_fd, 0, VKI_SEEK_CUR) == phdrs[i].p_offset);
+ if (phdrs[i].p_filesz > 0)
+ VG_(write)(core_fd, (void *)seg->addr, seg->len);
+ }
+
+ VG_(close)(core_fd);
+}
+
+/*
Perform the default action of a signal. Returns if the default
action isn't fatal.
@@ -1396,4 +1785,17 @@ static void vg_default_action(const vki_
}
+ if (core) {
+ static struct vki_rlimit zero = { 0, 0 };
+ struct vki_rlimit corelim;
+
+ VG_(getrlimit)(VKI_RLIMIT_CORE, &corelim);
+
+ if (corelim.rlim_cur > 0)
+ make_coredump(tid, info, corelim.rlim_cur);
+
+ /* make sure we don't get a confusing kernel-generated coredump */
+ VG_(setrlimit)(VKI_RLIMIT_CORE, &zero);
+ }
+
if (VG_(fatal_signal_set)) {
VG_(fatal_sigNo) = sigNo;
--- valgrind/coregrind/vg_syscalls.c #1.91:1.92
@@ -1148,5 +1148,5 @@ PRE(ptrace)
case 14: /* PTRACE_GETFPREGS */
SYSCALL_TRACK( pre_mem_write, tid, "ptrace(getfpregs)", arg4,
- sizeof (struct user_fpregs_struct));
+ sizeof (struct user_i387_struct));
break;
case 18: /* PTRACE_GETFPXREGS */
@@ -1164,5 +1164,5 @@ PRE(ptrace)
case 15: /* PTRACE_SETFPREGS */
SYSCALL_TRACK( pre_mem_read, tid, "ptrace(setfpregs)", arg4,
- sizeof (struct user_fpregs_struct));
+ sizeof (struct user_i387_struct));
break;
case 19: /* PTRACE_SETFPXREGS */
@@ -1188,5 +1188,5 @@ POST(ptrace)
case 14: /* PTRACE_GETFPREGS */
VG_TRACK( post_mem_write, arg4,
- sizeof (struct user_fpregs_struct));
+ sizeof (struct user_i387_struct));
break;
case 18: /* PTRACE_GETFPXREGS */
--- valgrind/coregrind/vg_unsafe.h #1.24:1.25
@@ -62,5 +62,4 @@
#include <linux/sysctl.h> /* for struct __sysctl_args */
#include <linux/cdrom.h> /* for cd-rom ioctls */
-#include <sys/user.h> /* for struct user_regs_struct et al */
#include <signal.h> /* for siginfo_t */
#include <linux/timex.h> /* for adjtimex */
--- valgrind/include/vg_kerneliface.h #1.15:1.16
@@ -764,4 +764,122 @@ struct statfs64 {
#define VKI_FUTEX_REQUEUE 3
+/*
+ * linux/elfcore.h
+ */
+
+struct elf_siginfo
+{
+ int si_signo; /* signal number */
+ int si_code; /* extra code */
+ int si_errno; /* errno */
+};
+
+/*
+ * This is the old layout of "struct pt_regs", and
+ * is still the layout used by user mode (the new
+ * pt_regs doesn't have all registers as the kernel
+ * doesn't use the extra segment registers)
+ */
+struct user_regs_struct {
+ long ebx, ecx, edx, esi, edi, ebp, eax;
+ unsigned short ds, __ds, es, __es;
+ unsigned short fs, __fs, gs, __gs;
+ long orig_eax, eip;
+ unsigned short cs, __cs;
+ long eflags, esp;
+ unsigned short ss, __ss;
+};
+
+struct user_i387_struct {
+ long cwd;
+ long swd;
+ long twd;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
+};
+
+struct user_fxsr_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long mxcsr;
+ long reserved;
+ long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
+ long padding[56];
+};
+
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_i387_struct elf_fpregset_t;
+typedef struct user_fxsr_struct elf_fpxregset_t;
+
+
+/*
+ * Definitions to generate Intel SVR4-like core files.
+ * These mostly have the same names as the SVR4 types with "elf_"
+ * tacked on the front to prevent clashes with linux definitions,
+ * and the typedef forms have been avoided. This is mostly like
+ * the SVR4 structure, but more Linuxy, with things that Linux does
+ * not support and which gdb doesn't really use excluded.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+#if 0
+ long pr_flags; /* XXX Process flags */
+ short pr_why; /* XXX Reason for process halt */
+ short pr_what; /* XXX More detailed reason */
+#endif
+ struct elf_siginfo pr_info; /* Info associated with signal */
+ short pr_cursig; /* Current signal */
+ unsigned long pr_sigpend; /* Set of pending signals */
+ unsigned long pr_sighold; /* Set of held signals */
+#if 0
+ struct sigaltstack pr_altstack; /* Alternate stack info */
+ struct sigaction pr_action; /* Signal action for current sig */
+#endif
+ Int pr_pid;
+ Int pr_ppid;
+ Int pr_pgrp;
+ Int pr_sid;
+ struct vki_timeval pr_utime; /* User time */
+ struct vki_timeval pr_stime; /* System time */
+ struct vki_timeval pr_cutime; /* Cumulative user time */
+ struct vki_timeval pr_cstime; /* Cumulative system time */
+#if 0
+ long pr_instr; /* Current instruction */
+#endif
+ elf_gregset_t pr_reg; /* GP registers */
+ int pr_fpvalid; /* True if math co-processor being used. */
+};
+
+#define ELF_PRARGSZ (80) /* Number of chars for args */
+
+struct elf_prpsinfo
+{
+ char pr_state; /* numeric process state */
+ char pr_sname; /* char for pr_state */
+ char pr_zomb; /* zombie */
+ char pr_nice; /* nice val */
+ unsigned long pr_flag; /* flags */
+ Int pr_uid;
+ Int pr_gid;
+ Int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* filename of executable */
+ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
+};
#endif /* __VG_KERNELIFACE_H */
|
|
From: Tom H. <th...@cy...> - 2004-03-15 16:44:11
|
CVS commit by thughes:
Move the handling of PSHUFW from the SSE code to the MMX code so that
it will work on older Athlons which only have MMXEXT support.
M +19 -0 cachegrind/cg_main.c 1.65
M +50 -0 coregrind/vg_from_ucode.c 1.75
M +57 -9 coregrind/vg_to_ucode.c 1.133
M +17 -8 coregrind/vg_translate.c 1.71
M +17 -0 helgrind/hg_main.c 1.74
M +9 -0 include/vg_skin.h.base 1.16
M +19 -0 memcheck/mc_translate.c 1.37
--- valgrind/cachegrind/cg_main.c #1.64:1.65
@@ -605,4 +605,11 @@ static Int compute_BBCC_array_size(UCode
break;
+ case MMX2a1_MemRd:
+ sk_assert(u_in->size == 8);
+ sk_assert(!is_LOAD && !is_STORE && !is_FPU_R && !is_FPU_W);
+ t_read = u_in->val3;
+ is_FPU_R = True;
+ break;
+
case SSE2a_MemRd:
case SSE2a1_MemRd:
@@ -858,4 +865,16 @@ UCodeBlock* SK_(instrument)(UCodeBlock*
VG_(copy_UInstr)(cb, u_in);
break;
+ break;
+
+ case MMX2a1_MemRd:
+ sk_assert(u_in->size == 8);
+ t_read = u_in->val3;
+ t_read_addr = newTemp(cb);
+ uInstr2(cb, MOV, 4, TempReg, u_in->val3, TempReg, t_read_addr);
+ data_size = ( u_in->size <= MIN_LINE_SIZE
+ ? u_in->size
+ : MIN_LINE_SIZE);
+ VG_(copy_UInstr)(cb, u_in);
+ break;
case SSE2a_MemRd:
--- valgrind/coregrind/vg_from_ucode.c #1.74:1.75
@@ -1498,4 +1498,26 @@ static void emit_MMX2_regmem ( FlagSet u
}
+static void emit_MMX2a1 ( FlagSet uses_sflags,
+ FlagSet sets_sflags,
+ UChar first_byte,
+ UChar second_byte,
+ UChar third_byte,
+ Int ireg )
+{
+ VG_(new_emit)(True, uses_sflags, sets_sflags);
+
+ boundscheck();
+
+ VG_(emitB) ( 0x0F );
+ VG_(emitB) ( first_byte );
+ second_byte &= 0x38; /* mask out mod and rm fields */
+ emit_amode_regmem_reg ( ireg, second_byte >> 3 );
+ VG_(emitB) ( third_byte );
+ if (dis)
+ VG_(printf)("\n\t\tmmx2a1-0x%x:0x%x:0x%x-(%s)\n",
+ (UInt)first_byte, (UInt)second_byte, (UInt)third_byte,
+ nameIReg(4,ireg) );
+}
+
static void emit_SSE2a ( FlagSet uses_sflags,
FlagSet sets_sflags,
@@ -3274,4 +3296,15 @@ static void synth_MMX2_regmem ( Bool use
+static void synth_MMX2a1 ( Bool uses_flags, Bool sets_flags,
+ UChar first_byte,
+ UChar second_byte,
+ UChar third_byte,
+ Int ireg )
+{
+ emit_MMX2a1 ( uses_flags, sets_flags,
+ first_byte, second_byte, third_byte, ireg );
+}
+
+
static void synth_MMX2_reg_to_mmxreg ( Bool uses_flags, Bool sets_flags,
UChar first_byte,
@@ -4077,4 +4110,21 @@ static void emitUInstr ( UCodeBlock* cb,
break;
+ case MMX2a1_MemRd:
+ vg_assert(u->size == 8);
+ vg_assert(u->tag1 == Lit16);
+ vg_assert(u->tag2 == Lit16);
+ vg_assert(u->tag3 == RealReg);
+ vg_assert(!anyFlagUse(u));
+ if (!(*sselive)) {
+ emit_get_sse_state();
+ *sselive = True;
+ }
+ synth_MMX2a1 ( u->flags_r, u->flags_w,
+ (u->val1 >> 8) & 0xFF,
+ u->val1 & 0xFF,
+ u->val2 & 0xFF,
+ u->val3 );
+ break;
+
case MMX2_ERegRd:
vg_assert(u->tag1 == Lit16);
--- valgrind/coregrind/vg_to_ucode.c #1.132:1.133
@@ -3290,4 +3290,55 @@ Addr dis_MMXop_regmem_to_reg ( UCodeBloc
+/* Simple MMX operations, either
+ op (src)mmxreg, (dst)mmxreg
+ or
+ op (src)address, (dst)mmxreg
+ opc is the byte following the 0x0F prefix.
+*/
+static
+Addr dis_MMXop_regmem_to_reg_Imm8 ( UCodeBlock* cb,
+ UChar sorb,
+ Addr eip,
+ UChar opc,
+ Char* name,
+ Bool show_granularity )
+{
+ Char dis_buf[50];
+ UChar modrm = getUChar(eip);
+ UChar imm8;
+ Bool isReg = epartIsReg(modrm);
+
+ if (isReg) {
+ eip++;
+ imm8 = getUChar(eip);
+ eip++;
+ uInstr2(cb, MMX3, 0,
+ Lit16,
+ (((UShort)(opc)) << 8) | ((UShort)modrm),
+ Lit16,
+ ((UShort)imm8));
+ } else {
+ UInt pair = disAMode ( cb, sorb, eip, dis_buf );
+ Int tmpa = LOW24(pair);
+ eip += HI8(pair);
+ imm8 = getUChar(eip);
+ eip++;
+ uInstr3(cb, MMX2a1_MemRd, 8,
+ Lit16,
+ (((UShort)(opc)) << 8) | ((UShort)modrm),
+ Lit16,
+ ((UShort)imm8),
+ TempReg, tmpa);
+ }
+
+ DIP("%s%s %s, %s, $%d\n",
+ name, show_granularity ? nameMMXGran(opc & 3) : (Char*)"",
+ ( isReg ? nameMMXReg(eregOfRM(modrm)) : dis_buf ),
+ nameMMXReg(gregOfRM(modrm)), (Int)imm8 );
+
+ return eip;
+}
+
+
/* Simple SSE operations, either
@@ -4218,13 +4269,4 @@ static Addr disInstr ( UCodeBlock* cb, A
}
- /* PSHUFW */
- if (sz == 4
- && insn[0] == 0x0F && insn[1] == 0x70) {
- eip = dis_SSE2_reg_or_mem_Imm8 ( cb, sorb, eip+2, 8,
- "pshufw",
- insn[0], insn[1] );
- goto decode_success;
- }
-
/* SHUFPD */
if (sz == 2 && insn[0] == 0x0F && insn[1] == 0xC6) {
@@ -7144,4 +7186,10 @@ static Addr disInstr ( UCodeBlock* cb, A
break;
+ case 0x70:
+ /* PSHUFW imm8, (src)mmxreg-or-mem, (dst)mmxreg */
+ vg_assert(sz == 4);
+ eip = dis_MMXop_regmem_to_reg_Imm8 ( cb, sorb, eip, opc, "pshufw", False );
+ break;
+
case 0xD7:
/* PMOVMSKB (src)mmxreg, (dst)ireg */
--- valgrind/coregrind/vg_translate.c #1.70:1.71
@@ -562,4 +562,5 @@ Bool VG_(saneUInstr) ( Bool beforeRA, Bo
case MMX2_MemRd: return LIT0 && SZ48 && CC0 && Ls1 && TR2 && N3 && XOTHER;
case MMX2_MemWr: return LIT0 && SZ48 && CC0 && Ls1 && TR2 && N3 && XOTHER;
+ case MMX2a1_MemRd: return LIT0 && SZ8 && CC0 && Ls1 && Ls2 && TR3 && XOTHER;
case MMX2_ERegRd: return LIT0 && SZ4 && CC0 && Ls1 && TR2 && N3 && XOTHER;
case MMX2_ERegWr: return LIT0 && SZ4 && CC0 && Ls1 && TR2 && N3 && XOTHER;
@@ -898,4 +899,5 @@ Char* VG_(name_UOpcode) ( Bool upper, Op
case MMX2_MemRd: return "MMX2_MRd" ;
case MMX2_MemWr: return "MMX2_MWr" ;
+ case MMX2a1_MemRd: return "MMX2a1_MRd" ;
case MMX2_ERegRd: return "MMX2_eRRd" ;
case MMX2_ERegWr: return "MMX2_eRWr" ;
@@ -1068,4 +1070,10 @@ void pp_UInstrWorker ( Int instrNo, UIns
break;
+ case MMX2a1_MemRd:
+ VG_(printf)("0x%x:0x%x:0x%x",
+ (u->val1 >> 8) & 0xFF, u->val1 & 0xFF, u->val2 & 0xFF );
+ VG_(pp_UOperand)(u, 3, 4, True);
+ break;
+
case SSE2a_MemWr:
case SSE2a_MemRd:
@@ -1297,4 +1305,5 @@ Int VG_(get_reg_usage) ( UInstr* u, Tag
case SSE3ag_MemRd_RegWr: RD(1); WR(2); break;
+ case MMX2a1_MemRd: RD(3); break;
case MMX2_ERegRd: RD(2); break;
case MMX2_ERegWr: WR(2); break;
@@ -1452,5 +1461,5 @@ Int maybe_uinstrReadsArchReg ( UInstr* u
case FPU: case FPU_R: case FPU_W:
case MMX1: case MMX2: case MMX3:
- case MMX2_MemRd: case MMX2_MemWr:
+ case MMX2_MemRd: case MMX2_MemWr: case MMX2a1_MemRd:
case MMX2_ERegRd: case MMX2_ERegWr:
case SSE2a_MemWr: case SSE2a_MemRd: case SSE2a1_MemRd:
--- valgrind/helgrind/hg_main.c #1.73:1.74
@@ -2146,4 +2146,21 @@ UCodeBlock* SK_(instrument) ( UCodeBlock
}
+ case MMX2a1_MemRd: {
+ sk_assert(8 == u_in->size);
+
+ t_size = newTemp(cb);
+ uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_size);
+ uLiteral(cb, (UInt)u_in->size);
+
+ /* XXX all registers should be flushed to baseblock
+ here */
+ uInstr2(cb, CCALL, 0, TempReg, u_in->val3, TempReg, t_size);
+ uCCall(cb, (Addr) & eraser_mem_help_read_N, 2, 2, False);
+
+ VG_(copy_UInstr)(cb, u_in);
+ t_size = INVALID_TEMPREG;
+ break;
+ }
+
case SSE2a_MemRd:
case SSE2a1_MemRd:
--- valgrind/include/vg_skin.h.base #1.15:1.16
@@ -666,4 +666,13 @@
MMX2_MemWr,
+ /* 3 bytes, reads/writes mem. Insns of the form
+ bbbbbbbb:mod mmxreg r/m:bbbbbbbb
+ Held in val1[15:0] and val2[7:0], and mod and rm are to be
+ replaced at codegen time by a reference to the Temp/RealReg
+ holding the address. Arg2 holds this Temp/Real Reg.
+ Transfer is always at size 8.
+ */
+ MMX2a1_MemRd,
+
/* 2 bytes, reads/writes an integer ("E") register. Insns of the form
bbbbbbbb:11 mmxreg ireg.
--- valgrind/memcheck/mc_translate.c #1.36:1.37
@@ -1076,4 +1076,23 @@ static UCodeBlock* memcheck_instrument (
}
+ case MMX2a1_MemRd: {
+ Int t_size = INVALID_TEMPREG;
+
+ sk_assert(u_in->size == 8);
+
+ sk_assert(u_in->tag3 == TempReg);
+ uInstr1(cb, TESTV, 4, TempReg, SHADOW(u_in->val3));
+ uInstr1(cb, SETV, 4, TempReg, SHADOW(u_in->val3));
+
+ t_size = newTemp(cb);
+ uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_size);
+ uLiteral(cb, u_in->size);
+ uInstr2(cb, CCALL, 0, TempReg, u_in->val3, TempReg, t_size);
+ uCCall(cb, (Addr) & MC_(fpu_read_check), 2, 2, False);
+
+ VG_(copy_UInstr)(cb, u_in);
+ break;
+ }
+
/* SSE ins referencing scalar integer registers */
case SSE2g_RegWr:
|