Commit Graph

27 Commits

Author SHA1 Message Date
Julian Seward
eba1b443e5 merge patches from Jeremy Fitzhardinge:
14-hg-tid
  HELGRIND: This fixes a bug in Helgrind in which all memory access by
  syscalls was being treated as if it were happening in thread 1. This
  is because the eraser_mem_read/write functions were using
  get_current_tid_1_if_root() to get the current tid. Unfortunately,
  during syscalls there is no current thread, so it was getting
  1_if_root. This patch fixes this by using what thread ID information
  we're given, and only using get_current_tid() if we're recording a
  memory access performed by code (rather than by a syscall).

... which relies on ...

06-memops
  Implement VG_(memcpy/memset).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1247
2002-10-20 19:40:32 +00:00
Julian Seward
1778e7985a Merge 13-data-syms from Jeremy Fitzhardinge:
Fix to the ELF file reader to make sure that each SegInfo includes not
only the text mapped from an ELF file, but also the data and bss. This
allows the data symbols to be extracted. Also adds a new needs boolean
to allow a skin to specify if it needs data symbols. As a nice
side-effect, it removes the "offset" hack: the offset is the mapped
address in the ELF Phdr: it is (mapped_address - phdr_vaddr).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1246
2002-10-20 19:29:21 +00:00
Julian Seward
dfa3421369 Merge 07-seginfo from Jeremy Fitzhardinge:
API for skins to extract information about mapped segments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1245
2002-10-20 18:35:48 +00:00
Nicholas Nethercote
20f83c6132 Added VG_(rename) (untested), and made VG_(bbs_done) visible to skins, both at
the request of Josef Weidendorfer for his KCachegrind stuff.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1231
2002-10-14 09:25:37 +00:00
Nicholas Nethercote
534ab14977 Moved the following macros, which were defined multiple times in multiple
files, into vg_skin.h:

    uInstr0, uInstr1, uInstr2, uInstr3, nameIReg, nameISize, nameSReg,
    newTemp, newShadow, uLiteral, uCCall

As macros they avoid namespace problems (they expand to VG_(whatever)) so
this should work fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1182
2002-10-04 14:34:15 +00:00
Nicholas Nethercote
c5fbb49521 Added (untested) system call VG_(unlink)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1177
2002-10-04 10:29:38 +00:00
Nicholas Nethercote
3c7b9b2e03 Changed startup message to give information about skin and core separately.
Added "version" and "copyright_author" fields for skins to supply.

Now startup message looks something like this:

==12698== cachegrind, an I1/D1/L2 cache profiler for x86-linux.
==12698== Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.
==12698== Built with valgrind-HEAD, a program execution monitor.
==12698== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==12698== Estimated CPU clock rate is 1422 MHz
==12698== For more details, rerun with: -v

The skin can specify a version number, but the skins that will be distributed
with Valgrind don't.

Also changed "x86 GNU/Linux" to the wicked "x86-linux" at Julian's request.

Updated default regression test filter to handle this new startup message.

----

Also moved the skin's name, description, etc., fields out of VG_(needs) into a
new struct VG_(details), since they are logically quite different to the needs.
Did a little code formatting, etc., for this.  Updated skin docs
correspondingly, too.

