|
From: <sv...@va...> - 2005-11-10 15:20:42
|
Author: njn
Date: 2005-11-10 15:20:37 +0000 (Thu, 10 Nov 2005)
New Revision: 5072
Log:
Cachegrind was aborting if it hit a client request. Now it doesn't.
This fixes #116057, I think. I added a regtest so it won't regress again=
.
Added:
trunk/cachegrind/tests/clreq.c
trunk/cachegrind/tests/clreq.stderr.exp
trunk/cachegrind/tests/clreq.vgtest
Modified:
trunk/cachegrind/cg_main.c
trunk/cachegrind/tests/Makefile.am
trunk/include/pub_tool_machine.h
Modified: trunk/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_main.c 2005-11-10 15:03:26 UTC (rev 5071)
+++ trunk/cachegrind/cg_main.c 2005-11-10 15:20:37 UTC (rev 5072)
@@ -800,8 +800,9 @@
// Pretend otherwise.
if (isize =3D=3D 0) isize =3D VG_MIN_INSTR_SZB;
=20
- // Check size. XXX: broken for client requests!
- tl_assert(VG_MIN_INSTR_SZB <=3D isize && isize <=3D VG_MAX_I=
NSTR_SZB);
+ // Sanity-check size.
+ tl_assert( (VG_MIN_INSTR_SZB <=3D isize && isize <=3D VG_MAX=
_INSTR_SZB)
+ || VG_CLREQ_SZB =3D=3D isize );
=20
// Get space for and init the inode, record it as the curren=
t one.
// Subsequent Dr/Dw/Dm events from the same instruction will=
=20
Modified: trunk/cachegrind/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/tests/Makefile.am 2005-11-10 15:03:26 UTC (rev 5071)
+++ trunk/cachegrind/tests/Makefile.am 2005-11-10 15:20:37 UTC (rev 5072)
@@ -5,10 +5,11 @@
=20
EXTRA_DIST =3D $(noinst_SCRIPTS) \
chdir.vgtest chdir.stderr.exp \
+ clreq.vgtest clreq.stderr.exp \
dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp
=20
check_PROGRAMS =3D \
- chdir dlclose myprint.so
+ chdir clreq dlclose myprint.so
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g
=20
Added: trunk/cachegrind/tests/clreq.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/tests/clreq.c (rev 0)
+++ trunk/cachegrind/tests/clreq.c 2005-11-10 15:20:37 UTC (rev 5072)
@@ -0,0 +1,11 @@
+
+// Prior to 3.0.1, Cachegrind was failing if run on a program that uses
+// client requests. It was fixed in 3.0.1, but then reintroduced
+// afterwards (reported as bug #116057). So here we test it.
+
+#include "../../include/valgrind.h"
+
+int main(void)
+{
+ return RUNNING_ON_VALGRIND;
+}
Added: trunk/cachegrind/tests/clreq.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Added: trunk/cachegrind/tests/clreq.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/tests/clreq.vgtest (rev 0)
+++ trunk/cachegrind/tests/clreq.vgtest 2005-11-10 15:20:37 UTC (rev 5072=
)
@@ -0,0 +1,3 @@
+prog: clreq
+vgopts: -q
+cleanup: rm cachegrind.out.*
Modified: trunk/include/pub_tool_machine.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_machine.h 2005-11-10 15:03:26 UTC (rev 5071)
+++ trunk/include/pub_tool_machine.h 2005-11-10 15:20:37 UTC (rev 5072)
@@ -31,19 +31,21 @@
#ifndef __PUB_TOOL_MACHINE_H
#define __PUB_TOOL_MACHINE_H
=20
-/* VG_STACK_REDZONE_SZB: how many bytes below the stack pointer are vali=
dly
- * addressible? */
#if defined(VGA_x86)
-# define VG_MIN_INSTR_SZB 1
-# define VG_MAX_INSTR_SZB 16
-# define VG_STACK_REDZONE_SZB 0
+# define VG_MIN_INSTR_SZB 1 // min length of native instructi=
on
+# define VG_MAX_INSTR_SZB 16 // max length of native instructi=
on
+# define VG_CLREQ_SZB 18 // length of a client request, ma=
y
+ // be larger than VG_MAX_INSTR_=
SZB
+# define VG_STACK_REDZONE_SZB 0 // number of addressable bytes be=
low SP
#elif defined(VGA_amd64)
# define VG_MIN_INSTR_SZB 1
# define VG_MAX_INSTR_SZB 16
+# define VG_CLREQ_SZB 18
# define VG_STACK_REDZONE_SZB 128
#elif defined(VGA_ppc32)
# define VG_MIN_INSTR_SZB 4
# define VG_MAX_INSTR_SZB 4=20
+# define VG_CLREQ_SZB 24
# define VG_STACK_REDZONE_SZB 0
#else
# error Unknown arch
|