1143 Commits

Author SHA1 Message Date
Nicholas Nethercote
4877ebb17e Moved the MALLOCLIKE and FREELIKE client requests out of memcheck.h, and into
valgrind.h.  Although these requests are not implemented by the core, they can
be implemented by skins that track heap blocks, eg. Memcheck, Annelid, Massif.
This is in preparation for committing Massif to the repository.

I think I managed to make the change in a binary-compatible way.  The only
inconvenience for users is that if they have a client program compiled with the
old requests in, Valgrind will abort with an explanatory message that tells
them to recompile.  Once they've done that (no changes to their program are
required), it works again.

I even updated the docs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1881
2003-10-02 13:44:04 +00:00
Nicholas Nethercote
24b34c91c8 Fixed up the client request info in the docs, which required splitting the core
requests from the Memcheck requests and putting the descriptions in the
appropriate parts of the docs.

Removed the __VALGRIND_SOME_SKIN_H test -- it was designed to prevent people
#including valgrind.h when they probably want memcheck.h, but it's actually a
reasonable thing to do to #include valgrind.h alone, because there are some
requests in valgrind.h.

Removed references to VALGRIND_MAKE_NOACCESS_STACK from the docs, as it doesn't
exist in the implementation.

Fixed a few other minor things.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1880
2003-10-02 13:25:02 +00:00
Nicholas Nethercote
b96d01c13f Improved the ESP-update pass -- it's method for finding the ESP-deltas was very
fragile, and it was lucky that it worked at all.  Replaced it with a much more
robust method.  Thanks to Dirk Mueller for pointing it out.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1879
2003-10-01 16:45:04 +00:00
Dirk Mueller
959360f151 speed optimisation: assuming that a tempreg not related to %esp before
is PUTed into %ESP, we do *know* that this tempreg points to %ESP afterwards,
so track it.

reduces the amount of expensive "DO_GENERIC" calls by 75% in Khtml. I've
not observed a problem with it, but consider it experimental.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1878
2003-10-01 10:19:08 +00:00
Dirk Mueller
e762570dbb export emit_movzbl_regmem_reg as the other variants are exported too
and its useful for skins


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1877
2003-09-30 23:01:50 +00:00
Dirk Mueller
07da1d7887 inc/dec %ESP support
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1876
2003-09-30 22:58:12 +00:00
Nicholas Nethercote
bc7e854aee The name-mangled versions of __builtin_new() and __builtin_vec_new() now
don't just call the unmangled versions, but do the appropriate stuff
themselves directly (this was necessary for Massif).  This means that stack
traces for them have one fewer function.  And I was able to gather up several
very similar functions into a macro, reducing the amount of code, which was
nice.  Had to update one regtest's expected output accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1875
2003-09-30 16:52:47 +00:00
Nicholas Nethercote
02494a520e Export to skins a function, VG_(HT_count_nodes)(), which was always intended to
be visible to them, but I had forgotten to export.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1874
2003-09-30 15:43:51 +00:00
Nicholas Nethercote
1e843020c5 comment change only
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1873
2003-09-30 15:37:24 +00:00
Nicholas Nethercote
ef2eff1717 Removed sort_hash_array(). Changed VG_(HT_to_sorted_array)() to
VG_(HT_to_array)().  Leak checker now sorts the given array itself, using
VG_(ssort)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1872
2003-09-30 15:35:13 +00:00
Nicholas Nethercote
79e91e16ea Added a generic VG_(ssort)() function, like stdlib.h's qsort(). It's
specialised for the size == 1/2/4 cases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1871
2003-09-30 14:43:54 +00:00
Nicholas Nethercote
8091ee4ca8 Teach Helgrind to cope with negative args to malloc(). Also slightly economise
calloc().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1870
2003-09-30 14:20:00 +00:00
Nicholas Nethercote
2507f022ce Added a new flag ',' to printf() format specifications. When specified in a
number, will print it with commas delimiting it.  Very useful when printing
large numbers.