Also renamed the need `run_libc_freeres' --> `libc_freeres' so it's a noun
phrase rather than a verb phrase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1172
2002-10-03 14:05:52 +00:00
Nicholas Nethercote
3bbf66f4e1 Fixed stupid mistake. Fortunately the value is only used for initialisation
and is then always overwritten by liveness analysis.  Still...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1168
2002-10-03 08:57:01 +00:00
Nicholas Nethercote
089e7e3bcb Updated file descriptions in the copyright notices to reflect the core/skin
split.  Each skin now has its own two-line description.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1166
2002-10-02 13:26:35 +00:00
Nicholas Nethercote
41a0bcbbbb Changes made so that skin error "report this bug to" messages are distinguished
from core error ones:

  - Split up VG_(panic) into VG_(core_panic) and VG_(skin_panic)

  - Likewise, split vg_assert into vg_assert and sk_assert

  - Added a new need string: `bug_reports_to'

  - Removed VG_(skin_error) which was a previous wussy attempt at this change.
    This removed the need for the hacky redeclaration of VG_(skin_error) in
    vg_profile.c, which is good.

At the moment, Julian and Nick's email addresses are hard-coded into each skin
individually, rather than using a #define in vg_skin.h, because that didn't
feel quite right to me...  jseward@acm.org is still done with a #define for
core errors, though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1164
2002-10-02 11:08:25 +00:00
Nicholas Nethercote
86f876238e Update and add .cvsignore files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1156
2002-10-01 11:50:39 +00:00
Julian Seward
45e965200b Rename VG_(kill) and VG_(sigpending) to VG_(kkill) and VG_(ksigpending)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1145
2002-09-30 23:12:33 +00:00
Julian Seward
a03f1877f6 Second half of the LDT support. It basically works now.
- New core uinstrs, GETSEG, PUTSEG (save and restore segment regs)

- New core uinstr USESEG, which takes a segment selector and a
  virtual address, and returns a linear address -- and also does
  a limit check.  This calls through to VG_(use_ldt) in vg_ldt.c.

- Insn parser (disAMode) made aware of segment override prefixes

- Obvious fixes to insn emitter and translators

None of the skins understand these new uinstrs, so only --skin=none
works with them at the mo.  This and some other rough edges still
need to be fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1139
2002-09-30 12:33:11 +00:00
Nicholas Nethercote
3c9c4b2074 Added profiling events for core/skin cheap/expensive sanity checks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1138
2002-09-30 11:24:00 +00:00
Nicholas Nethercote
4cd67f62e6 Converted all functions visible from vg_skin.h with names in CamelCaps to
use_under_scores instead, to be consistent.

Also added some missing 'extern's on function declarations in vg_skin.h.

Also added a quick note in vg_regtest.in on the simplest way to run regression
tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1135
2002-09-30 10:23:54 +00:00
Nicholas Nethercote
ece3c54af1 Moved the OINK macro into vg_skin.h so that skins can use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1124
2002-09-27 10:42:20 +00:00
Nicholas Nethercote
69f08db9a5 Lots of minor comment changes, etc, just to make it clearer to skin writers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1121
2002-09-27 10:24:48 +00:00
Nicholas Nethercote
8ebeaef638 Change #include so that "make distcheck" works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1109
2002-09-24 11:23:50 +00:00
Nicholas Nethercote
d8dcbbc58a Changed name of core/ to coregrind/, since 'core' files/dirs have a habit
of being removed with extreme prejudice.

Also added a couple of necessary Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1100
2002-09-23 16:24:41 +00:00
Nicholas Nethercote
f1689b96db Changed lots of files for the new core/ + skin/ directory structure:
- changed lots of Makefile.am files
   - changed configure.in
   - changed lots of #include lines for changed file names
   - changed lots of file headers n footers for changed file names
   - changed vg_regtest to handle new directory structure -- recursively
     traverses subdirectories for .vgtest test files
   - changed lots of paths in memcheck/ regression test expected outputs


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1090
2002-09-23 11:21:57 +00:00
Nicholas Nethercote
afebe61b37 Files updated, added and removed in order to turn the ERASER branch into HEAD
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1086
2002-09-23 09:36:25 +00:00
Julian Seward
4cd4d6138c Fix typo in VALGRIND_MAKE_WRITABLE.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@393
2002-06-06 08:38:45 +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
Julian Seward
37f7143de6 Minor profiling improvements. Add a couple of cost centers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@223
2002-05-07 09:25:30 +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
7a36f60133 Mega-merge of my last 2 weeks hacking. This basically does the groundwork
for pthread_* support.  Major changes:

* Valgrind now contains a (skeletal!) user-space pthreads
  implementation.  The exciting bits are in new file vg_scheduler.c.
  This contains thread management and scheduling, including nasty crud
  to do with making some syscalls (read,write,nanosleep) nonblocking.
  Also implementation of pthread_ functions: create join
  mutex_{create,destroy,lock,unlock} and cancel.

* As a side effect of the above, major improvements to signal handling
  and to the client-request machinery.  This is now used to intercept
  malloc/free etc too; the hacky way this is done before is gone.
  Another side effect is that vg_dispatch.S is greatly simplified.
  Also, the horrible hacks to do with delivering signals to threads
  blocked in syscalls are gone, since the new mechanisms cover this case
  easily.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@52
2002-04-12 11:12:52 +00:00
Julian Seward
72a784f3b1 Initial revision
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2
2002-03-22 01:27:54 +00:00