|
From: <sv...@va...> - 2008-09-21 20:51:48
|
Author: sewardj
Date: 2008-09-21 21:51:39 +0100 (Sun, 21 Sep 2008)
New Revision: 8633
Log:
Continue refactoring the code:
* move the definitions of Lock and Thread into hg_lock_n_thread.[ch]
* create hg_errors.[ch], to hold the error management stuff, although
so far they are empty.
Added:
branches/YARD/helgrind/hg_errors.c
branches/YARD/helgrind/hg_errors.h
branches/YARD/helgrind/hg_lock_n_thread.c
branches/YARD/helgrind/hg_lock_n_thread.h
Modified:
branches/YARD/helgrind/Makefile.am
branches/YARD/helgrind/hg_basics.c
branches/YARD/helgrind/hg_basics.h
branches/YARD/helgrind/hg_main.c
branches/YARD/helgrind/hg_wordset.c
branches/YARD/helgrind/libhb.h
branches/YARD/helgrind/libhb_core.c
Modified: branches/YARD/helgrind/Makefile.am
===================================================================
--- branches/YARD/helgrind/Makefile.am 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/Makefile.am 2008-09-21 20:51:39 UTC (rev 8633)
@@ -71,7 +71,8 @@
$(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5)
HELGRIND_SOURCES_COMMON = \
- hg_basics.c hg_wordset.c libhb_core.c hg_main.c
+ hg_basics.c hg_lock_n_thread.c hg_wordset.c libhb_core.c \
+ hg_errors.c hg_main.c
helgrind_x86_linux_SOURCES = $(HELGRIND_SOURCES_COMMON)
helgrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX)
@@ -119,6 +120,7 @@
hginclude_HEADERS = helgrind.h
-noinst_HEADERS = hg_basics.h hg_wordset.h
+noinst_HEADERS = \
+ hg_basics.h hg_lock_n_thread.h hg_errors.h hg_wordset.h
EXTRA_DIST = README_MSMProp2.txt README_YARD.txt
Modified: branches/YARD/helgrind/hg_basics.c
===================================================================
--- branches/YARD/helgrind/hg_basics.c 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/hg_basics.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -37,6 +37,10 @@
#include "hg_basics.h" /* self */
+/*----------------------------------------------------------------*/
+/*--- Very basic stuff ---*/
+/*----------------------------------------------------------------*/
+
void* HG_(zalloc) ( HChar* cc, SizeT n )
{
void* p;
Modified: branches/YARD/helgrind/hg_basics.h
===================================================================
--- branches/YARD/helgrind/hg_basics.h 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/hg_basics.h 2008-09-21 20:51:39 UTC (rev 8633)
@@ -33,12 +33,17 @@
#define __HG_BASICS_H
+/*----------------------------------------------------------------*/
+/*--- Very basic stuff ---*/
+/*----------------------------------------------------------------*/
+
#define HG_(str) VGAPPEND(vgHelgrind_,str)
void* HG_(zalloc) ( HChar* cc, SizeT n );
void HG_(free) ( void* p );
+
#endif /* ! __HG_BASICS_H */
/*--------------------------------------------------------------------*/
Added: branches/YARD/helgrind/hg_errors.c
===================================================================
--- branches/YARD/helgrind/hg_errors.c (rev 0)
+++ branches/YARD/helgrind/hg_errors.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -0,0 +1,43 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Error management for Helgrind. ---*/
+/*--- hg_errors.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Helgrind, a Valgrind tool for detecting errors
+ in threaded programs.
+
+ Copyright (C) 2007-2008 OpenWorks Ltd
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_tool_basics.h"
+#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
+#include "pub_tool_mallocfree.h"
+
+#include "hg_errors.h" /* self */
+
+
+
+/*--------------------------------------------------------------------*/
+/*--- end hg_errors.c ---*/
+/*--------------------------------------------------------------------*/
Added: branches/YARD/helgrind/hg_errors.h
===================================================================
--- branches/YARD/helgrind/hg_errors.h (rev 0)
+++ branches/YARD/helgrind/hg_errors.h 2008-09-21 20:51:39 UTC (rev 8633)
@@ -0,0 +1,41 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Error management for Helgrind. ---*/
+/*--- hg_errors.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Helgrind, a Valgrind tool for detecting errors
+ in threaded programs.
+
+ Copyright (C) 2007-2008 OpenWorks Ltd
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __HG_ERRORS_H
+#define __HG_ERRORS_H
+
+
+
+#endif /* ! __HG_ERRORS_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end hg_errors.h ---*/
+/*--------------------------------------------------------------------*/
Added: branches/YARD/helgrind/hg_lock_n_thread.c
===================================================================
--- branches/YARD/helgrind/hg_lock_n_thread.c (rev 0)
+++ branches/YARD/helgrind/hg_lock_n_thread.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -0,0 +1,45 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Definitions for Locks and Threads. ---*/
+/*--- hg_lock_n_thread.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Helgrind, a Valgrind tool for detecting errors
+ in threaded programs.
+
+ Copyright (C) 2007-2008 OpenWorks Ltd
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_tool_basics.h"
+#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
+#include "pub_tool_execontext.h"
+#include "pub_tool_wordfm.h"
+
+#include "hg_basics.h"
+#include "hg_wordset.h"
+#include "hg_lock_n_thread.h" /* self */
+
+
+/*--------------------------------------------------------------------*/
+/*--- end hg_lock_n_thread.c ---*/
+/*--------------------------------------------------------------------*/
Added: branches/YARD/helgrind/hg_lock_n_thread.h
===================================================================
--- branches/YARD/helgrind/hg_lock_n_thread.h (rev 0)
+++ branches/YARD/helgrind/hg_lock_n_thread.h 2008-09-21 20:51:39 UTC (rev 8633)
@@ -0,0 +1,142 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Definitions for Locks and Threads. ---*/
+/*--- hg_lock_n_thread.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Helgrind, a Valgrind tool for detecting errors
+ in threaded programs.
+
+ Copyright (C) 2007-2008 OpenWorks Ltd
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __HG_LOCK_N_THREAD_H
+#define __HG_LOCK_N_THREAD_H
+
+
+/*----------------------------------------------------------------*/
+/*--- Primary data definitions ---*/
+/*----------------------------------------------------------------*/
+
+/* Magic numbers, for doing assertions that structures really are of
+ the right type. Useful as some of the code can get a bit
+ complex. */
+#define Thread_MAGIC 0x504fc5e5
+#define LockN_MAGIC 0x6545b557 /* normal nonpersistent locks */
+#define LockP_MAGIC 0x755b5456 /* persistent (copied) locks */
+
+
+/* These are handles for Word sets. CONSTRAINTS: must be (very) small
+ ints numbered from zero, since < 30-bit versions of them are used to
+ encode thread-sets and lock-sets in 32-bit shadow words. */
+typedef WordSet WordSetID;
+
+
+/* Synchronisation Objects, exported abstractly by libhb. */
+typedef struct _SO SO;
+
+/* Thr, libhb's private thread record, exported abstractly */
+typedef struct _Thr Thr;
+
+/* Stores information about a thread. Addresses of these also serve
+ as unique thread identifiers and so are never freed, so they should
+ be as small as possible. */
+typedef
+ struct _Thread {
+ /* ADMIN */
+ struct _Thread* admin;
+ UInt magic;
+ Thr* hbthr;
+ /* USEFUL */
+ WordSetID locksetA; /* WordSet of Lock* currently held by thread */
+ WordSetID locksetW; /* subset of locksetA held in w-mode */
+ /* EXPOSITION */
+ /* Place where parent was when this thread was created. */
+ ExeContext* created_at;
+ Bool announced;
+ /* Index for generating references in error messages. */
+ Int errmsg_index;
+ }
+ Thread;
+
+
+/* Stores information about a lock's current state. These are
+ allocated and later freed (when the containing memory becomes
+ NoAccess). This gives a problem for the XError type, which
+ contains Lock*s. Solution is to copy any Lock which is to be
+ incorporated into an XErrors, so as to make it independent from the
+ 'normal' collection of Locks, which can come and go. When the lock
+ is copied, its .magic is changed from LockN_Magic to
+ LockP_Magic. */
+
+/* Lock kinds. */
+typedef
+ enum {
+ LK_mbRec=1001, /* normal mutex, possibly recursive */
+ LK_nonRec, /* normal mutex, definitely non recursive */
+ LK_rdwr /* reader-writer lock */
+ }
+ LockKind;
+
+typedef
+ struct _Lock {
+ /* ADMIN */
+ struct _Lock* admin;
+ ULong unique; /* used for persistence-hashing */
+ UInt magic; /* LockN_MAGIC or LockP_MAGIC */
+ /* EXPOSITION */
+ /* Place where lock first came to the attention of Helgrind. */
+ ExeContext* appeared_at;
+ /* If the lock is held, place where the lock most recently made
+ an unlocked->locked transition. Must be sync'd with .heldBy:
+ either both NULL or both non-NULL. */
+ ExeContext* acquired_at;
+ /* USEFUL-STATIC */
+ SO* hbso; /* associated SO */
+ Addr guestaddr; /* Guest address of lock */
+ LockKind kind; /* what kind of lock this is */
+ /* USEFUL-DYNAMIC */
+ Bool heldW;
+ WordBag* heldBy; /* bag of threads that hold this lock */
+ /* .heldBy is NULL: lock is unheld, and .heldW is meaningless
+ but arbitrarily set to False
+ .heldBy is non-NULL:
+ .heldW is True: lock is w-held by threads in heldBy
+ .heldW is False: lock is r-held by threads in heldBy
+ Either way, heldBy may not validly be an empty Bag.
+
+ for LK_nonRec, r-holdings are not allowed, and w-holdings may
+ only have sizeTotal(heldBy) == 1
+
+ for LK_mbRec, r-holdings are not allowed, and w-holdings may
+ only have sizeUnique(heldBy) == 1
+
+ for LK_rdwr, w-holdings may only have sizeTotal(heldBy) == 1 */
+ }
+ Lock;
+
+
+#endif /* ! __HG_LOCK_N_THREAD_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end hg_lock_n_thread.h ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/YARD/helgrind/hg_main.c
===================================================================
--- branches/YARD/helgrind/hg_main.c 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/hg_main.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -51,12 +51,14 @@
#include "pub_tool_wordfm.h"
#include "hg_basics.h"
-#include "helgrind.h"
-
#include "hg_wordset.h"
+#include "hg_lock_n_thread.h"
#include "libhb.h"
+#include "helgrind.h"
+
+
// FIXME: new_mem_w_tid ignores the supplied tid. (wtf?!)
// FIXME: when client destroys a lock or a CV, remove these
@@ -194,99 +196,9 @@
*/
/*----------------------------------------------------------------*/
-/*--- Primary data definitions ---*/
+/*--- Primary data structures ---*/
/*----------------------------------------------------------------*/
-/* Shadow values. */
-typedef UInt SVal;
-
-
-/* These are handles for Word sets. CONSTRAINTS: must be (very) small
- ints numbered from zero, since < 30-bit versions of them are used to
- encode thread-sets and lock-sets in 32-bit shadow words. */
-typedef WordSet WordSetID;
-
-
-/* Stores information about a thread. Addresses of these also serve
- as unique thread identifiers and so are never freed, so they should
- be as small as possible. */
-typedef
- struct _Thread {
- /* ADMIN */
- struct _Thread* admin;
- UInt magic;
- Thr* hbthr; /* in libhb; its .opaque points back here */
- /* USEFUL */
- WordSetID locksetA; /* WordSet of Lock* currently held by thread */
- WordSetID locksetW; /* subset of locksetA held in w-mode */
- /* EXPOSITION */
- /* Place where parent was when this thread was created. */
- ExeContext* created_at;
- Bool announced;
- /* Index for generating references in error messages. */
- Int errmsg_index;
- }
- Thread;
-
-
-/* Stores information about a lock's current state. These are
- allocated and later freed (when the containing memory becomes
- NoAccess). This gives a problem for the XError type, which
- contains Lock*s. Solution is to copy any Lock which is to be
- incorporated into an XErrors, so as to make it independent from the
- 'normal' collection of Locks, which can come and go. When the lock
- is copied, its .magic is changed from LockN_Magic to
- LockP_Magic. */
-
-/* Lock kinds. */
-typedef
- enum {
- LK_mbRec=1001, /* normal mutex, possibly recursive */
- LK_nonRec, /* normal mutex, definitely non recursive */
- LK_rdwr /* reader-writer lock */
- }
- LockKind;
-
-typedef
- struct _Lock {
- /* ADMIN */
- struct _Lock* admin;
- ULong unique; /* used for persistence-hashing */
- UInt magic; /* LockN_MAGIC or LockP_MAGIC */
- /* EXPOSITION */
- /* Place where lock first came to the attention of Helgrind. */
- ExeContext* appeared_at;
- /* If the lock is held, place where the lock most recently made
- an unlocked->locked transition. Must be sync'd with .heldBy:
- either both NULL or both non-NULL. */
- ExeContext* acquired_at;
- /* USEFUL-STATIC */
- SO* hbso; /* associated SO */
- Addr guestaddr; /* Guest address of lock */
- LockKind kind; /* what kind of lock this is */
- /* USEFUL-DYNAMIC */
- Bool heldW;
- WordBag* heldBy; /* bag of threads that hold this lock */
- /* .heldBy is NULL: lock is unheld, and .heldW is meaningless
- but arbitrarily set to False
- .heldBy is non-NULL:
- .heldW is True: lock is w-held by threads in heldBy
- .heldW is False: lock is r-held by threads in heldBy
- Either way, heldBy may not validly be an empty Bag.
-
- for LK_nonRec, r-holdings are not allowed, and w-holdings may
- only have sizeTotal(heldBy) == 1
-
- for LK_mbRec, r-holdings are not allowed, and w-holdings may
- only have sizeUnique(heldBy) == 1
-
- for LK_rdwr, w-holdings may only have sizeTotal(heldBy) == 1 */
- }
- Lock;
-
-
-/* --------- Primary data structures --------- */
-
/* Admin linked list of Threads */
static Thread* admin_threads = NULL;
@@ -320,11 +232,6 @@
static ThreadId map_threads_maybe_reverse_lookup_SLOW ( Thread* ); /*fwds*/
-#define Thread_MAGIC 0x504fc5e5
-#define LockN_MAGIC 0x6545b557 /* normal nonpersistent locks */
-#define LockP_MAGIC 0x755b5456 /* persistent (copied) locks */
-#define SecMap_MAGIC 0x571e58cb
-
static UWord stats__mk_Segment = 0;
/* --------- Constructors --------- */
@@ -1151,7 +1058,6 @@
/* fwds */
static void record_error_Race ( Thread* thr,
Addr data_addr, Bool isWrite, Int szB,
- SVal old_sv, SVal new_sv,
ExeContext* mb_lastlock,
ExeContext* mb_confacc,
Thread* mb_confaccthr );
@@ -1316,7 +1222,7 @@
tl_assert(hbthr);
if (libhb_read(&ri, hbthr, a, len)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -1327,7 +1233,7 @@
tl_assert(hbthr);
if (libhb_write(&ri, hbthr, a, len)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -1996,7 +1902,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_read(&ri, hbthr, a, 1)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2008,7 +1914,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_read(&ri, hbthr, a, 2)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2020,7 +1926,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_read(&ri, hbthr, a, 4)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2032,7 +1938,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_read(&ri, hbthr, a, 8)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2044,7 +1950,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_read(&ri, hbthr, a, size)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2056,7 +1962,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_write(&ri, hbthr, a, 1)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2068,7 +1974,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_write(&ri, hbthr, a, 2)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2080,7 +1986,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_write(&ri, hbthr, a, 4)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2092,7 +1998,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_write(&ri, hbthr, a, 8)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -2104,7 +2010,7 @@
Thr* hbthr = thr->hbthr;
if (libhb_write(&ri, hbthr, a, size)) {
Thread* confthr = ri.thrp ? libhb_get_Thr_opaque( ri.thrp ) : NULL;
- record_error_Race( thr, ri.a, ri.isW, ri.szB, 0,0,NULL,
+ record_error_Race( thr, ri.a, ri.isW, ri.szB, NULL,
(ExeContext*)ri.wherep, confthr );
}
}
@@ -4099,8 +4005,6 @@
Addr data_addr;
Int szB;
Bool isWrite;
- SVal new_state;
- SVal old_state;
ExeContext* mb_lastlock;
ExeContext* mb_confacc;
Thread* thr;
@@ -4199,7 +4103,6 @@
static void record_error_Race ( Thread* thr,
Addr data_addr, Bool isWrite, Int szB,
- SVal old_sv, SVal new_sv,
ExeContext* mb_lastlock,
ExeContext* mb_confacc,
Thread* mb_confaccthr ) {
@@ -4225,8 +4128,6 @@
xe.XE.Race.data_addr = data_addr;
xe.XE.Race.szB = szB;
xe.XE.Race.isWrite = isWrite;
- xe.XE.Race.new_state = new_sv;
- xe.XE.Race.old_state = old_sv;
xe.XE.Race.mb_lastlock = mb_lastlock;
xe.XE.Race.mb_confacc = mb_confacc;
xe.XE.Race.thr = thr;
Modified: branches/YARD/helgrind/hg_wordset.c
===================================================================
--- branches/YARD/helgrind/hg_wordset.c 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/hg_wordset.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -41,7 +41,7 @@
#include "pub_tool_wordfm.h"
#include "hg_basics.h"
-#include "hg_wordset.h"
+#include "hg_wordset.h" /* self */
//------------------------------------------------------------------//
//--- Word Cache ---//
Modified: branches/YARD/helgrind/libhb.h
===================================================================
--- branches/YARD/helgrind/libhb.h 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/libhb.h 2008-09-21 20:51:39 UTC (rev 8633)
@@ -32,10 +32,10 @@
#define __LIBHB_H
/* Abstract to user: thread identifiers */
-typedef struct _Thr Thr;
+/* typedef struct _Thr Thr; */ /* now in hg_lock_n_thread.h */
/* Abstract to user: synchronisation objects */
-typedef struct _SO SO;
+/* typedef struct _SO SO; */ /* now in hg_lock_n_thread.h */
/* Abstract to the lib: execution contexts */
/* struct _EC will be defined by user at some point. */
Modified: branches/YARD/helgrind/libhb_core.c
===================================================================
--- branches/YARD/helgrind/libhb_core.c 2008-09-21 15:00:58 UTC (rev 8632)
+++ branches/YARD/helgrind/libhb_core.c 2008-09-21 20:51:39 UTC (rev 8633)
@@ -41,8 +41,12 @@
#include "pub_tool_xarray.h"
#include "pub_tool_oset.h"
#include "pub_tool_aspacemgr.h"
+#include "pub_tool_execontext.h"
#include "hg_basics.h"
+#include "hg_wordset.h"
+#include "hg_lock_n_thread.h"
+
#include "libhb.h"
|