Using it, was able to remove the wretched commify() function from Cachegrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1869
2003-09-30 14:15:44 +00:00
Nicholas Nethercote
18de7ba96b Made VG_(read_millisecond_timer)() available to skins. Also made it cope
with being called from SK_(pre_clo_init)(), before its startup code has been
run (just returns 0).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1868
2003-09-30 14:03:21 +00:00
Nicholas Nethercote
4e147a4eaf Added VG_(getcwd_alloc)(), which is much easier to use than VG_(getcwd)().
(getcwd() is really a pretty stupid syscall)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1867
2003-09-30 13:51:23 +00:00
Nicholas Nethercote
7303425ddd Tiny formatting changes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1866
2003-09-30 13:33:24 +00:00
Nicholas Nethercote
f886d99345 Disallowed size==1 for WIDEN.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1865
2003-09-30 13:22:30 +00:00
Julian Seward
b96d8d6227 Don't panic on MMX UInstrs. In effect, makes it work for MMX, as well
as SSE/SSE2.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1861
2003-09-30 00:13:30 +00:00
Julian Seward
d9e3da1795 Implement MOVQ -- move 8 bytes of XMM reg or mem to XMM reg.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1860
2003-09-30 00:12:54 +00:00
Nicholas Nethercote
68ef3df81d Change things so that default.supp is only deleted with "make distclean",
rather than "make clean", which is the behaviour recommended by the automake
docs for files built at configure-time.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1859
2003-09-29 20:50:49 +00:00
Nicholas Nethercote
af067e5375 Add a couple more CPUID-auto-detect cases for Intel CPUs to Cachegrind, thanks
to Josef Weidendorfer.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1858
2003-09-29 15:55:44 +00:00
Nicholas Nethercote
a2edbd2aad Fix broken regtest.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1857
2003-09-29 14:45:44 +00:00
Nicholas Nethercote
c8c6b4132e Fix minor cut+paste error.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1856
2003-09-29 12:58:37 +00:00
Dirk Mueller
93a42d0325 revert accidental debug code I committed last time.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1855
2003-09-29 10:56:24 +00:00
Nicholas Nethercote
ad476e4c65 Fixed the static-link check at startup -- it was broken for scripts. Refine
FAQ #5 accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1854
2003-09-28 18:18:47 +00:00
Julian Seward
19d8fe0bd9 Increase size of block-tracking hash table(s) from 997 to 4999.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1841
2003-09-28 16:32:58 +00:00
Julian Seward
48f3e73e5e Add a suppression for stack underrun bug(s) in the c++ support library
distributed with Intel Icc 7.0.
(/opt/intel/compiler70/ia32/lib/libcxa.so.3)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1840
2003-09-27 21:25:30 +00:00
Dirk Mueller
8d8ec2ca64 implement IN and OUT opcodes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1839
2003-09-27 20:15:01 +00:00
Nicholas Nethercote
ff5d331a0a Remove extraneous tabs from Memcheck --trace-codegen output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1838
2003-09-27 19:54:04 +00:00
Nicholas Nethercote
f8762eb55d Remove two pieces of identical code used by Memcheck and Addrcheck, and put
them in a shared place.  (They used to be different, when Addrcheck didn't
distinguish between reads and writes, but now they're the same.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1837
2003-09-26 14:55:31 +00:00
Nicholas Nethercote
21175aa99b Add support for "movl imm32, %esp". Needed for 'grinding vg_startup.S :)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1836
2003-09-26 09:11:51 +00:00
Nicholas Nethercote
6436799e7d Fix a couple of bugs in the sigalstack wrapper (Nb: found when I was
(apparently) self-hosting :)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1835
2003-09-26 09:06:41 +00:00
Dirk Mueller
eaf2fd38cd implement a couple more instructions. I've mailed this patch to Julian
and Nick but got no reply. I guess they're okay with it. I tested them
quite a lot so it should be fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1834
2003-09-26 00:32:53 +00:00
Dirk Mueller
3545e98607 be more specific which allocation failed
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1833
2003-09-26 00:26:07 +00:00
Dirk Mueller
5591d2e2d8 implement all SSE(2) ucodes. now I can run mplayer in valgrind :)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1832
2003-09-26 00:16:25 +00:00
Nicholas Nethercote
01e3345f23 At startup, now tests if program is statically linked. Bails with a useful
message if so.  If anyone thinks this will break anything, please yell.

Updated FAQ #5 correspondingly, added info on how to combine static and dynamic
libraries.

