Commit Graph

25 Commits

Author SHA1 Message Date
Julian Seward
5162912b13 Implement CLC and STC (Pascal Massimino <pmassimi@ilog.fr>).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@353
2002-06-02 00:04:00 +00:00
Julian Seward
688efba21c Implement ADC Eb,Gb. Truly an unpopular instruction if it took anyone this
long to fall across it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@340
2002-05-29 23:38:23 +00:00
Julian Seward
66a158a1f8 Implement x86 insn popl m32. (Nikolay Igotti )
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@305
2002-05-22 11:55:35 +00:00
Julian Seward
44f0d41089 Yesterday's push/pop merging optimisations break the cache profiler:
vg_cachesim.c:536 (vgPlain_cachesim_instrument):
    Assertion `instr_size >= 1 && instr_size <= 16' failed.
so disable them when cache profiling.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@238
2002-05-08 21:26:01 +00:00
Julian Seward
9bcb60e01a Complain about NVidia's libGL.so also when an 0x8C opcode is encountered.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@235
2002-05-08 01:58:18 +00:00
Julian Seward
257b64c505 Implement SBB Ib, AL.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@234
2002-05-08 01:44:03 +00:00
Julian Seward
4ce9c33335 Do LODSW / LODSL. (Sami Farin)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@233
2002-05-08 01:38:43 +00:00
Julian Seward
68a929a7ca Only show the giant-basic-block message at verbosity >= 2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@230
2002-05-08 00:42:25 +00:00
Julian Seward
6a3788061f Generate better ucode for back-to-back sequences of register pushes and
pops, as appear at function prologues/epilogues.  Specifically, update %ESP
just once for the whole sequence.  This reduces by about 20% the number
of calls to handle_esp_assignment (for kate in KDE 3.0, -O), which is a
good thing since that is quite expensive.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@227
2002-05-07 23:38:30 +00:00
Julian Seward
95a32b6cd6 Improve accuracy of simulation of bsf/bsr instructions when the word
being scanned is zero.  (Zoltan Hidvegi)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@205
2002-05-03 20:52:53 +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
edf9ed279b Fix many holes and bugs in an attempt to get my libpthread.so to export
the same set of symbols as the real one, which I now realise is crucial
for it to work at all.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@151
2002-04-26 03:28:18 +00:00
Julian Seward
2d2604e78d Add JCond-32 NP (long jump when parity odd) and CMOV NP too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@109
2002-04-21 11:43:11 +00:00
Julian Seward
b16935d300 Oops! The floating-point conditional-move instructions read %EIP, so
we'd better annotate them as such!

Fixes a floating-point misbehaviour bug reported by Robert W. Anderson
<anderson110@poptop.llnl.gov>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@95
2002-04-18 02:18:24 +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
05207b3508 Relent, and properly implement bt/bts/btc/btr for literal bit-offsets.
bt_literal.c is a somewhat halfhearted test case for it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@76
2002-04-16 00:42:12 +00:00
Julian Seward
0f38b1975c Get rid of the old bt/bts/btr/btc implementation.
Turns out these insns are also available as Grp8 extensions, with
literal bit-offset values.  Nuisance.  I've #if 0'd out the old code
which implements them since am too lazy to fix them properly, and I
can't find any cases of their use anyway.  I'll wait until someone
yelps.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@75
2002-04-15 18:36:39 +00:00
Julian Seward
cdde41f423 Correctly implement x86 bt/btc/bts/btr insn. Previous impl was wrong:
* Didn't handle correctly operands in memory, where arbitrary signed
  bit offsets are allowed.  Prior impl will trash the client's stack
  and give the wrong answer.

* Was done by a helper function and therefore could give spurious
  value errors.

Now the address computations are done in-line.

Old implementation is there, but unused and scheduled for demolition.

Test case to follow.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@73
2002-04-15 14:35:28 +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
5b1ca0492b Detect FPU instructions which set %EFLAGS and mark the resulting
UInstrs accordingly.  Fixes a bug in the simulated CPU in which the
results of f{u}comi{p} FPU insns were ignored, potentially leading to
wrong program behaviour.  This will only have happened to people using
P6/P7/K7 class CPUs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@30
2002-03-24 13:52:19 +00:00
Julian Seward
13c77e7c76 Implement DAA as well as DAS. Byrial Jensen <byrial@image.dk>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@22
2002-03-24 11:54:07 +00:00
Julian Seward
ff2c1db04a (merge from 20020320)
Modify codegen_SAHF so the instrumenter doesn't generate spurious
value errors if parts of %eax other than %ah are undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13
2002-03-24 10:03:17 +00:00
Julian Seward
01772f27ae (merge from 20020320)
Implement x86 das instruction.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12
2002-03-24 10:00:09 +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