|
From: <sv...@va...> - 2005-12-08 22:24:13
|
Author: njn
Date: 2005-12-08 22:24:07 +0000 (Thu, 08 Dec 2005)
New Revision: 5315
Log:
Remove almost all remaining traces of Addrcheck.
Modified:
branches/COMPVBITS/auxprogs/gen-mdg
branches/COMPVBITS/coregrind/m_translate.c
branches/COMPVBITS/docs/internals/xml-output.txt
branches/COMPVBITS/docs/valgrind.1
branches/COMPVBITS/docs/xml/FAQ.xml
branches/COMPVBITS/docs/xml/manual-core.xml
branches/COMPVBITS/docs/xml/manual-intro.xml
branches/COMPVBITS/docs/xml/manual.xml
branches/COMPVBITS/docs/xml/writing-tools.xml
branches/COMPVBITS/glibc-2.2.supp
branches/COMPVBITS/glibc-2.3.supp
branches/COMPVBITS/memcheck/docs/mc-manual.xml
branches/COMPVBITS/memcheck/mac_leakcheck.c
branches/COMPVBITS/memcheck/mac_malloc_wrappers.c
branches/COMPVBITS/memcheck/mc_include.h
branches/COMPVBITS/memcheck/mc_main.c
branches/COMPVBITS/memcheck/mc_translate.c
branches/COMPVBITS/memcheck/tests/nanoleak.supp
branches/COMPVBITS/tests/vg_regtest.in
branches/COMPVBITS/xfree-3.supp
branches/COMPVBITS/xfree-4.supp
Modified: branches/COMPVBITS/auxprogs/gen-mdg
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/auxprogs/gen-mdg 2005-12-08 03:24:37 UTC (rev 5314=
)
+++ branches/COMPVBITS/auxprogs/gen-mdg 2005-12-08 22:24:07 UTC (rev 5315=
)
@@ -54,7 +54,7 @@
my %hide;
=20
# List of all tools.
-my @tools =3D ( "addrcheck", "cachegrind", "helgrind",
+my @tools =3D ( "cachegrind", "helgrind",
"lackey", "massif", "memcheck", "none" );
=20
my $usage =3D <<END
Modified: branches/COMPVBITS/coregrind/m_translate.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
--- branches/COMPVBITS/coregrind/m_translate.c 2005-12-08 03:24:37 UTC (r=
ev 5314)
+++ branches/COMPVBITS/coregrind/m_translate.c 2005-12-08 22:24:07 UTC (r=
ev 5315)
@@ -384,8 +384,7 @@
=20
/* This stops Vex from chasing into function entry points that we wish
to redirect. Chasing across them obviously defeats the redirect
- mechanism, with bad effects for Memcheck, Addrcheck, and possibly
- others.
+ mechanism, with bad effects for Memcheck and possibly others.
=20
Also, we must stop Vex chasing into blocks for which we might want
to self checking.
Modified: branches/COMPVBITS/docs/internals/xml-output.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/internals/xml-output.txt 2005-12-08 03:24:37 =
UTC (rev 5314)
+++ branches/COMPVBITS/docs/internals/xml-output.txt 2005-12-08 22:24:07 =
UTC (rev 5315)
@@ -34,7 +34,7 @@
caveats.
=20
* At the present time only Memcheck is supported. The scheme extends
- easily enough to cover Addrcheck and Helgrind if needed.
+ easily enough to cover Helgrind if needed.
=20
* When XML output is selected, various other settings are made.
This is in order that the output format is more controlled.
Modified: branches/COMPVBITS/docs/valgrind.1
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/valgrind.1 2005-12-08 03:24:37 UTC (rev 5314)
+++ branches/COMPVBITS/docs/valgrind.1 2005-12-08 22:24:07 UTC (rev 5315)
@@ -41,13 +41,6 @@
.RS
.TP
.B
-." - addrcheck
-." \fBaddrcheck\fP is similar to memcheck, but does not perform the same
-." granularity of memory checking. This will run faster and use less me=
mory,
-." but may miss some problems that \fBmemcheck\fP would catch.
-." (\fBaddrcheck\fP is currently not working.)
-.TP
-.B
- cachegrind
\fBcachegrind\fP is a cache simulator. It can be used to annotate every
line of your program with the number of instructions executed and cache
Modified: branches/COMPVBITS/docs/xml/FAQ.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/xml/FAQ.xml 2005-12-08 03:24:37 UTC (rev 5314=
)
+++ branches/COMPVBITS/docs/xml/FAQ.xml 2005-12-08 22:24:07 UTC (rev 5315=
)
@@ -163,7 +163,7 @@
=20
<para>Another possibility is that your program has a bug and
erroneously jumps to a non-code address, in which case you'll
- get a SIGILL signal. Memcheck/Addrcheck may issue a warning
+ get a SIGILL signal. Memcheck may issue a warning
just before this happens, but they might not if the jump
happens to land in addressable memory.</para>
</answer>
@@ -484,7 +484,7 @@
=20
<qandaentry id=3D"faq.deflost">
<question>
- <para>With Memcheck/Addrcheck's memory leak detector, what's
+ <para>With Memcheck's memory leak detector, what's
the difference between "definitely lost", "possibly lost",
"still reachable", and "suppressed"?</para>
</question>
Modified: branches/COMPVBITS/docs/xml/manual-core.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/xml/manual-core.xml 2005-12-08 03:24:37 UTC (=
rev 5314)
+++ branches/COMPVBITS/docs/xml/manual-core.xml 2005-12-08 22:24:07 UTC (=
rev 5315)
@@ -309,7 +309,7 @@
<sect1 id=3D"manual-core.report" xreflabel=3D"Reporting of errors">
<title>Reporting of errors</title>
=20
-<para>When one of the error-checking tools (Memcheck, Addrcheck,
+<para>When one of the error-checking tools (Memcheck,
Helgrind) detects something bad happening in the program, an
error message is written to the commentary. For example:</para>
=20
@@ -342,7 +342,7 @@
see which errors have occurred most frequently.</para>
=20
<para>Errors are reported before the associated operation
-actually happens. If you're using a tool (Memcheck, Addrcheck)
+actually happens. If you're using a tool (Memcheck)
which does address checking, and your program attempts to read
from address zero, the tool will emit a message to this effect,
and the program will then duly die with a segmentation
@@ -588,7 +588,7 @@
<para><computeroutput>--tool=3D<name></computeroutput>
[default=3Dmemcheck]</para>
<para>Run the Valgrind tool called <emphasis>name</emphasis>,
- e.g. Memcheck, Addrcheck, Cachegrind, etc.</para>
+ e.g. Memcheck, Cachegrind, etc.</para>
</listitem>
</itemizedlist>
</sect2>
@@ -972,7 +972,7 @@
=20
<para>For tools that use their own version of
<computeroutput>malloc()</computeroutput> (e.g. Memcheck and
-Addrcheck), the following options apply.</para>
+Massif), the following options apply.</para>
=20
<itemizedlist>
=20
@@ -1021,7 +1021,7 @@
this, they provided a routine called
<computeroutput>__libc_freeres</computeroutput> specifically
to make glibc release all memory it has allocated. Memcheck
- and Addrcheck therefore try and run
+ therefore tries to run
<computeroutput>__libc_freeres</computeroutput> at
exit.</para>
=20
Modified: branches/COMPVBITS/docs/xml/manual-intro.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/xml/manual-intro.xml 2005-12-08 03:24:37 UTC =
(rev 5314)
+++ branches/COMPVBITS/docs/xml/manual-intro.xml 2005-12-08 22:24:07 UTC =
(rev 5315)
@@ -66,37 +66,6 @@
</listitem>
=20
<listitem>
- <para><command>Addrcheck</command> is a lightweight version
- of Memcheck. It is identical to Memcheck except for the
- single detail that it does not do any uninitialised-value
- checks. All of the other checks -- primarily the
- fine-grained address checking -- are still done. The
- downside of this is that you don't catch the
- uninitialised-value errors that Memcheck can find.</para>
-
- <para>But the upside is significant: programs run about twice
- as fast as they do on Memcheck, and a lot less memory is
- used. It still finds reads/writes of freed memory, memory
- off the end of blocks and in other invalid places, bugs which
- you really want to find before release!</para>
-
- <para>Because Addrcheck is lighter and faster than Memcheck,
- you can run more programs for longer, and so you may be able
- to cover more test scenarios. Addrcheck was created because
- one of us (Julian) wanted to be able to run a complete KDE
- desktop session with checking. As of early November 2002, we
- have been able to run KDE-3.0.3 on a 1.7 GHz P4 with 512 MB
- of memory, using Addrcheck. Although the result is not
- stellar, it's quite usable, and it seems plausible to run KDE
- for long periods at a time like this, collecting up all the
- addressing errors that appear.</para>
-
- <para>NOTE: Addrcheck is not available in Valgrind 3.1.X. We hope
- to reinstate its functionality in later releases. For now, use=20
- Memcheck instead.</para>
- </listitem>
-
- <listitem>
<para><command>Cachegrind</command> is a cache profiler. It
performs detailed simulation of the I1, D1 and L2 caches in
your CPU and so can accurately pinpoint the sources of cache
Modified: branches/COMPVBITS/docs/xml/manual.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/xml/manual.xml 2005-12-08 03:24:37 UTC (rev 5=
314)
+++ branches/COMPVBITS/docs/xml/manual.xml 2005-12-08 22:24:07 UTC (rev 5=
315)
@@ -24,8 +24,6 @@
xmlns:xi=3D"http://www.w3.org/2001/XInclude" />
<xi:include href=3D"../../memcheck/docs/mc-manual.xml" parse=3D"xml" =20
xmlns:xi=3D"http://www.w3.org/2001/XInclude" />
- <xi:include href=3D"../../addrcheck/docs/ac-manual.xml" parse=3D"xml" =
=20
- xmlns:xi=3D"http://www.w3.org/2001/XInclude" />
<xi:include href=3D"../../cachegrind/docs/cg-manual.xml" parse=3D"xml"=
=20
xmlns:xi=3D"http://www.w3.org/2001/XInclude" />
<xi:include href=3D"../../massif/docs/ms-manual.xml" parse=3D"xml" =20
Modified: branches/COMPVBITS/docs/xml/writing-tools.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/docs/xml/writing-tools.xml 2005-12-08 03:24:37 UTC=
(rev 5314)
+++ branches/COMPVBITS/docs/xml/writing-tools.xml 2005-12-08 22:24:07 UTC=
(rev 5315)
@@ -155,12 +155,6 @@
</listitem>
=20
<listitem>
- <para><command>addrcheck</command>: performs lighterweight
- addressibility checks of every memory reference performed by
- the program.</para>
- </listitem>
-
- <listitem>
<para><command>cachegrind</command>: tracks every instruction
and memory reference to simulate instruction and data caches,
tracking cache accesses and misses that occur on every line in
@@ -571,7 +565,7 @@
<para>The <filename>pub_tool_*.h</filename> files have a reasonable
amount of documentation in it that should hopefully be enough to get
you going. But ultimately, the tools distributed (Memcheck,
-Addrcheck, Cachegrind, Lackey, etc.) are probably the best
+Cachegrind, Lackey, etc.) are probably the best
documentation of all, for the moment.</para>
=20
<para>Note that the <computeroutput>VG_</computeroutput> macro is used
Modified: branches/COMPVBITS/glibc-2.2.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/glibc-2.2.supp 2005-12-08 03:24:37 UTC (rev 5314)
+++ branches/COMPVBITS/glibc-2.2.supp 2005-12-08 22:24:07 UTC (rev 5315)
@@ -102,13 +102,13 @@
}
{
trecurse/__gconv_release_shlib(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:trecurse
fun:__gconv_release_shlib
}
{
do_release_shlib/trecurse(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:do_release_shlib
fun:trecurse
}
@@ -146,20 +146,20 @@
=20
{
__twalk/*(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:__twalk
}
=20
{
do_release_shlib/__twalk(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:do_release_shlib
fun:__twalk
}
=20
{
__libc_freeres/free_mem/free(Free)
- Addrcheck,Memcheck:Free
+ Memcheck:Free
fun:free
fun:free_mem
fun:__libc_freeres
@@ -328,13 +328,13 @@
# two:
{
__mpn_construct_double/*(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:__mpn_construct_double
fun:*
}
{
__mpn_construct_double/*(Addr8)
- Addrcheck,Memcheck:Addr8
+ Memcheck:Addr8
fun:__mpn_construct_double
fun:*
}
@@ -342,13 +342,13 @@
# More of the same (gcc bug, I'm pretty sure)
{
__fabs/*(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:__fabs
fun:*
}
{
__fabs/*(Addr8)
- Addrcheck,Memcheck:Addr8
+ Memcheck:Addr8
fun:__fabs
fun:*
}
@@ -357,7 +357,7 @@
# Not sure what this is about ... but anyway
{
pthread_sighandler/*(Addr4)
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
fun:pthread_sighandler
fun:*
}
@@ -432,14 +432,14 @@
#-------------------
{
socketcall.connect(serv_addr)/connect/*
- Addrcheck,Memcheck:Param
+ Memcheck:Param
socketcall.connect(serv_addr)
fun:connect
fun:*
}
{
socketcall.connect(serv_addr)/libc-2.2.4.so/libc-2.2.4.so
- Addrcheck,Memcheck:Param
+ Memcheck:Param
socketcall.connect(serv_addr)
obj:*libc-2.2.?.so
obj:*libc-2.2.?.so
@@ -448,7 +448,7 @@
#----------------------
{
write(buf)/write/libX11.so.6.2/libX11.so.6.2(Param)
- Addrcheck,Memcheck:Param
+ Memcheck:Param
write(buf)
fun:write
obj:/usr/X11R6/lib/libX11.so.6.2
@@ -456,7 +456,7 @@
}
{
write(buf)/libc-2.2.4.so/libX11.so.6.2/libX11.so.6.2(Param)
- Addrcheck,Memcheck:Param
+ Memcheck:Param
write(buf)
obj:*libc-2.2.?.so
obj:/usr/X11R6/lib/libX11.so.6.2
@@ -473,7 +473,7 @@
=20
{
writev(vector[...])/__writev/libX11.so.6.2/libX11.so.6.2
- Addrcheck,Memcheck:Param
+ Memcheck:Param
writev(vector[...])
fun:__writev
obj:/usr/X11R6/lib/libX11.so.6.2
Modified: branches/COMPVBITS/glibc-2.3.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/glibc-2.3.supp 2005-12-08 03:24:37 UTC (rev 5314)
+++ branches/COMPVBITS/glibc-2.3.supp 2005-12-08 22:24:07 UTC (rev 5315)
@@ -66,14 +66,14 @@
}
{
realpath is inefficiently coded
- Addrcheck,Memcheck:Overlap
+ Memcheck:Overlap
fun:memcpy
fun:realpath*
}
=20
{
realpath stupidity part II
- Addrcheck,Memcheck:Overlap
+ Memcheck:Overlap
fun:strcpy
fun:realpath*
}
@@ -214,7 +214,7 @@
## in /opt/intel/compiler70/ia32/lib/libcxa.so.3
{
Intel compiler70/ia32/lib/libcxa.so.3 below-esp accesses
- Addrcheck,Memcheck:Addr4
+ Memcheck:Addr4
obj:/opt/intel/compiler70/ia32/lib/libcxa.so.3
}
=20
Modified: branches/COMPVBITS/memcheck/docs/mc-manual.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/memcheck/docs/mc-manual.xml 2005-12-08 03:24:37 UT=
C (rev 5314)
+++ branches/COMPVBITS/memcheck/docs/mc-manual.xml 2005-12-08 22:24:07 UT=
C (rev 5315)
@@ -584,10 +584,6 @@
<programlisting><![CDATA[
Memcheck:suppression_type]]></programlisting>
=20
-<para>Or, since some of the suppressions are shared with Addrcheck:</par=
a>
-<programlisting><![CDATA[
-Memcheck,Addrcheck:suppression_type]]></programlisting>
-
<para>The Memcheck suppression types are as follows:</para>
=20
<itemizedlist>
@@ -1001,7 +997,7 @@
<title>Client Requests</title>
=20
<para>The following client requests are defined in
-<filename>memcheck.h</filename>. They also work for Addrcheck.
+<filename>memcheck.h</filename>.
See <filename>memcheck.h</filename> for exact details of their
arguments.</para>
=20
Modified: branches/COMPVBITS/memcheck/mac_leakcheck.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
--- branches/COMPVBITS/memcheck/mac_leakcheck.c 2005-12-08 03:24:37 UTC (=
rev 5314)
+++ branches/COMPVBITS/memcheck/mac_leakcheck.c 2005-12-08 22:24:07 UTC (=
rev 5315)
@@ -1,13 +1,11 @@
=20
/*--------------------------------------------------------------------*/
-/*--- The leak checker, shared between Memcheck and Addrcheck. ---*/
-/*--- mac_leakcheck.c ---*/
+/*--- The leak checker. mac_leakcheck.c ---*/
/*--------------------------------------------------------------------*/
=20
/*
This file is part of MemCheck, a heavyweight Valgrind tool for
- detecting memory errors, and AddrCheck, a lightweight Valgrind tool=20
- for detecting memory errors.
+ detecting memory errors.
=20
Copyright (C) 2000-2005 Julian Seward=20
js...@ac...
@@ -32,9 +30,8 @@
=20
#include "pub_tool_basics.h"
#include "pub_tool_aspacemgr.h"
-#include "pub_tool_errormgr.h" // For mc_include.h
-#include "pub_tool_execontext.h" // For mc_include.h
-#include "pub_tool_hashtable.h" // For mc_include.h
+#include "pub_tool_execontext.h"
+#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
@@ -166,9 +163,9 @@
#if VG_DEBUG_LEAKCHECK
/* Used to sanity-check the fast binary-search mechanism. */
static=20
-Int find_shadow_for_OLD ( Addr ptr,=20
- MAC_Chunk** shadows,
- Int n_shadows )
+Int find_shadow_for_OLD ( Addr ptr,=20
+ MC_Chunk** shadows,
+ Int n_shadows )
=20
{
Int i;
@@ -187,9 +184,9 @@
=20
=20
static=20
-Int find_shadow_for ( Addr ptr,=20
- MAC_Chunk** shadows,
- Int n_shadows )
+Int find_shadow_for ( Addr ptr,=20
+ MC_Chunk** shadows,
+ Int n_shadows )
{
Addr a_mid_lo, a_mid_hi;
Int lo, mid, hi, retVal;
@@ -226,13 +223,13 @@
}
=20
/* Globals, for the following callback used by VG_(detect_memory_leaks).=
*/
-static MAC_Chunk** lc_shadows;
-static Int lc_n_shadows;
-static MarkStack* lc_markstack;
-static Int lc_markstack_top;
-static Addr lc_min_mallocd_addr;
-static Addr lc_max_mallocd_addr;
-static SizeT lc_scanned;
+static MC_Chunk** lc_shadows;
+static Int lc_n_shadows;
+static MarkStack* lc_markstack;
+static Int lc_markstack_top;
+static Addr lc_min_mallocd_addr;
+static Addr lc_max_mallocd_addr;
+static SizeT lc_scanned;
=20
static Bool (*lc_is_within_valid_secondary) (Addr addr);
static Bool (*lc_is_valid_aligned_word) (Addr addr);
@@ -323,8 +320,8 @@
=20
static Int lc_compar(void* n1, void* n2)
{
- MAC_Chunk* mc1 =3D *(MAC_Chunk**)n1;
- MAC_Chunk* mc2 =3D *(MAC_Chunk**)n2;
+ MC_Chunk* mc1 =3D *(MC_Chunk**)n1;
+ MC_Chunk* mc2 =3D *(MC_Chunk**)n2;
return (mc1->data < mc2->data ? -1 : 1);
}
=20
@@ -604,29 +601,27 @@
leak_extra.n_total_records =3D n_lossrecords;
leak_extra.lossRecord =3D p_min;
is_suppressed =3D=20
- VG_(unique_error) ( tid, LeakErr, /*Addr*/0, /*s*/NULL,
- /*extra*/&leak_extra,=20
- /*where*/p_min->allocated_at, print_record,
- /*allow_GDB_attach*/False, /*count_error*/F=
alse );
+ MC_(record_leak_error) ( tid, &leak_extra, p_min->allocated_at,
+ print_record );
=20
if (is_suppressed) {
- blocks_suppressed +=3D p_min->num_blocks;
+ blocks_suppressed +=3D p_min->num_blocks;
MC_(bytes_suppressed) +=3D p_min->total_bytes;
=20
- } else if (Unreached =3D=3D p_min->loss_mode) {
- blocks_leaked +=3D p_min->num_blocks;
- MC_(bytes_leaked) +=3D p_min->total_bytes;
+ } else if (Unreached =3D=3D p_min->loss_mode) {
+ blocks_leaked +=3D p_min->num_blocks;
+ MC_(bytes_leaked) +=3D p_min->total_bytes;
=20
- } else if (IndirectLeak =3D=3D p_min->loss_mode) {
- blocks_indirect +=3D p_min->num_blocks;
- MC_(bytes_indirect)+=3D p_min->total_bytes;
+ } else if (IndirectLeak =3D=3D p_min->loss_mode) {
+ blocks_indirect +=3D p_min->num_blocks;
+ MC_(bytes_indirect) +=3D p_min->total_bytes;
=20
- } else if (Interior =3D=3D p_min->loss_mode) {
- blocks_dubious +=3D p_min->num_blocks;
+ } else if (Interior =3D=3D p_min->loss_mode) {
+ blocks_dubious +=3D p_min->num_blocks;
MC_(bytes_dubious) +=3D p_min->total_bytes;
=20
- } else if (Proper =3D=3D p_min->loss_mode) {
- blocks_reachable +=3D p_min->num_blocks;
+ } else if (Proper =3D=3D p_min->loss_mode) {
+ blocks_reachable +=3D p_min->num_blocks;
MC_(bytes_reachable) +=3D p_min->total_bytes;
=20
} else {
@@ -670,12 +665,9 @@
=20
/* Top level entry point to leak detector. Call here, passing in
suitable address-validating functions (see comment at top of
- scan_all_valid_memory above). All this is to avoid duplication
- of the leak-detection code for Memcheck and Addrcheck.
- Also pass in a tool-specific function to extract the .where field
- for allocated blocks, an indication of the resolution wanted for
- distinguishing different allocation points, and whether or not
- reachable blocks should be shown.
+ scan_all_valid_memory above). These functions used to encapsulate th=
e
+ differences between Memcheck and Addrcheck; they no longer do but it
+ doesn't hurt to keep them here.
*/
void MC_(do_detect_memory_leaks) (
ThreadId tid, LeakCheckMode mode,
@@ -688,8 +680,8 @@
tl_assert(mode !=3D LC_Off);
=20
/* VG_(HT_to_array) allocates storage for shadows */
- lc_shadows =3D (MAC_Chunk**)VG_(HT_to_array)( MC_(malloc_list),
- &lc_n_shadows );
+ lc_shadows =3D (MC_Chunk**)VG_(HT_to_array)( MC_(malloc_list),
+ &lc_n_shadows );
=20
/* Sort the array. */
VG_(ssort)((void*)lc_shadows, lc_n_shadows, sizeof(VgHashNode*), lc_c=
ompar);
Modified: branches/COMPVBITS/memcheck/mac_malloc_wrappers.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
--- branches/COMPVBITS/memcheck/mac_malloc_wrappers.c 2005-12-08 03:24:37=
UTC (rev 5314)
+++ branches/COMPVBITS/memcheck/mac_malloc_wrappers.c 2005-12-08 22:24:07=
UTC (rev 5315)
@@ -31,9 +31,8 @@
*/
=20
#include "pub_tool_basics.h"
-#include "pub_tool_errormgr.h" // For mc_include.h
-#include "pub_tool_execontext.h" // For mc_include.h
-#include "pub_tool_hashtable.h" // For mc_include.h
+#include "pub_tool_execontext.h"
+#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
@@ -53,7 +52,7 @@
static SizeT cmalloc_n_frees =3D 0;
static SizeT cmalloc_bs_mallocd =3D 0;
=20
-/* Function pointers for the two tools to track interesting events. */
+/* Function pointers for tracking interesting events. */
void (*MC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited ) =3D NUL=
L;
void (*MC_(ban_mem_heap)) ( Addr a, SizeT len ) =3D NUL=
L;
void (*MC_(die_mem_heap)) ( Addr a, SizeT len ) =3D NUL=
L;
@@ -74,13 +73,13 @@
VgHashTable MC_(mempool_list) =3D NULL;
=20
/* Records blocks after freeing. */
-static MAC_Chunk* freed_list_start =3D NULL;
-static MAC_Chunk* freed_list_end =3D NULL;
-static Int freed_list_volume =3D 0;
+static MC_Chunk* freed_list_start =3D NULL;
+static MC_Chunk* freed_list_end =3D NULL;
+static Int freed_list_volume =3D 0;
=20
/* Put a shadow chunk on the freed blocks queue, possibly freeing up
some of the oldest blocks in the queue at the same time. */
-static void add_to_freed_queue ( MAC_Chunk* mc )
+static void add_to_freed_queue ( MC_Chunk* mc )
{
/* Put it at the end of the freed list */
if (freed_list_end =3D=3D NULL) {
@@ -99,7 +98,7 @@
volume below vg_clo_freelist_vol. */
=20
while (freed_list_volume > MC_(clo_freelist_vol)) {
- MAC_Chunk* mc1;
+ MC_Chunk* mc1;
=20
tl_assert(freed_list_start !=3D NULL);
tl_assert(freed_list_end !=3D NULL);
@@ -116,34 +115,34 @@
}
mc1->next =3D NULL; /* just paranoia */
=20
- /* free MAC_Chunk */
+ /* free MC_Chunk */
VG_(cli_free) ( (void*)(mc1->data) );
VG_(free) ( mc1 );
}
}
=20
-MAC_Chunk* MC_(get_freed_list_head)(void)
+MC_Chunk* MC_(get_freed_list_head)(void)
{
return freed_list_start;
}
=20
/* Allocate its shadow chunk, put it on the appropriate list. */
static
-MAC_Chunk* create_MAC_Chunk ( ThreadId tid, Addr p, SizeT size,
- MAC_AllocKind kind)
+MC_Chunk* create_MC_Chunk ( ThreadId tid, Addr p, SizeT size,
+ MC_AllocKind kind)
{
- MAC_Chunk* mc =3D VG_(malloc)(sizeof(MAC_Chunk));
+ MC_Chunk* mc =3D VG_(malloc)(sizeof(MC_Chunk));
mc->data =3D p;
mc->size =3D size;
mc->allockind =3D kind;
mc->where =3D VG_(record_ExeContext)(tid);
=20
- /* Paranoia ... ensure the MAC_Chunk is off-limits to the client, so
+ /* Paranoia ... ensure the MC_Chunk is off-limits to the client, so
the mc->data field isn't visible to the leak checker. If memory
management is working correctly, any pointer returned by VG_(mallo=
c)
should be noaccess as far as the client is concerned. */
- if (!MC_(check_noaccess)( (Addr)mc, sizeof(MAC_Chunk), NULL )) {
- VG_(tool_panic)("create_MAC_Chunk: shadow area is accessible");
+ if (!MC_(check_noaccess)( (Addr)mc, sizeof(MC_Chunk), NULL )) {
+ VG_(tool_panic)("create_MC_Chunk: shadow area is accessible");
}=20
return mc;
}
@@ -179,16 +178,16 @@
__inline__
void* MC_(new_block) ( ThreadId tid,
Addr p, SizeT size, SizeT align, UInt rzB,
- Bool is_zeroed, MAC_AllocKind kind, VgHashTable =
table)
+ Bool is_zeroed, MC_AllocKind kind, VgHashTable t=
able)
{
VGP_PUSHCC(VgpCliMalloc);
cmalloc_n_mallocs ++;
=20
// Allocate and zero if necessary
if (p) {
- tl_assert(MAC_AllocCustom =3D=3D kind);
+ tl_assert(MC_AllocCustom =3D=3D kind);
} else {
- tl_assert(MAC_AllocCustom !=3D kind);
+ tl_assert(MC_AllocCustom !=3D kind);
p =3D (Addr)VG_(cli_malloc)( align, size );
if (!p) {
VGP_POPCC(VgpCliMalloc);
@@ -200,7 +199,7 @@
// Only update this stat if allocation succeeded.
cmalloc_bs_mallocd +=3D size;
=20
- VG_(HT_add_node)( table, create_MAC_Chunk(tid, p, size, kind) );
+ VG_(HT_add_node)( table, create_MC_Chunk(tid, p, size, kind) );
=20
MC_(ban_mem_heap)( p-rzB, rzB );
MC_(new_mem_heap)( p, size, is_zeroed );
@@ -217,7 +216,7 @@
return NULL;
} else {
return MC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- MAC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocMalloc,
+ MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocMalloc,
MC_(malloc_list));
}
}
@@ -228,7 +227,7 @@
return NULL;
} else {
return MC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- MAC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocNew,
+ MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocNew,
MC_(malloc_list));
}
}
@@ -239,7 +238,7 @@
return NULL;
} else {
return MC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- MAC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocNewVec,
+ MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocNewVec,
MC_(malloc_list));
}
}
@@ -250,7 +249,7 @@
return NULL;
} else {
return MC_(new_block) ( tid, 0, n, align,=20
- MAC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocMalloc,
+ MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocMalloc,
MC_(malloc_list));
}
}
@@ -261,13 +260,13 @@
return NULL;
} else {
return MC_(new_block) ( tid, 0, nmemb*size1, VG_(clo_alignment),
- MAC_MALLOC_REDZONE_SZB, /*is_zeroed*/True, MAC_AllocMalloc,
+ MC_MALLOC_REDZONE_SZB, /*is_zeroed*/True, MC_AllocMalloc,
MC_(malloc_list));
}
}
=20
static
-void die_and_free_mem ( ThreadId tid, MAC_Chunk* mc, SizeT rzB )
+void die_and_free_mem ( ThreadId tid, MC_Chunk* mc, SizeT rzB )
{
/* Note: ban redzones again -- just in case user de-banned them
with a client request... */
@@ -276,7 +275,7 @@
MC_(ban_mem_heap)( mc->data+mc->size, rzB );
=20
/* Put it out of harm's way for a while, if not from a client request=
*/
- if (MAC_AllocCustom !=3D mc->allockind) {
+ if (MC_AllocCustom !=3D mc->allockind) {
/* Record where freed */
mc->where =3D VG_(record_ExeContext) ( tid );
add_to_freed_queue ( mc );
@@ -286,9 +285,9 @@
}
=20
__inline__
-void MC_(handle_free) ( ThreadId tid, Addr p, UInt rzB, MAC_AllocKind ki=
nd )
+void MC_(handle_free) ( ThreadId tid, Addr p, UInt rzB, MC_AllocKind kin=
d )
{
- MAC_Chunk* mc;
+ MC_Chunk* mc;
=20
VGP_PUSHCC(VgpCliMalloc);
=20
@@ -311,26 +310,26 @@
void MC_(free) ( ThreadId tid, void* p )
{
MC_(handle_free)(=20
- tid, (Addr)p, MAC_MALLOC_REDZONE_SZB, MAC_AllocMalloc );
+ tid, (Addr)p, MC_MALLOC_REDZONE_SZB, MC_AllocMalloc );
}
=20
void MC_(__builtin_delete) ( ThreadId tid, void* p )
{
MC_(handle_free)(
- tid, (Addr)p, MAC_MALLOC_REDZONE_SZB, MAC_AllocNew);
+ tid, (Addr)p, MC_MALLOC_REDZONE_SZB, MC_AllocNew);
}
=20
void MC_(__builtin_vec_delete) ( ThreadId tid, void* p )
{
MC_(handle_free)(
- tid, (Addr)p, MAC_MALLOC_REDZONE_SZB, MAC_AllocNewVec);
+ tid, (Addr)p, MC_MALLOC_REDZONE_SZB, MC_AllocNewVec);
}
=20
void* MC_(realloc) ( ThreadId tid, void* p_old, SizeT new_size )
{
- MAC_Chunk* mc;
- void* p_new;
- SizeT old_size;
+ MC_Chunk* mc;
+ void* p_new;
+ SizeT old_size;
=20
VGP_PUSHCC(VgpCliMalloc);
=20
@@ -351,7 +350,7 @@
}
=20
/* check if its a matching free() / delete / delete [] */
- if (MAC_AllocMalloc !=3D mc->allockind) {
+ if (MC_AllocMalloc !=3D mc->allockind) {
/* can not realloc a range that was allocated with new or new [] *=
/
MC_(record_freemismatch_error) ( tid, (Addr)p_old, mc );
/* but keep going anyway */
@@ -378,22 +377,22 @@
=20
if (a_new) {
/* First half kept and copied, second half new, red zones as no=
rmal */
- MC_(ban_mem_heap) ( a_new-MAC_MALLOC_REDZONE_SZB, MAC_MALLOC_RE=
DZONE_SZB );
+ MC_(ban_mem_heap) ( a_new-MC_MALLOC_REDZONE_SZB, MC_MALLOC_REDZ=
ONE_SZB );
MC_(copy_mem_heap)( (Addr)p_old, a_new, mc->size );
MC_(new_mem_heap) ( a_new+mc->size, new_size-mc->size, /*init'd=
*/False );
- MC_(ban_mem_heap) ( a_new+new_size, MAC_MALLOC_REDZONE_SZB );
+ MC_(ban_mem_heap) ( a_new+new_size, MC_MALLOC_REDZONE_SZB );
=20
/* Copy from old to new */
VG_(memcpy)((void*)a_new, p_old, mc->size);
=20
/* Free old memory */
- /* Nb: we have to allocate a new MAC_Chunk for the new memory r=
ather
+ /* Nb: we have to allocate a new MC_Chunk for the new memory ra=
ther
than recycling the old one, so that any erroneous accesses t=
o the
old memory are reported. */
- die_and_free_mem ( tid, mc, MAC_MALLOC_REDZONE_SZB );
+ die_and_free_mem ( tid, mc, MC_MALLOC_REDZONE_SZB );
=20
// Allocate a new chunk.
- mc =3D create_MAC_Chunk( tid, a_new, new_size, MAC_AllocMalloc =
);
+ mc =3D create_MC_Chunk( tid, a_new, new_size, MC_AllocMalloc );
}
=20
p_new =3D (void*)a_new;
@@ -414,18 +413,18 @@
=20
void MC_(create_mempool)(Addr pool, UInt rzB, Bool is_zeroed)
{
- MAC_Mempool* mp =3D VG_(malloc)(sizeof(MAC_Mempool));
- mp->pool =3D pool;
- mp->rzB =3D rzB;
- mp->is_zeroed =3D is_zeroed;
- mp->chunks =3D VG_(HT_construct)( 3001 ); // prime, not so big
+ MC_Mempool* mp =3D VG_(malloc)(sizeof(MC_Mempool));
+ mp->pool =3D pool;
+ mp->rzB =3D rzB;
+ mp->is_zeroed =3D is_zeroed;
+ mp->chunks =3D VG_(HT_construct)( 3001 ); // prime, not so big
=20
/* Paranoia ... ensure this area is off-limits to the client, so
the mp->data field isn't visible to the leak checker. If memory
management is working correctly, anything pointer returned by
VG_(malloc) should be noaccess as far as the client is
concerned. */
- if (!MC_(check_noaccess)( (Addr)mp, sizeof(MAC_Mempool), NULL )) {
+ if (!MC_(check_noaccess)( (Addr)mp, sizeof(MC_Mempool), NULL )) {
VG_(tool_panic)("MC_(create_mempool): shadow area is accessible");
}=20
=20
@@ -434,8 +433,8 @@
=20
void MC_(destroy_mempool)(Addr pool)
{
- MAC_Chunk* mc;
- MAC_Mempool* mp;
+ MC_Chunk* mc;
+ MC_Mempool* mp;
=20
mp =3D VG_(HT_remove) ( MC_(mempool_list), (UWord)pool );
=20
@@ -462,21 +461,21 @@
=20
void MC_(mempool_alloc)(ThreadId tid, Addr pool, Addr addr, SizeT size)
{
- MAC_Mempool* mp =3D VG_(HT_lookup) ( MC_(mempool_list), (UWord)pool )=
;
+ MC_Mempool* mp =3D VG_(HT_lookup) ( MC_(mempool_list), (UWord)pool );
=20
if (mp =3D=3D NULL) {
MC_(record_illegal_mempool_error) ( tid, pool );
} else {
MC_(new_block)(tid, addr, size, /*ignored*/0, mp->rzB, mp->is_zero=
ed,
- MAC_AllocCustom, mp->chunks);
+ MC_AllocCustom, mp->chunks);
}
}
=20
void MC_(mempool_free)(Addr pool, Addr addr)
{
- MAC_Mempool* mp;
- MAC_Chunk* mc;
- ThreadId tid =3D VG_(get_running_tid)();
+ MC_Mempool* mp;
+ MC_Chunk* mc;
+ ThreadId tid =3D VG_(get_running_tid)();
=20
mp =3D VG_(HT_lookup)(MC_(mempool_list), (UWord)pool);
if (mp =3D=3D NULL) {
@@ -499,9 +498,9 @@
=20
void MC_(print_malloc_stats) ( void )
{
- MAC_Chunk* mc;
- SizeT nblocks =3D 0;
- SizeT nbytes =3D 0;
+ MC_Chunk* mc;
+ SizeT nblocks =3D 0;
+ SizeT nbytes =3D 0;
=20
if (VG_(clo_verbosity) =3D=3D 0)
return;
Modified: branches/COMPVBITS/memcheck/mc_include.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
--- branches/COMPVBITS/memcheck/mc_include.h 2005-12-08 03:24:37 UTC (rev=
5314)
+++ branches/COMPVBITS/memcheck/mc_include.h 2005-12-08 22:24:07 UTC (rev=
5315)
@@ -35,126 +35,109 @@
#define MC_(str) VGAPPEND(vgMemCheck_,str)
=20
/*------------------------------------------------------------*/
-/*--- Errors and suppressions ---*/
+/*--- Tracking the heap ---*/
/*------------------------------------------------------------*/
=20
-/* The classification of a faulting address. */
-typedef=20
- enum {=20
- Undescribed, // as-yet unclassified
- Stack,=20
- Unknown, // classification yielded nothing useful
- Freed, Mallocd,=20
- UserG, // in a user-defined block
- Mempool, // in a mempool
- Register, // in a register; for Param errors only
- }
- AddrKind;
+/* We want at least a 16B redzone on client heap blocks for Memcheck */
+#define MC_MALLOC_REDZONE_SZB 16
=20
-/* Records info about a faulting address. */
-typedef
- struct { // Used by:
- AddrKind akind; // ALL
- SizeT blksize; // Freed, Mallocd
- OffT rwoffset; // Freed, Mallocd
- ExeContext* lastchange; // Freed, Mallocd
- ThreadId stack_tid; // Stack
- const Char *desc; // UserG
- Bool maybe_gcc; // True if just below %esp -- could be a g=
cc bug.
- }
- AddrInfo;
-
-typedef=20
- enum {=20
- ParamSupp, // Bad syscall params
- CoreMemSupp, // Memory errors in core (pthread ops, signal handl=
ing)
-
- // Use of invalid values of given size (MemCheck only)
- Value0Supp, Value1Supp, Value2Supp, Value4Supp, Value8Supp, Value1=
6Supp,
-
- // Invalid read/write attempt at given size
- Addr1Supp, Addr2Supp, Addr4Supp, Addr8Supp, Addr16Supp,
-
- FreeSupp, // Invalid or mismatching free
- OverlapSupp, // Overlapping blocks in memcpy(), strcpy(), etc
- LeakSupp, // Something to be suppressed in a leak check.
- MempoolSupp, // Memory pool suppression.
- }=20
- MAC_SuppKind;
-
-/* What kind of error it is. */
-typedef=20
- enum { ValueErr, /* Memcheck only */
- CoreMemErr,
- AddrErr,=20
- ParamErr, UserErr, /* behaves like an anonymous ParamErr */
- FreeErr, FreeMismatchErr,
- OverlapErr,
- LeakErr,
- IllegalMempoolErr,
- }
- MAC_ErrorKind;
-
-/* What kind of memory access is involved in the error? */
-typedef
- enum { ReadAxs, WriteAxs, ExecAxs }
- AxsKind;
-
-/* Extra context for memory errors */
-typedef
- struct { // Used by:
- AxsKind axskind; // AddrErr
- Int size; // AddrErr, ValueErr
- AddrInfo addrinfo; // {Addr,Free,FreeMismatch,Param,User}Err
- Bool isUnaddr; // {CoreMem,Param,User}Err
- }
- MAC_Error;
-
-/* Extra info for overlap errors */
-typedef
- struct {
- Addr src;
- Addr dst;
- Int len; // -1 if unused
- }
- OverlapExtra;
-
/* For malloc()/new/new[] vs. free()/delete/delete[] mismatch checking. =
*/
typedef
enum {
- MAC_AllocMalloc =3D 0,
- MAC_AllocNew =3D 1,
- MAC_AllocNewVec =3D 2,
- MAC_AllocCustom =3D 3
+ MC_AllocMalloc =3D 0,
+ MC_AllocNew =3D 1,
+ MC_AllocNewVec =3D 2,
+ MC_AllocCustom =3D 3
}
- MAC_AllocKind;
+ MC_AllocKind;
=20
/* Nb: first two fields must match core's VgHashNode. */
typedef
- struct _MAC_Chunk {
- struct _MAC_Chunk* next;
+ struct _MC_Chunk {
+ struct _MC_Chunk* next;
Addr data; // ptr to actual block
SizeT size : (sizeof(UWord)*8)-2; // size requested; 30 or=
62 bits
- MAC_AllocKind allockind : 2; // which wrapper did the allocation
+ MC_AllocKind allockind : 2; // which wrapper did the allocation
ExeContext* where; // where it was allocated
}
- MAC_Chunk;
+ MC_Chunk;
=20
/* Memory pool. Nb: first two fields must match core's VgHashNode. */
typedef
- struct _MAC_Mempool {
- struct _MAC_Mempool* next;
+ struct _MC_Mempool {
+ struct _MC_Mempool* next;
Addr pool; // pool identifier
SizeT rzB; // pool red-zone size
Bool is_zeroed; // allocations from this pool are ze=
roed
VgHashTable chunks; // chunks associated with this pool
}
- MAC_Mempool;
+ MC_Mempool;
=20
+
+extern void* MC_(new_block) ( ThreadId tid,
+ Addr p, SizeT size, SizeT align, UInt rzB=
,
+ Bool is_zeroed, MC_AllocKind kind,
+ VgHashTable table);
+extern void MC_(handle_free) ( ThreadId tid,
+ Addr p, UInt rzB, MC_AllocKind kind );
+
+extern void MC_(create_mempool) ( Addr pool, UInt rzB, Bool is_zeroed )=
;
+extern void MC_(destroy_mempool) ( Addr pool );
+extern void MC_(mempool_alloc) ( ThreadId tid, Addr pool,
+ Addr addr, SizeT size );
+extern void MC_(mempool_free) ( Addr pool, Addr addr );
+
+extern MC_Chunk* MC_(get_freed_list_head)( void );
+
+/* For tracking malloc'd blocks */
+extern VgHashTable MC_(malloc_list);
+
+/* For tracking memory pools. */
+extern VgHashTable MC_(mempool_list);
+
+/* Function pointers for the two tools to track interesting events. */
+extern void (*MC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited );
+extern void (*MC_(ban_mem_heap)) ( Addr a, SizeT len );
+extern void (*MC_(die_mem_heap)) ( Addr a, SizeT len );
+extern void (*MC_(copy_mem_heap))( Addr from, Addr to, SizeT len );
+
+/* Function pointers for internal sanity checking. */
+extern Bool (*MC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr );
+
+extern void MC_(print_malloc_stats) ( void );
+
+extern void* MC_(malloc) ( ThreadId tid, SizeT n );
+extern void* MC_(__builtin_new) ( ThreadId tid, SizeT n );
+extern void* MC_(__builtin_vec_new) ( ThreadId tid, SizeT n );
+extern void* MC_(memalign) ( ThreadId tid, SizeT align, Size=
T n );
+extern void* MC_(calloc) ( ThreadId tid, SizeT nmemb, Size=
T size1 );
+extern void MC_(free) ( ThreadId tid, void* p );
+extern void MC_(__builtin_delete) ( ThreadId tid, void* p );
+extern void MC_(__builtin_vec_delete) ( ThreadId tid, void* p );
+extern void* MC_(realloc) ( ThreadId tid, void* p, SizeT ne=
w_size );
+
+
+/*------------------------------------------------------------*/
+/*--- Errors and suppressions ---*/
+/*------------------------------------------------------------*/
+
+/* Extra info for overlap errors */
+typedef
+ struct {
+ Addr src;
+ Addr dst;
+ Int len; // -1 if unused
+ }
+ OverlapExtra;
+
extern void MC_(record_free_error) ( ThreadId tid, Addr a );=20
extern void MC_(record_illegal_mempool_error) ( ThreadId tid, Addr a );
extern void MC_(record_freemismatch_error) ( ThreadId tid, Addr a,
- MAC_Chunk* mc );
+ MC_Chunk* mc );
+extern Bool MC_(record_leak_error) ( ThreadId tid,=20
+ void* leak_extra,
+ ExeContext* where,
+ Bool print_record );
=20
/*------------------------------------------------------------*/
/*--- Profiling of tools and memory events ---*/
@@ -169,9 +152,9 @@
VgpToolCC;
=20
/* Define to collect detailed performance info. */
-/* #define MAC_PROFILE_MEMORY */
+/* #define MC_PROFILE_MEMORY */
=20
-#ifdef MAC_PROFILE_MEMORY
+#ifdef MC_PROFILE_MEMORY
# define N_PROF_EVENTS 500
=20
extern UInt MC_(event_ctr)[N_PROF_EVENTS];
@@ -191,7 +174,7 @@
=20
# define PROF_EVENT(ev, name) /* */
=20
-#endif /* MAC_PROFILE_MEMORY */
+#endif /* MC_PROFILE_MEMORY */
=20
=20
/*------------------------------------------------------------*/
@@ -204,47 +187,26 @@
#define SM_SIZE 65536 /* DO NOT CHANGE */
#define SM_MASK (SM_SIZE-1) /* DO NOT CHANGE */
=20
-#define VGM_BIT_VALID 0
-#define VGM_BIT_INVALID 1
+#define V_BIT_VALID 0
+#define V_BIT_INVALID 1
=20
-#define VGM_NIBBLE_VALID 0
-#define VGM_NIBBLE_INVALID 0xF
+#define V_BITS8_VALID 0
+#define V_BITS8_INVALID 0xFF
=20
-#define VGM_BYTE_VALID 0
-#define VGM_BYTE_INVALID 0xFF
+#define V_BITS16_VALID 0
+#define V_BITS16_INVALID 0xFFFF
=20
-#define VGM_SHORT_VALID 0
-#define VGM_SHORT_INVALID 0xFFFF
+#define V_BITS32_VALID 0
+#define V_BITS32_INVALID 0xFFFFFFFF
=20
-#define VGM_WORD32_VALID 0
-#define VGM_WORD32_INVALID 0xFFFFFFFF
+#define V_BITS64_VALID 0ULL
+#define V_BITS64_INVALID 0xFFFFFFFFFFFFFFFFULL
=20
-#define VGM_WORD64_VALID 0ULL
-#define VGM_WORD64_INVALID 0xFFFFFFFFFFFFFFFFULL
=20
-
-/* We want a 16B redzone on heap blocks for Memcheck */
-#define MAC_MALLOC_REDZONE_SZB 16
-
/*------------------------------------------------------------*/
-/*--- Variables ---*/
+/*--- Leak checking ---*/
/*------------------------------------------------------------*/
=20
-/* For tracking malloc'd blocks */
-extern VgHashTable MC_(malloc_list);
-
-/* For tracking memory pools. */
-extern VgHashTable MC_(mempool_list);
-
-/* Function pointers for the two tools to track interesting events. */
-extern void (*MC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited );
-extern void (*MC_(ban_mem_heap)) ( Addr a, SizeT len );
-extern void (*MC_(die_mem_heap)) ( Addr a, SizeT len );
-extern void (*MC_(copy_mem_heap))( Addr from, Addr to, SizeT len );
-
-/* Function pointers for internal sanity checking. */
-extern Bool (*MC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr );
-
/* For VALGRIND_COUNT_LEAKS client request */
extern SizeT MC_(bytes_leaked);
extern SizeT MC_(bytes_indirect);
@@ -252,38 +214,9 @@
extern SizeT MC_(bytes_reachable);
extern SizeT MC_(bytes_suppressed);
=20
-/*------------------------------------------------------------*/
-/*--- Functions ---*/
-/*------------------------------------------------------------*/
-
-extern void MC_(pp_AddrInfo) ( Addr a, AddrInfo* ai );
-
-extern void MC_(clear_MAC_Error) ( MAC_Error* err_extra );
-
-extern void* MC_(new_block) ( ThreadId tid,
- Addr p, SizeT size, SizeT align, UInt rzB=
,
- Bool is_zeroed, MAC_AllocKind kind,
- VgHashTable table);
-
-extern void MC_(handle_free) ( ThreadId tid,
- Addr p, UInt rzB, MAC_AllocKind kind );
-
-extern void MC_(create_mempool)(Addr pool, UInt rzB, Bool is_zeroed);
-
-extern void MC_(destroy_mempool)(Addr pool);
-
-extern void MC_(mempool_alloc)(ThreadId tid,=20
- Addr pool, Addr addr, SizeT size);
-
-extern void MC_(mempool_free)(Addr pool, Addr addr);
-
-extern MAC_Chunk* MC_(get_freed_list_head)( void );
-
/* For leak checking */
extern void MC_(pp_LeakError)(void* extra);
=20
-extern void MC_(print_malloc_stats) ( void );
-
typedef
enum {
LC_Off,
@@ -298,16 +231,6 @@
Bool (*is_valid_aligned_word) ( Addr )
);
=20
-extern void* MC_(malloc) ( ThreadId tid, SizeT n );
-extern void* MC_(__builtin_new) ( ThreadId tid, SizeT n );
-extern void* MC_(__builtin_vec_new) ( ThreadId tid, SizeT n );
-extern void* MC_(memalign) ( ThreadId tid, SizeT align, Size=
T n );
-extern void* MC_(calloc) ( ThreadId tid, SizeT nmemb, Size=
T size1 );
-extern void MC_(free) ( ThreadId tid, void* p );
-extern void MC_(__builtin_delete) ( ThreadId tid, void* p );
-extern void MC_(__builtin_vec_delete) ( ThreadId tid, void* p );
-extern void* MC_(realloc) ( ThreadId tid, void* p, SizeT ne=
w_size );
-
/*------------------------------------------------------------*/
/*--- Command line options + defaults ---*/
/*------------------------------------------------------------*/
@@ -345,7 +268,7 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- Functions ---*/
+/*--- Instrumentation ---*/
/*------------------------------------------------------------*/
=20
/* Functions defined in mc_main.c */
Modified: branches/COMPVBITS/memcheck/mc_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
--- branches/COMPVBITS/memcheck/mc_main.c 2005-12-08 03:24:37 UTC (rev 53=
14)
+++ branches/COMPVBITS/memcheck/mc_main.c 2005-12-08 22:24:07 UTC (rev 53=
15)
@@ -38,8 +38,6 @@
=20
#include "pub_tool_basics.h"
#include "pub_tool_aspacemgr.h"
-#include "pub_tool_errormgr.h" // For mc_include.h
-#include "pub_tool_execontext.h" // For mc_include.h
#include "pub_tool_hashtable.h" // For mc_include.h
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
@@ -171,22 +169,22 @@
// This isn't so difficult, it just requires careful attention in a few
// places.
=20
-#define MC_BITS8_NOACCESS 0x0 // 00b
-#define MC_BITS8_WRITABLE 0x1 // 01b
-#define MC_BITS8_READABLE 0x2 // 10b
-#define MC_BITS8_OTHER 0x3 // 11b
+#define VA_BITS8_NOACCESS 0x0 // 00b
+#define VA_BITS8_WRITABLE 0x1 // 01b
+#define VA_BITS8_READABLE 0x2 // 10b
+#define VA_BITS8_OTHER 0x3 // 11b
=20
-#define MC_BITS16_NOACCESS 0x0 // 00_00b
-#define MC_BITS16_WRITABLE 0x5 // 01_01b
-#define MC_BITS16_READABLE 0xa // 10_10b
+#define VA_BITS16_NOACCESS 0x0 // 00_00b
+#define VA_BITS16_WRITABLE 0x5 // 01_01b
+#define VA_BITS16_READABLE 0xa // 10_10b
=20
-#define MC_BITS32_NOACCESS 0x00 // 00_00_00_00b
-#define MC_BITS32_WRITABLE 0x55 // 01_01_01_01b
-#define MC_BITS32_READABLE 0xaa // 10_10_10_10b
+#define VA_BITS32_NOACCESS 0x00 // 00_00_00_00b
+#define VA_BITS32_WRITABLE 0x55 // 01_01_01_01b
+#define VA_BITS32_READABLE 0xaa // 10_10_10_10b
=20
-#define MC_BITS64_NOACCESS 0x0000 // 00_00_00_00b x 2
-#define MC_BITS64_WRITABLE 0x5555 // 01_01_01_01b x 2
-#define MC_BITS64_READABLE 0xaaaa // 10_10_10_10b x 2
+#define VA_BITS64_NOACCESS 0x0000 // 00_00_00_00b x 2
+#define VA_BITS64_WRITABLE 0x5555 // 01_01_01_01b x 2
+#define VA_BITS64_READABLE 0xaaaa // 10_10_10_10b x 2
=20
=20
#define SM_CHUNKS 16384
@@ -424,7 +422,7 @@
tl_assert(n);
// Shouldn't be fully defined or fully undefined -- those cases shoul=
dn't
// make it to the secondary V bits table.
- tl_assert(VGM_BYTE_VALID !=3D n->vbits8 && VGM_BYTE_INVALID !=3D n->v=
bits8 );
+ tl_assert(V_BITS8_VALID !=3D n->vbits8 && V_BITS8_INVALID !=3D n->vbi=
ts8 );
return n->vbits8;
}
=20
@@ -434,7 +432,7 @@
n =3D VG_(OSet_Lookup)(secVBitTable, &a);
// Shouldn't be fully defined or fully undefined -- those cases shoul=
dn't
// make it to the secondary V bits table.
- tl_assert(VGM_BYTE_VALID !=3D vbits8 && VGM_BYTE_INVALID !=3D vbits8 =
);
+ tl_assert(V_BITS8_VALID !=3D vbits8 && V_BITS8_INVALID !=3D vbits8 );
if (n) {
n->vbits8 =3D vbits8; // update
} else {
@@ -524,7 +522,7 @@
valid addresses and Defined for invalid addresses. Iterate over
the bytes in the word, from the most significant down to the
least. */
- ULong vw =3D VGM_WORD64_INVALID;
+ ULong vw =3D V_BITS64_INVALID;
SizeT i =3D szB-1;
SizeT n_addrs_bad =3D 0;
Addr ai;
@@ -543,13 +541,13 @@
// XXX: We check in order of most likely to least likely...
// XXX: could maybe have a little lookup table instead of these
// chained conditionals? and elsewhere?
- if ( MC_BITS8_READABLE =3D=3D vabits8 ) { vbyte =3D VGM_BYTE_=
VALID; }
- else if ( MC_BITS8_WRITABLE =3D=3D vabits8 ) { vbyte =3D VGM_BYTE_=
INVALID; }
- else if ( MC_BITS8_NOACCESS =3D=3D vabits8 ) {
- vbyte =3D VGM_BYTE_VALID; // Make V bits defined!
+ if ( VA_BITS8_READABLE =3D=3D vabits8 ) { vbyte =3D V_BITS8_V=
ALID; }
+ else if ( VA_BITS8_WRITABLE =3D=3D vabits8 ) { vbyte =3D V_BITS8_I=
NVALID; }
+ else if ( VA_BITS8_NOACCESS =3D=3D vabits8 ) {
+ vbyte =3D V_BITS8_VALID; // Make V bits defined!
n_addrs_bad++;
} else {
- tl_assert( MC_BITS8_OTHER =3D=3D vabits8 );
+ tl_assert( VA_BITS8_OTHER =3D=3D vabits8 );
vbyte =3D get_sec_vbits8(ai);
}
vw <<=3D 8;=20
@@ -601,12 +599,12 @@
ai =3D a+byte_offset_w(szB,bigendian,i);
vbyte =3D vbytes & 0xff;
vabits8 =3D get_vabits8(ai);
- if ( MC_BITS8_NOACCESS !=3D vabits8 ) {
+ if ( VA_BITS8_NOACCESS !=3D vabits8 ) {
// Addressable. Convert in-register format to in-memory format=
.
- if ( VGM_BYTE_VALID =3D=3D vbyte ) { vabits8 =3D MC_BITS=
8_READABLE; }
- else if ( VGM_BYTE_INVALID =3D=3D vbyte ) { vabits8 =3D MC_BITS=
8_WRITABLE; }
+ if ( V_BITS8_VALID =3D=3D vbyte ) { vabits8 =3D VA_BITS8=
_READABLE; }
+ else if ( V_BITS8_INVALID =3D=3D vbyte ) { vabits8 =3D VA_BITS8=
_WRITABLE; }
else {=20
- vabits8 =3D MC_BITS8_OTHER;
+ vabits8 =3D VA_BITS8_OTHER;
set_sec_vbits8(ai, vbyte);
}
set_vabits8(ai, vabits8);
@@ -716,9 +714,9 @@
PROF_EVENT(150, "set_address_range_perms");
=20
/* Check the V+A bits make sense. */
- tl_assert(vabits64 =3D=3D MC_BITS64_NOACCESS ||
- vabits64 =3D=3D MC_BITS64_WRITABLE ||
- vabits64 =3D=3D MC_BITS64_READABLE);
+ tl_assert(vabits64 =3D=3D VA_BITS64_NOACCESS ||
+ vabits64 =3D=3D VA_BITS64_WRITABLE ||
+ vabits64 =3D=3D VA_BITS64_READABLE);
=20
if (lenT =3D=3D 0)
return;
@@ -726,9 +724,9 @@
if (lenT > 100 * 1000 * 1000) {
if (VG_(clo_verbosity) > 0 && !VG_(clo_xml)) {
Char* s =3D "unknown???";
- if (vabits64 =3D=3D MC_BITS64_NOACCESS) s =3D "noaccess";
- if (vabits64 =3D=3D MC_BITS64_WRITABLE) s =3D "writable";
- if (vabits64 =3D=3D MC_BITS64_READABLE) s =3D "readable";
+ if (vabits64 =3D=3D VA_BITS64_NOACCESS) s =3D "noaccess";
+ if (vabits64 =3D=3D VA_BITS64_WRITABLE) s =3D "writable";
+ if (vabits64 =3D=3D VA_BITS64_READABLE) s =3D "readable";
VG_(message)(Vg_UserMsg, "Warning: set address range perms: "
"large range %lu (%s)", lenT, s);
}
@@ -931,21 +929,21 @@
{
PROF_EVENT(40, "mc_make_noaccess");
DEBUG("mc_make_noaccess(%p, %lu)\n", a, len);
- set_address_range_perms ( a, len, MC_BITS64_NOACCESS, SM_DIST_NOACCES=
S );
+ set_address_range_perms ( a, len, VA_BITS64_NOACCESS, SM_DIST_NOACCES=
S );
}
=20
static void mc_make_writable ( Addr a, SizeT len )
{
PROF_EVENT(41, "mc_make_writable");
DEBUG("mc_make_writable(%p, %lu)\n", a, len);
- set_address_range_perms ( a, len, MC_BITS64_WRITABLE, SM_DIST_WRITABL=
E );
+ set_address_range_perms ( a, len, VA_BITS64_WRITABLE, SM_DIST_WRITABL=
E );
}
=20
static void mc_make_readable ( Addr a, SizeT len )
{
PROF_EVENT(42, "mc_make_readable");
DEBUG("mc_make_readable(%p, %lu)\n", a, len);
- set_address_range_perms ( a, len, MC_BITS64_READABLE, SM_DIST_READABL=
E );
+ set_address_range_perms ( a, len, VA_BITS64_READABLE, SM_DIST_READABL=
E );
}
=20
=20
@@ -1010,7 +1008,7 @@
=20
sm =3D primary_map[sec_no];
sm_off =3D SM_OFF(a);
- sm->vabits32[sm_off] =3D MC_BITS32_WRITABLE;
+ sm->vabits32[sm_off] =3D VA_BITS32_WRITABLE;
}
=20
=20
@@ -1045,7 +1043,7 @@
=20
sm =3D primary_map[sec_no];
sm_off =3D SM_OFF(a);
- sm->vabits32[sm_off] =3D MC_BITS32_NOACCESS;
+ sm->vabits32[sm_off] =3D VA_BITS32_NOACCESS;
}
=20
=20
@@ -1079,7 +1077,7 @@
=20
sm =3D primary_map[sec_no];
sm_off64 =3D SM_OFF_64(a);
- ((UShort*)(sm->vabits32))[sm_off64] =3D MC_BITS64_WRITABLE;
+ ((UShort*)(sm->vabits32))[sm_off64] =3D VA_BITS64_WRITABLE;
}
=20
=20
@@ -1112,7 +1110,7 @@
=20
sm =3D primary_map[sec_no];
sm_off64 =3D SM_OFF_64(a);
- ((UShort*)(sm->vabits32))[sm_off64] =3D MC_BITS64_NOACCESS;
+ ((UShort*)(sm->vabits32))[sm_off64] =3D VA_BITS64_NOACCESS;
}
=20
=20
@@ -1374,22 +1372,22 @@
is modifiable. */
UWord v_off =3D SM_OFF(a_lo);
UShort* p =3D (UShort*)(&sm->vabits32[v_off]);
- p[ 0] =3D MC_BITS64_WRITABLE;
- p[ 1] =3D MC_BITS64_WRITABLE;
- p[ 2] =3D MC_BITS64_WRITABLE;
- p[ 3] =3D MC_BITS64_WRITABLE;
- p[ 4] =3D MC_BITS64_WRITABLE;
- p[ 5] =3D MC_BITS64_WRITABLE;
- p[ 6] =3D MC_BITS64_WRITABLE;
- p[ 7] =3D MC_BITS64_WRITABLE;
- p[ 8] =3D MC_BITS64_WRITABLE;
- p[ 9] =3D MC_BITS64_WRITABLE;
- p[10] =3D MC_BITS64_WRITABLE;
- p[11] =3D MC_BITS64_WRITABLE;
- p[12] =3D MC_BITS64_WRITABLE;
- p[13] =3D MC_BITS64_WRITABLE;
- p[14] =3D MC_BITS64_WRITABLE;
- p[15] =3D MC_BITS64_WRITABLE;
+ p[ 0] =3D VA_BITS64_WRITABLE;
+ p[ 1] =3D VA_BITS64_WRITABLE;
+ p[ 2] =3D VA_BITS64_WRITABLE;
+ p[ 3] =3D VA_BITS64_WRITABLE;
+ p[ 4] =3D VA_BITS64_WRITABLE;
+ p[ 5] =3D VA_BITS64_WRITABLE;
+ p[ 6] =3D VA_BITS64_WRITABLE;
+ p[ 7] =3D VA_BITS64_WRITABLE;
+ p[ 8] =3D VA_BITS64_WRITABLE;
+ p[ 9] =3D VA_BITS64_WRITABLE;
+ p[10] =3D VA_BITS64_WRITABLE;
+ p[11] =3D VA_BITS64_WRITABLE;
+ p[12] =3D VA_BITS64_WRITABLE;
+ p[13] =3D VA_BITS64_WRITABLE;
+ p[14] =3D VA_BITS64_WRITABLE;
+ p[15] =3D VA_BITS64_WRITABLE;
return;
}
}
@@ -1430,7 +1428,7 @@
for (i =3D 0; i < len; i++) {
PROF_EVENT(61, "mc_check_noaccess(loop)");
vabits8 =3D get_vabits8(a);
- if (MC_BITS8_NOACCESS !=3D vabits8) {
+ if (VA_BITS8_NOACCESS !=3D vabits8) {
if (bad_addr !=3D NULL) *bad_addr =3D a;
return False;
}
@@ -1449,7 +1447,7 @@
for (i =3D 0; i < len; i++) {
PROF_EVENT(63, "mc_check_writable(loop)");
vabits8 =3D get_vabits8(a);
- if (MC_BITS8_NOACCESS =3D=3D vabits8) {
+ if (VA_BITS8_NOACCESS =3D=3D vabits8) {
if (bad_addr !=3D NULL) *bad_addr =3D a;
return False;
}
@@ -1468,11 +1466,11 @@
for (i =3D 0; i < len; i++) {
PROF_EVENT(65, "mc_check_readable(loop)");
vabits8 =3D get_vabits8(a);
- if (MC_BITS8_READABLE !=3D vabits8) {
+ if (VA_BITS8_READABLE !=3D vabits8) {
// Error! Nb: Report addressability errors in preference to
// definedness errors.
if (bad_addr !=3D NULL) *bad_addr =3D a;
- return ( MC_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
+ return ( VA_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
}
a++;
}
@@ -1493,11 +1491,11 @@
while (True) {
PROF_EVENT(67, "mc_check_readable_asciiz(loop)");
vabits8 =3D get_vabits8(a);
- if (MC_BITS8_READABLE !=3D vabits8) {
+ if (VA_BITS8_READABLE !=3D vabits8) {
// Error! Nb: Report addressability errors in preference to
// definedness errors.
if (bad_addr !=3D NULL) *bad_addr =3D a;
- return ( MC_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
+ return ( VA_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
}
/* Ok, a is safe to read. */
if (* ((UChar*)a) =3D=3D 0) {
@@ -1650,7 +1648,7 @@
{
UChar area[1024];
tl_assert(size <=3D 10...
[truncated message content] |