|
From: Nicholas N. <nj...@ca...> - 2004-10-09 16:01:01
|
CVS commit by nethercote:
Add README_DEVELOPERS to the 'make dist' tarball (since it's mentioned in
README), and add some instructions about attaching GDB to Valgrind itself
within it.
This fixes bug 90138.
MERGED FROM HEAD
M +1 -0 Makefile.am 1.69.2.1
M +16 -0 README_DEVELOPERS 1.2.2.1
--- valgrind/Makefile.am #1.69:1.69.2.1
@@ -43,4 +43,5 @@
FAQ.txt \
ACKNOWLEDGEMENTS \
+ README_DEVELOPERS \
README_PACKAGERS \
README_MISSING_SYSCALL_OR_IOCTL TODO \
--- valgrind/README_DEVELOPERS #1.2:1.2.2.1
@@ -32,2 +32,18 @@
perl tests/vg_regtest memcheck/tests/badfree
+
+Debugging Valgrind with GDB
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+To debug Valgrind itself with GDB, start Valgrind like this:
+
+ valgrind --tool=none --wait-for-gdb=yes <prog>
+
+Then start gdb like this in another terminal:
+
+ gdb /usr/lib/valgrind/stage2 <pid>
+
+Where <pid> is the pid valgrind printed. Then set whatever breakpoints
+you want and do this in gdb:
+
+ jump *$eip
+
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-28 16:54:09
|
CVS commit by nethercote:
Fix off-by-one error with VKI_GDT_TLS_MAX.
M +1 -1 coregrind/vg_ldt.c 1.16.2.1
M +1 -1 include/vg_kerneliface.h 1.23.2.1
--- valgrind/coregrind/vg_ldt.c #1.16:1.16.2.1
@@ -197,5 +197,5 @@ Addr VG_(do_useseg) ( UInt seg_selector,
VgLdtEntry* the_tls;
- vg_assert(seg_selector >= VKI_GDT_TLS_MIN && seg_selector < VKI_GDT_TLS_MAX);
+ vg_assert(seg_selector >= VKI_GDT_TLS_MIN && seg_selector <= VKI_GDT_TLS_MAX);
/* Come up with a suitable GDT entry. We look at the thread's TLS
--- valgrind/include/vg_kerneliface.h #1.23:1.23.2.1
@@ -666,5 +666,5 @@ typedef struct vki_modify_ldt_ldt_s {
#define VKI_GDT_TLS_ENTRIES 3
#define VKI_GDT_TLS_MIN 6
-#define VKI_GDT_TLS_MAX (VKI_GDT_TLS_MIN + VKI_GDT_TLS_ENTRIES)
+#define VKI_GDT_TLS_MAX (VKI_GDT_TLS_MIN + VKI_GDT_TLS_ENTRIES - 1)
/* Flags for clone() */
|
|
From: Nicholas N. <nj...@ca...> - 2004-11-15 19:07:16
|
CVS commit by nethercote:
Fixed bug #93328, by using the right sized types in sigprocmask(), and
converting them as necessary.
Fixed some compiler warnings by renaming two variables, too.
(partly) MERGED FROM HEAD
M +45 -10 coregrind/vg_syscalls.c 1.131.2.2
M +2 -0 include/vg_kerneliface.h 1.23.2.2
--- valgrind/coregrind/vg_syscalls.c #1.131.2.1:1.131.2.2
@@ -120,5 +120,5 @@ static void do_atfork_child(ThreadId tid
/* return true if address range entirely contained within client
address space */
-static Bool valid_client_addr(Addr start, UInt size, ThreadId tid, const Char *syscall)
+static Bool valid_client_addr(Addr start, UInt size, ThreadId tid, const Char *syscallname)
{
Addr end = start+size;
@@ -139,9 +139,9 @@ static Bool valid_client_addr(Addr start
if (0)
VG_(printf)("%s: test=%p-%p client=%p-%p ret=%d\n",
- syscall, start, end, cl_base, VG_(client_end), ret);
+ syscallname, start, end, cl_base, VG_(client_end), ret);
- if (!ret && syscall != NULL) {
+ if (!ret && syscallname != NULL) {
VG_(message)(Vg_UserMsg, "Warning: client syscall %s tried to modify addresses %p-%p",
- syscall, start, end);
+ syscallname, start, end);
if (VG_(clo_verbosity) > 1) {
@@ -972,10 +972,10 @@ static Addr do_brk(Addr newbrk)
/* Return true if we're allowed to use or create this fd */
-static Bool fd_allowed(Int fd, const Char *syscall, ThreadId tid, Bool soft)
+static Bool fd_allowed(Int fd, const Char *syscallname, ThreadId tid, Bool soft)
{
if (fd < 0 || fd >= VG_(fd_hard_limit) || fd == VG_(clo_log_fd)) {
VG_(message)(Vg_UserMsg,
"Warning: invalid file descriptor %d in syscall %s()",
- fd, syscall);
+ fd, syscallname);
if (fd == VG_(clo_log_fd))
VG_(message)(Vg_UserMsg,
@@ -5491,4 +5491,42 @@ PRE(sigprocmask)
arg3, sizeof(vki_ksigset_t));
+ if (SIGNAL_SIMULATION) {
+ // Nb: We must convert the smaller vki_old_ksigset_t params into bigger
+ // vki_ksigset_t params.
+ vki_old_ksigset_t* set = (vki_old_ksigset_t*)arg2;
+ vki_old_ksigset_t* oldset = (vki_old_ksigset_t*)arg3;
+ vki_ksigset_t bigger_set;
+ vki_ksigset_t bigger_oldset;
+
+ VG_(memset)(&bigger_set, 0, sizeof(vki_ksigset_t));
+ bigger_set.ws[0] = *(vki_old_ksigset_t*)set;
+
+ VG_(do__NR_sigprocmask) ( tid,
+ arg1 /*how*/,
+ &bigger_set,
+ &bigger_oldset );
+
+ *oldset = bigger_oldset.ws[0];
+ }
+}
+
+POST(sigprocmask)
+{
+ if (res == 0 && arg3 != (UInt)NULL)
+ VG_TRACK( post_mem_write, arg3, sizeof(vki_old_ksigset_t));
+}
+
+PRE(rt_sigprocmask)
+{
+ /* int rt_sigprocmask(int how, k_sigset_t *set,
+ k_sigset_t *oldset, size_t sigsetsize); */
+ MAYBE_PRINTF("rt_sigprocmask ( %d, %p, %p )\n",arg1,arg2,arg3);
+ if (arg2 != (UInt)NULL)
+ SYSCALL_TRACK( pre_mem_read, tid, "rt_sigprocmask(set)",
+ arg2, sizeof(vki_ksigset_t));
+ if (arg3 != (UInt)NULL)
+ SYSCALL_TRACK( pre_mem_write, tid, "rt_sigprocmask(oldset)",
+ arg3, sizeof(vki_ksigset_t));
+
if (SIGNAL_SIMULATION)
VG_(do__NR_sigprocmask) ( tid,
@@ -5498,5 +5536,5 @@ PRE(sigprocmask)
}
-POST(sigprocmask)
+POST(rt_sigprocmask)
{
if (res == 0 && arg3 != (UInt)NULL)
@@ -5504,7 +5542,4 @@ POST(sigprocmask)
}
-PREALIAS(rt_sigprocmask, sigprocmask);
-POSTALIAS(rt_sigprocmask, sigprocmask);
-
PRE(sigpending)
{
--- valgrind/include/vg_kerneliface.h #1.23.2.1:1.23.2.2
@@ -63,4 +63,6 @@
#define VKI_KNSIG_WORDS (VKI_KNSIG / VKI_KNSIG_BPW)
+typedef unsigned long vki_old_ksigset_t;
+
typedef
struct {
|
|
From: Tom H. <th...@cy...> - 2004-11-26 00:06:14
|
CVS commit by thughes:
Round the address hint down to a page boundary when looking for some
space to use - this prevents valgrind asserting and is consistent with
the documented mmap behaviour which doesn't require the address hint to
be page aligned unless MAP_FIXED is specified.
MERGE TO STABLE
A none/tests/map_unaligned.c 1.1.2.1 [no copyright]
A none/tests/map_unaligned.stderr.exp 1.1.2.1
A none/tests/map_unaligned.vgtest 1.1.2.1
M +1 -1 coregrind/vg_memory.c 1.66.2.2
M +4 -2 none/tests/Makefile.am 1.43.2.2
--- valgrind/coregrind/vg_memory.c #1.66.2.1:1.66.2.2
@@ -501,5 +501,5 @@ Addr VG_(find_map_space)(Addr addr, UInt
/* leave space for redzone and still try to get the exact
address asked for */
- addr -= VKI_BYTES_PER_PAGE;
+ addr = PGROUNDDN(addr) - VKI_BYTES_PER_PAGE;
}
ret = addr;
--- valgrind/none/tests/Makefile.am #1.43.2.1:1.43.2.2
@@ -41,4 +41,5 @@
$(addsuffix .vgtest,$(INSN_TESTS)) \
int.stderr.exp int.stdout.exp int.vgtest \
+ map_unaligned.stderr.exp map_unaligned.vgtest \
map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
mq.stderr.exp mq.vgtest \
@@ -74,6 +75,6 @@
args badseg bitfield1 bt_everything bt_literal closeall coolo_strlen \
cpuid dastest discard exec-sigmask execve fcntl_setown floored fork \
- fpu_lazy_eflags fucomip $(INSN_TESTS) \
- int munmap_exe map_unmap mq mremap rcl_assert rcrl readline1 \
+ fpu_lazy_eflags fucomip $(INSN_TESTS) int munmap_exe \
+ map_unaligned map_unmap mq mremap rcl_assert rcrl readline1 \
resolv rlimit_nofile seg_override sem semlimit sha1_test \
shortpush shorts smc1 susphello pth_blockedsig pth_stackalign \
@@ -118,4 +119,5 @@
insn_sse2_LDADD = -lm
int_SOURCES = int.c
+map_unaligned_SOURCES = map_unaligned.c
map_unmap_SOURCES = map_unmap.c
mq_SOURCES = mq.c
|
|
From: Tom H. <th...@cy...> - 2005-01-02 16:24:07
|
CVS commit by thughes:
Complete PINSRW support - we weren't handling the case with one
operand in memory rather than a register.
MERGE TO STABLE
M +4 -0 addrcheck/tests/insn_sse.stdout.exp 1.2.2.1
M +8 -0 addrcheck/tests/insn_sse2.stdout.exp 1.2.2.1
M +4 -0 cachegrind/tests/insn_sse.stdout.exp 1.2.2.1
M +8 -0 cachegrind/tests/insn_sse2.stdout.exp 1.2.2.1
M +25 -7 coregrind/vg_to_ucode.c 1.146.2.2
M +4 -0 helgrind/tests/insn_sse.stdout.exp 1.2.2.1
M +8 -0 helgrind/tests/insn_sse2.stdout.exp 1.2.2.1
M +4 -0 memcheck/tests/insn_sse.stdout.exp 1.2.2.1
M +8 -0 memcheck/tests/insn_sse2.stdout.exp 1.2.2.1
M +4 -0 none/tests/insn_sse.def 1.3.2.1
M +4 -0 none/tests/insn_sse.stdout.exp 1.2.2.1
M +8 -0 none/tests/insn_sse2.def 1.3.2.1
M +8 -0 none/tests/insn_sse2.stdout.exp 1.2.2.1
--- valgrind/addrcheck/tests/insn_sse.stdout.exp #1.2:1.2.2.1
@@ -95,4 +95,8 @@
pinsrw_3 ... ok
pinsrw_4 ... ok
+pinsrw_5 ... ok
+pinsrw_6 ... ok
+pinsrw_7 ... ok
+pinsrw_8 ... ok
pmaxsw_1 ... ok
pmaxsw_2 ... ok
--- valgrind/addrcheck/tests/insn_sse2.stdout.exp #1.2:1.2.2.1
@@ -176,4 +176,12 @@
pinsrw_7 ... ok
pinsrw_8 ... ok
+pinsrw_9 ... ok
+pinsrw_10 ... ok
+pinsrw_11 ... ok
+pinsrw_12 ... ok
+pinsrw_13 ... ok
+pinsrw_14 ... ok
+pinsrw_15 ... ok
+pinsrw_16 ... ok
pmaddwd_1 ... ok
pmaddwd_2 ... ok
--- valgrind/cachegrind/tests/insn_sse.stdout.exp #1.2:1.2.2.1
@@ -95,4 +95,8 @@
pinsrw_3 ... ok
pinsrw_4 ... ok
+pinsrw_5 ... ok
+pinsrw_6 ... ok
+pinsrw_7 ... ok
+pinsrw_8 ... ok
pmaxsw_1 ... ok
pmaxsw_2 ... ok
--- valgrind/cachegrind/tests/insn_sse2.stdout.exp #1.2:1.2.2.1
@@ -176,4 +176,12 @@
pinsrw_7 ... ok
pinsrw_8 ... ok
+pinsrw_9 ... ok
+pinsrw_10 ... ok
+pinsrw_11 ... ok
+pinsrw_12 ... ok
+pinsrw_13 ... ok
+pinsrw_14 ... ok
+pinsrw_15 ... ok
+pinsrw_16 ... ok
pmaddwd_1 ... ok
pmaddwd_2 ... ok
--- valgrind/coregrind/vg_to_ucode.c #1.146.2.1:1.146.2.2
@@ -5039,5 +5039,4 @@ static Addr disInstr ( UCodeBlock* cb, A
if (epartIsReg(modrm)) {
uInstr2(cb, GET, 2, ArchReg, eregOfRM(modrm), TempReg, t1);
- vg_assert(epartIsReg(modrm));
uInstr3(cb, SSE3e1_RegRd, 2,
Lit16, (((UShort)0x66) << 8) | (UShort)insn[0],
@@ -5050,5 +5049,16 @@ static Addr disInstr ( UCodeBlock* cb, A
eip += 4;
} else {
- VG_(core_panic)("PINSRW mem");
+ pair = disAMode ( cb, sorb, eip + 2, dis_buf );
+ t2 = LOW24(pair);
+ uInstr2(cb, LOAD, 2, TempReg, t2, TempReg, t1);
+ uInstr3(cb, SSE3e1_RegRd, 2,
+ Lit16, (((UShort)0x66) << 8) | (UShort)insn[0],
+ Lit16, (((UShort)insn[1]) << 8) | (UShort)modrm,
+ TempReg, t1 );
+ abyte = insn[2 + HI8(pair)];
+ uLiteral(cb, abyte);
+ DIP("pinsrw %s, %d, %s\n",
+ dis_buf, abyte, nameXMMReg(gregOfRM(modrm)));
+ eip += 3 + HI8(pair);
}
goto decode_success;
@@ -7265,8 +7275,16 @@ static Addr disInstr ( UCodeBlock* cb, A
vg_assert(sz == 4);
t1 = newTemp(cb);
- modrm = getUChar(eip); eip++;
- abyte = getUChar(eip); eip++;
- vg_assert(epartIsReg(modrm));
+ modrm = getUChar(eip);
+ if (epartIsReg(modrm)) {
+ VG_(strcpy)(dis_buf, nameIReg(2, eregOfRM(modrm)));
uInstr2(cb, GET, 2, ArchReg, eregOfRM(modrm), TempReg, t1);
+ eip++;
+ } else {
+ pair = disAMode ( cb, sorb, eip, dis_buf );
+ t2 = LOW24(pair);
+ uInstr2(cb, LOAD, 2, TempReg, t2, TempReg, t1);
+ eip += HI8(pair);
+ }
+ abyte = getUChar(eip); eip++;
uInstr3(cb, SSE2e1_RegRd, 2,
Lit16, (((UShort)(0x0F)) << 8) | (UShort)(opc),
@@ -7274,5 +7292,5 @@ static Addr disInstr ( UCodeBlock* cb, A
TempReg, t1 );
uLiteral(cb, abyte);
- DIP("pinsrw %s, %d, %s\n", nameIReg(2, eregOfRM(modrm)),
+ DIP("pinsrw %s, %d, %s\n", dis_buf,
(Int)abyte, nameMMXReg(gregOfRM(modrm)));
break;
--- valgrind/helgrind/tests/insn_sse.stdout.exp #1.2:1.2.2.1
@@ -95,4 +95,8 @@
pinsrw_3 ... ok
pinsrw_4 ... ok
+pinsrw_5 ... ok
+pinsrw_6 ... ok
+pinsrw_7 ... ok
+pinsrw_8 ... ok
pmaxsw_1 ... ok
pmaxsw_2 ... ok
--- valgrind/helgrind/tests/insn_sse2.stdout.exp #1.2:1.2.2.1
@@ -176,4 +176,12 @@
pinsrw_7 ... ok
pinsrw_8 ... ok
+pinsrw_9 ... ok
+pinsrw_10 ... ok
+pinsrw_11 ... ok
+pinsrw_12 ... ok
+pinsrw_13 ... ok
+pinsrw_14 ... ok
+pinsrw_15 ... ok
+pinsrw_16 ... ok
pmaddwd_1 ... ok
pmaddwd_2 ... ok
--- valgrind/memcheck/tests/insn_sse.stdout.exp #1.2:1.2.2.1
@@ -95,4 +95,8 @@
pinsrw_3 ... ok
pinsrw_4 ... ok
+pinsrw_5 ... ok
+pinsrw_6 ... ok
+pinsrw_7 ... ok
+pinsrw_8 ... ok
pmaxsw_1 ... ok
pmaxsw_2 ... ok
--- valgrind/memcheck/tests/insn_sse2.stdout.exp #1.2:1.2.2.1
@@ -176,4 +176,12 @@
pinsrw_7 ... ok
pinsrw_8 ... ok
+pinsrw_9 ... ok
+pinsrw_10 ... ok
+pinsrw_11 ... ok
+pinsrw_12 ... ok
+pinsrw_13 ... ok
+pinsrw_14 ... ok
+pinsrw_15 ... ok
+pinsrw_16 ... ok
pmaddwd_1 ... ok
pmaddwd_2 ... ok
--- valgrind/none/tests/insn_sse.def #1.3:1.3.2.1
@@ -95,4 +95,8 @@
pinsrw imm8[2] r32.ud[0xffffffff] mm.uw[1234,5678,4321,8765] => 2.uw[1234,5678,65535,8765]
pinsrw imm8[3] r32.ud[0xffffffff] mm.uw[1234,5678,4321,8765] => 2.uw[1234,5678,4321,65535]
+pinsrw imm8[0] m16.uw[0xffff] mm.uw[1234,5678,4321,8765] => 2.uw[65535,5678,4321,8765]
+pinsrw imm8[1] m16.uw[0xffff] mm.uw[1234,5678,4321,8765] => 2.uw[1234,65535,4321,8765]
+pinsrw imm8[2] m16.uw[0xffff] mm.uw[1234,5678,4321,8765] => 2.uw[1234,5678,65535,8765]
+pinsrw imm8[3] m16.uw[0xffff] mm.uw[1234,5678,4321,8765] => 2.uw[1234,5678,4321,65535]
pmaxsw mm.sw[-1,2,-3,4] mm.sw[2,-3,4,-5] => 1.sw[2,2,4,4]
pmaxsw m64.sw[-1,2,-3,4] mm.sw[2,-3,4,-5] => 1.sw[2,2,4,4]
--- valgrind/none/tests/insn_sse.stdout.exp #1.2:1.2.2.1
@@ -95,4 +95,8 @@
pinsrw_3 ... ok
pinsrw_4 ... ok
+pinsrw_5 ... ok
+pinsrw_6 ... ok
+pinsrw_7 ... ok
+pinsrw_8 ... ok
pmaxsw_1 ... ok
pmaxsw_2 ... ok
--- valgrind/none/tests/insn_sse2.def #1.3:1.3.2.1
@@ -176,4 +176,12 @@
pinsrw imm8[6] r32.ud[0xffffffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,1111,2222,65535,4444]
pinsrw imm8[7] r32.ud[0xffffffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,1111,2222,3333,65535]
+pinsrw imm8[0] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[65535,5678,4321,8765,1111,2222,3333,4444]
+pinsrw imm8[1] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,65535,4321,8765,1111,2222,3333,4444]
+pinsrw imm8[2] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,65535,8765,1111,2222,3333,4444]
+pinsrw imm8[3] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,65535,1111,2222,3333,4444]
+pinsrw imm8[4] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,65535,2222,3333,4444]
+pinsrw imm8[5] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,1111,65535,3333,4444]
+pinsrw imm8[6] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,1111,2222,65535,4444]
+pinsrw imm8[7] m16.uw[0xffff] xmm.uw[1234,5678,4321,8765,1111,2222,3333,4444] => 2.uw[1234,5678,4321,8765,1111,2222,3333,65535]
pmaddwd xmm.sw[1234,5678,-4321,-8765,1234,5678,-4321,-8765] xmm.sw[1111,-2222,3333,-4444,1111,-2222,3333,-4444] => 1.sd[-11245542,24549767,-11245542,24549767]
pmaddwd m128.sw[1234,5678,-4321,-8765,1234,5678,-4321,-8765] xmm.sw[1111,-2222,3333,-4444,1111,-2222,3333,-4444] => 1.sd[-11245542,24549767,-11245542,24549767]
--- valgrind/none/tests/insn_sse2.stdout.exp #1.2:1.2.2.1
@@ -176,4 +176,12 @@
pinsrw_7 ... ok
pinsrw_8 ... ok
+pinsrw_9 ... ok
+pinsrw_10 ... ok
+pinsrw_11 ... ok
+pinsrw_12 ... ok
+pinsrw_13 ... ok
+pinsrw_14 ... ok
+pinsrw_15 ... ok
+pinsrw_16 ... ok
pmaddwd_1 ... ok
pmaddwd_2 ... ok
|