60 Commits

Author SHA1 Message Date
Julian Seward
9b734f2384 Markup bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@352
2002-06-01 23:56:38 +00:00
Julian Seward
1ece8474f2 Update author attributions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@350
2002-06-01 23:43:49 +00:00
Julian Seward
162b23f120 Update for sigaltstack
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@312
2002-05-22 23:56:33 +00:00
Julian Seward
53c56fd4d1 Implement semaphore functions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@295
2002-05-19 00:13:34 +00:00
Julian Seward
96b04d4f30 Fix fork/exec stuff so it works again. We have to mangle LD_LIBRARY_PATH
as well as LD_PRELOAD, so as to make our libpthread.so go out of scope
when a child which we don't want to trace, is exec'd.  Otherwise the
child can wind up being connected to our libpthread.so but not to
valgrind.so, which is an unworkable combination; you have to be connected
to both or neither.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@291
2002-05-18 13:14:17 +00:00
Julian Seward
e45ef9f6cc Add clarification of the purpose of the malloc/free mismatch checks
(Pascal Massimino)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@289
2002-05-18 11:09:19 +00:00
Julian Seward
6610ca19b3 Remove existing non-working support for self-modifying code, and instead
add a simple compromise, in which the client can notify valgrind
that certain code address ranges are invalid and should be retranslated.
This is done using the VALGRIND_DISCARD_TRANSLATIONS macro in valgrind.h.

At the same time take the opportunity to close the potentially fatal
loophole that translations for executable segments were not being
discarded when those segments were munmapped.  They are now.

Documentation updated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@274
2002-05-16 11:06:21 +00:00
Nicholas Nethercote
ab8de9f4f7 Fix incredibly stupid bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@270
2002-05-15 14:30:55 +00:00
Nicholas Nethercote
8cbe9082c5 Expanded --sort option to take threshold args with the event names. Lets you
do things like "show functions covering 99% of all D2mr events *and* 99% of all
D2mw events" - before you could only choose the threshold for one.

Useful for me, but probably no-one else.  Still mentioned it in the docs,
though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@269
2002-05-13 20:27:54 +00:00
Frédéric Gobry
460d2313d2 Use $(srcdir) to specify the location of the linker script
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@268
2002-05-13 07:50:45 +00:00
Julian Seward
d6920d2b5c Fix spelling mistake: wierd*hacks --> weird*hacks
Also add a testcase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@265
2002-05-12 10:52:16 +00:00
Julian Seward
2943666eb5 In order to catch timeout events on fds which are readable and which
have been ioctl(TCSETA)'d with a VTIMEout, we appear to need to ask if
the fd is writable, for some reason.  Ask me not why.  Since this is
strange and potentially troublesome we only do it if the user asks
specially, by specifying --wierd-hacks=ioctl-VTIME.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@264
2002-05-12 03:00:17 +00:00
Julian Seward
59ff40a36c Insert hacks, only partially successful, to make 'make distcheck' work
with the new vg_libpthread.vs linker script.  Problem is that builds
where builddir != srcdir don't work now.  Don't know how to fix.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@253
2002-05-10 03:03:57 +00:00
Julian Seward
aa02efa1a0 More symbol versioning stuff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@250
2002-05-10 01:52:58 +00:00
Julian Seward
ee775d8b61 Add a version script so as to create the right versioned symbols for
libpthread.so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@249
2002-05-10 01:42:33 +00:00
Nicholas Nethercote
74bb5ef434 Minor corrections about cache profiling cost centres.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@243
2002-05-09 15:43:33 +00:00
Nicholas Nethercote
53d40a27da vg_symtab2.c:
- No longer aborting when encountering a N_SOL symbol after the 65535th
      line in a file, just printing a warning/apology that annotations/messages
      might be wrong.

      This is a pain to fix properly, since it requires first guessing when a
      line number overflow happens, then switching to one or more other files,
      then switching back.

manual: wibble


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@225
2002-05-07 10:26:57 +00:00
Julian Seward
b8da65e6bd External namespace cleanup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@210
2002-05-03 22:29:04 +00:00
Nicholas Nethercote
ea2c63ce9e Removed description of cachegrind.out file format, since it's now in the tech
docs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@199
2002-05-03 17:54:51 +00:00
Nicholas Nethercote
ece0587a11 Added section to tech docs on how cachegrind works, including the
cachegrind.out file format.

