summaryrefslogtreecommitdiff
path: root/cachegrind
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-10 15:20:37 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-10 15:20:37 +0000
commita5ad9bad02cd70f6ee15255e7c9684fdd847e582 (patch)
treeed64e1e329d1fff09864d54a19b7b04cf9a3dd5e /cachegrind
parent4818d73a255b7b474b670feeb37f83a2c17c401b (diff)
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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5072 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r--cachegrind/cg_main.c5
-rw-r--r--cachegrind/tests/Makefile.am3
-rw-r--r--cachegrind/tests/clreq.c11
-rw-r--r--cachegrind/tests/clreq.stderr.exp0
-rw-r--r--cachegrind/tests/clreq.vgtest3
5 files changed, 19 insertions, 3 deletions
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index ec493c76..99d70696 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -800,8 +800,9 @@ IRBB* cg_instrument ( IRBB* bbIn, VexGuestLayout* layout,
// Pretend otherwise.
if (isize == 0) isize = VG_MIN_INSTR_SZB;
- // Check size. XXX: broken for client requests!
- tl_assert(VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB);
+ // Sanity-check size.
+ tl_assert( (VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB)
+ || VG_CLREQ_SZB == isize );
// Get space for and init the inode, record it as the current one.
// Subsequent Dr/Dw/Dm events from the same instruction will
diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am
index 58e62163..480c0391 100644
--- a/cachegrind/tests/Makefile.am
+++ b/cachegrind/tests/Makefile.am
@@ -5,10 +5,11 @@ noinst_SCRIPTS = filter_stderr filter_cachesim_discards
EXTRA_DIST = $(noinst_SCRIPTS) \
chdir.vgtest chdir.stderr.exp \
+ clreq.vgtest clreq.stderr.exp \
dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp
check_PROGRAMS = \
- chdir dlclose myprint.so
+ chdir clreq dlclose myprint.so
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
diff --git a/cachegrind/tests/clreq.c b/cachegrind/tests/clreq.c
new file mode 100644
index 00000000..0f2bc2ed
--- /dev/null
+++ b/cachegrind/tests/clreq.c
@@ -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;
+}
diff --git a/cachegrind/tests/clreq.stderr.exp b/cachegrind/tests/clreq.stderr.exp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/cachegrind/tests/clreq.stderr.exp
diff --git a/cachegrind/tests/clreq.vgtest b/cachegrind/tests/clreq.vgtest
new file mode 100644
index 00000000..c0cf5fad
--- /dev/null
+++ b/cachegrind/tests/clreq.vgtest
@@ -0,0 +1,3 @@
+prog: clreq
+vgopts: -q
+cleanup: rm cachegrind.out.*