MERGE TO STABLE(?)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1831
2003-09-25 18:20:17 +00:00
Nicholas Nethercote
ce82c07580 Cleaned up reading of debug info a bit.
Renamed:
  VG_(read_procselfmaps_contents)() --> VG_(read_procselfmaps)()
  VG_(read_procselfmaps)()          --> VG_(parse_procselfmaps)()
  VG_(read_symbols)()               --> VG_(read_all_symbols)()
  VG_(read_symtab_callback)()       --> VG_(read_seg_symbols)()

Removed the Bool 'read_from_file' arg from (what is now)
VG_(parse_procselfmaps)().  If /proc/self/maps needs to be read beforehand, the
code calls (what is now) VG_(read_procselfmaps)() before.  Still using the
static buffer which is not nice but good enough.

More importantly, I split up VG_(new_exe_segment)() into
VG_(new_exeseg_startup)() and VG_(new_exeseg_mmap)().  This is because at
startup, we were stupidly calling VG_(read_symbols)() for every exe seg, which
parses /proc/self/maps completely in order to load the debug info/symbols for
the exe seg (and any others we haven't already got the symbols for).  Despite
the fact that the startup code reads /proc/self/maps to know which segments are
there at startup.  In other words, we were reading /proc/self/maps several
times more often than necessary, and there were nested reads, which Stephan
Kulow's recent depth patch fixed (but in a pretty hacky way;  this commit fixes
it properly).  So VG_(new_exeseg_startup)() now doesn't cause /proc/self/maps
to be re-read.  Unfortunately we do have to re-read /proc/self/maps for mmap(),
because we don't know the filename from the mmap() call (only the file
descriptor, which isn't enough).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1830
2003-09-25 17:54:11 +00:00
Dirk Mueller
60f7936600 typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1829
2003-09-23 19:07:16 +00:00
Nicholas Nethercote
d9309149c8 Addrcheck was broken, because it wasn't recognising "Overlap" suppressions.
Fixed now.

MERGE TO STABLE (assuming that Addrcheck does overlap checking in STABLE, which
I think it does)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1828
2003-09-19 08:10:07 +00:00
Nicholas Nethercote
3534c8fc08 Using start_eip instead of eip for disassembly failure messages.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1827
2003-09-18 08:37:20 +00:00
Dirk Mueller
a1e28f774d add suppression about common X11 protocol and ICE errors. Please
scream if you don't like this.. Personally I've never seen a valid
warning and all of them were spurious.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1826
2003-09-18 01:49:30 +00:00
Dirk Mueller
0f45de2a6d remove default.supp during clean
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1825
2003-09-18 01:42:24 +00:00
Dirk Mueller
7d1abc6b9e compiler warning fixes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1824
2003-09-18 01:41:48 +00:00
Dirk Mueller
612b8daeac fix compiler warnings
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1823
2003-09-18 01:39:50 +00:00
Dirk Mueller
34af4d4549 fix compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1822
2003-09-18 01:15:32 +00:00
Julian Seward
f08f0f0ca3 Suppress a couple more messages when -q applies.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1821
2003-09-17 21:48:26 +00:00
Julian Seward
76b167b551 Add patch from Stephan Kulow to solve the following:
read_procselfmaps calls *record_mapping which
   is startup_segment_callback for init_memory. But this
   again calls through read_symbols read_procselfmaps
   again with read_from_file == True. But this overwrites
   the internal buffer and causes parsing errors.
   (What makes the error a bit funny is that valgrind
    wouldn't have catched that error afaik :)
   Anyway: our solution is to forbid read_from_file from
   with callbacks

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1820
2003-09-17 07:39:28 +00:00
Nicholas Nethercote
c0f0059bf7 Added some skin-visible functions that give skins a bit more control over
how stack snapshots are taken and printed;  they can be used in preference
to VG_(get_ExeContext)() and VG_(pp_ExeContext)().  These are used by
Massif, my heap profiling skin.

Changed --num-callers to allow a backtrace size of 1.

Added code so that when Valgrind fails to disassemble an instruction, the
instructions line/file and address are printed out, which makes it easier to
work out where and what it is.  Required the stack snapshot changes above.

MERGE TO STABLE?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1819
2003-09-16 07:41:43 +00:00
Nicholas Nethercote
977e0eb56f Made the realpath overlap ones apply for Addrcheck too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1818
2003-09-15 07:19:19 +00:00
Nicholas Nethercote
0c7c912c5b Fix problem with adjtimex.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1817
2003-09-09 11:27:59 +00:00