Tiny change in user manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@198
2002-05-03 17:51:10 +00:00
Nicholas Nethercote
c501c4beaf vg_symtab2.c:
- Can now handle file sizes > 65536 lines, despite the stabs format only
      storing line numbers in a short.  Do this heuristically, by looking for
      line number sequences that go from 65000-odd to 0-odd within the same
      file.

      This required changing the RiLoc.lineno field to 20 bytes, which gives a
      maximum file length of 1,000,000-odd lines, whichs seems reasonable.

      In order to keep RiLoc at 12 bytes (important because there are lots of
      them) this required stealing four bits from the RiLoc.size field,
      reducing it to 12 bits.  This isn't too bad because the size is unlikely
      to be larger than 4096 bytes -- we were already ignoring any ones larger
      than 10,000 bytes because they were suspicious anyway (and see next
      point).

    - Tightened up the sanity checking on line address ranges.  Previously any
      range that looked suspicious (eg. > 10000 bytes, or not within the bound
      of the segment info) was simply ignored(!)  Now it prints a warning when
      this happens and truncates the size to 1 to be safe;  also there are some
      extra assertions for totally space-cadet numbers.

      (At first these checks were all assertions, but I tried a version of GNU
      gas that produces a small handful of dodgy stabs entries;  warnings
      seemed a reasonable compromise.)

vg_cachesim.c:
    - Removed the requirement that both types of cost centre (iCC, idCC) have
      instr_addr as their second word.  Less fragile -- now the only
      requirement is that they both have their type tag as their first byte.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@197
2002-05-03 16:41:05 +00:00
Nicholas Nethercote
6503fcaf5a Added "L2 refs line" (an oversight).
Fixed minor output summary spacing wibble.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@196
2002-05-02 13:56:34 +00:00
Julian Seward
892eb8f8fc Remove comments about Mozilla 1.0RC1 crashing, since that's not a Valgrind
bug, and explain, for the benefit of Mozilla hackers, how to make 1.0RC1
work on Valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@195
2002-05-02 03:57:00 +00:00
Dirk Mueller
303554e3ad fix for auto-annotating C++ method names (they have :'s in it)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@191
2002-05-01 21:52:05 +00:00
Julian Seward
50ca1d2fc2 Fix free and free-mismatch err so the top frame in the bt isn't skipped.
Put a better example of free-mismatch error in the manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@190
2002-05-01 21:46:38 +00:00
Julian Seward
6b485c7718 Bring manual up-to-date and add stuff about pthread support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@189
2002-05-01 12:38:06 +00:00
Julian Seward
55019fd863 Don't want to see these guys with just -v. There get to be bazillions
of them after a while.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@184
2002-05-01 02:32:10 +00:00
Julian Seward
ebe11593f2 Build and install 'cachegrind' along with 'valgrind'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@181
2002-05-01 01:25:45 +00:00
Julian Seward
c786245133 Edit cache stuff, minorly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@180
2002-05-01 01:24:52 +00:00
Nicholas Nethercote
1818ed0e51 vg_symtab2.c:
Discovered sometimes a SLINE stabs entry is the last one (which broke an
    assertion).  In such a case, we must guess the line's instruction address
    range -- I've guessed 4, arbitrarily.

vg_cachegen.in, vg_cachesim_{I1,D1,L2}.c:
    Discovered a bad bug in the cache simulation:  when determining if a
    references straddles two memory blocks, to find the end of the range I was
    adding 'size' to the base address, rather than 'size - 1'.  This was
    causing way too many straddled references, which would inflate the miss
    counts.

vg_cachesim.c:
    Minor stuff


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@176
2002-04-30 13:44:01 +00:00
Nicholas Nethercote
bf347fb8e0 Added note about bts/btr/btc causing bogus cache read counts.
Added to todo list note about files with > 65536 lines.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@175
2002-04-30 12:46:22 +00:00
Nicholas Nethercote
ee24852e5a Right-justifying event names instead of left-justifying; easier to read when
large numbers are involved and the columns are wide.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@174
2002-04-30 11:34:54 +00:00
Julian Seward
6c89523e81 Relax assertion to avoid this: vg_cachesim.c:402
(compute_BBCC_array_size): Assertion `!is_STORE && !is_FPU_R &&
!is_FPU_W' failed.

I don't know if this is correct, but I can run kate having done so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@171
2002-04-30 10:18:48 +00:00
Julian Seward
7558b43cf5 Config/build/install vg_annotate and vg_cachegen correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@169
2002-04-29 17:27:07 +00:00
Nicholas Nethercote
fcc45a9e85 New files:
- vg_cachesim.c
  - vg_cachesim_{I1,D1,L2}.c
  - vg_annotate.in
  - vg_cachegen.in

Changes to existing files:

  - valgrind/valgrind.in, added option:

        --cachesim=no|yes       [no]

  - Makefile/Makefile.am:
        * added vg_cachesim.c to valgrind_so_SOURCES var
        * added vg_cachesim_I1.c, vg_cachesim_D1.c, vg_cachesim_L2.c to
          noinst_HEADERS var
        * added vg_annotate, vg_cachegen to 'bin_SCRIPTS' var, and added empty
          targets for them

  - vg_main.c:
        * added two offsets for cache sim functions (put in positions 17a,17b)
        * added option handling (detection of --cachesim=yes which turns off of
          --instrument);
        * added calls to cachesim initialisation/finalisation functions

  - vg_mylibc: added some system call wrappers (for chmod, open_write, etc) for
    file writing

  - vg_symtab2.c:
        * allow it to read symbols if either of --instrument or --cachesim is
          used
        * made vg_symtab2.c:vg_what_{line,fn}_is_this extern, renaming it as
          VG_(what_line_is_this) (and added to vg_include.h)
        * completely rewrote the read loop in vg_read_lib_symbols, fixing
          several bugs.  Much better now, although probably not perfect.  It's
          also relatively fragile -- I'm using the "die immediately if anything
          unexpected happens" approach.

  - vg_to_ucode.c:
        * in VG_(disBB), patching in x86 instruction size into extra4b field of
          JMP instructions at the end of basic blocks if --cachesim=yes.
          Shifted things around to do this;  also had to fiddle around with
          single-step stuff to get this to work, by not sticking extra JMPs on
          the end of the single-instruction block if there was already one
          there (to avoid breaking an assertion in vg_cachesim.c).  Did a
          similar thing to avoid an extra JMP on huge basic blocks that are
          split.

  - vg_translate.c:
        * if --cachesim=yes call the cachesim instrumentation phase
        * made some functions extern and renamed:
                allocCodeBlock() --> VG_(allocCodeBlock)()
                freeCodeBlock()  --> VG_(freeCodeBlock)()
                copyUInstr()     --> VG_(copyUInstr)()
          (added to vg_include.h too)

  - vg_include.c: declared
        * cachesim offsets
        * exports of vg_cachesim.c
        * added four new profiling events (increasing VGP_M_CCS to 24 -- I kept
          the spare ones)
        * added comment about UInstr.extra4b field being used for instr size in
          JMPs for cache simulation

  - docs/manual.html:
        * Added --cachesim option to section 2.5.
        * Added cache profiling stuff as section 7.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@168
2002-04-29 16:03:24 +00:00
Julian Seward
c81d619159 Administrivia.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@154
2002-04-26 14:30:52 +00:00
Julian Seward
c107508a0f Try and give at least some minimal binding for all functions exported
by the real libpthread.so.  In the process fix a bunch of stuff, including
adding thread-specific h_errno and resolver state storage.  This fixes
licq crashing at startup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@149
2002-04-25 20:17:29 +00:00
Julian Seward
66e3ae4b8f - Use CFLAGS in demangle/Makefile.am
- Get rid of -Werror; it breaks to many people's builds.  It can be
  passed in with make variable WERROR if needed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@127
2002-04-24 11:14:22 +00:00
Dirk Mueller
4cf90f4696 - don't check if the compiler supports const. No compiler we care
about doesn't support it
- readd -Werror
- move setting of CFLAGS to the Makefile instead of the configure
  script, to avoid that the custom flags we use screw up configure checks


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@113
2002-04-21 13:32:28 +00:00
Julian Seward
d972c3452c Compile flags += -Werror. I'm tired of looking carefully for warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@97
2002-04-18 10:03:02 +00:00
Julian Seward
fe8ade38b8 Change --trace-pthread= flag to accept none|some|all, for finer level
of pthread event tracing.  And allow this info to be passed across to
the client, where vg_libpthread.c uses it to also control verbosity.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@91
2002-04-16 22:50:32 +00:00
Julian Seward
93b2c2ed95 Get rid of the muraroa.demon.co.uk references since that account is
soon to disappear.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@83
2002-04-16 02:51:05 +00:00
Julian Seward
43ca0bb6f4 Get rid of the --client-perms= flag. Valgrind now depends critically
on the client-request subsystem, and disabling it is no longer a
sensible thing to do.

Also: in the manual, mention flags --trace-sched= and --trace-pthread=.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@79
2002-04-16 01:55:18 +00:00
Julian Seward
da6c025074 malloc() and friends have moved to vg_clientfuncs.c, so move the
-fno-omit-frame-pointer flag there too.  Otherwise they are invisible
in backtraces.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@72
2002-04-15 14:27:48 +00:00
Dirk Mueller
5515a58af0 fix initial installation problem
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@71
2002-04-15 00:54:13 +00:00
Dirk Mueller
4b7f632edd some workarounds for newer automake
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@70
2002-04-15 00:31:58 +00:00
Frédéric Gobry
d44c060e37 use install-exec-hook to create the .so.0 symlink.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@69
2002-04-14 15:31:19 +00:00
Julian Seward
c5d0d4a965 Fix problems to do with make dist/make distcheck not finding the source
file vg_libpthread.so.0.c.  Now:

* libpthread.so is built as just-another-so, like valgrind.so and
  valgrinq.so.

* there is a new dummy target libpthread.so.0 which is build just
  by a symlink.

Unfortunately for some reason, when the .so.0 is installed, it gets
a complete copy rather than just the symlink being copied.  But it
works, at least.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@68
2002-04-14 14:32:54 +00:00
Julian Seward
6885b33e91 * external namespace check
* VG_(printf) format strings check


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@65
2002-04-14 13:01:38 +00:00
Frédéric Gobry
9158ab04e5 added rules to generate libpthread.so
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@54
2002-04-12 13:32:11 +00:00