Commit Graph

2954 Commits

Author SHA1 Message Date
Julian Seward
3d25b440fe All platforms: make it clearer that missing syscalls constitute
reportable bugs.

AIX only: print name of missing syscall as well as number -- important
because there is no fixed name/number binding.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6765
2007-07-10 00:18:46 +00:00
Julian Seward
32a6fb4fec Get rid of VG_(getcwd) and replace it with a pair of functions,
VG_(record_startup_wd) which records the working directory at startup,
and VG_(get_startup_wd) which later tells you what value was recorded.
This works because all uses of VG_(getcwd) serve only to record the
directory at process start anyway.  The motivation is that AIX does
not support sys_getcwd directly, so it's easier for the launcher to
ship in the required value using an environment variable.  On Linux
sys_getcwd is used as before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6764
2007-07-09 23:13:07 +00:00
Julian Seward
696fb88c46 Fix stack overflow which lead to totally mysterious .bss corruption
and hence to segfaulting in vex on ppc32/64-linux in obscure
circumstances.  VKI_MAX_PAGE_SIZE is 64k in recent Valgrinds.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6728
2007-05-05 11:40:35 +00:00
Julian Seward
504e19fb9d Fix regression in new/new[]/delete/delete[] intercepts for gcc-2.96.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6726
2007-05-02 16:24:30 +00:00
Julian Seward
d18e63eb42 Avoid compilation warnings with gcc-4.2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6722
2007-05-01 14:18:48 +00:00
Julian Seward
984e45e88f Add disclaimers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6709
2007-04-29 09:06:40 +00:00
Nicholas Nethercote
bb2eae844c augment previous commit
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6708
2007-04-20 02:15:28 +00:00
Nicholas Nethercote
2005fbaa40 It's generally a good idea to set call-by-reference arguments, especially
when the function comments says that they always are set.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6707
2007-04-19 23:35:42 +00:00
Nicholas Nethercote
802b418634 Fix some copyright notices:
- extend some to 2007
- use njn@valgrind.org instead of njn25@cam.ac.uk
- use "tool" instead of "skin"


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6703
2007-04-15 22:15:57 +00:00
Julian Seward
7a897aa86d When doing 'demo' translations for --profile-flags=, make at least
some attempt to discard existing translations first.  Otherwise
Cachegrind (rightly) asserts on the basis that it is seeing duplicate
translation requests for the same entry point.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6698
2007-04-09 22:24:57 +00:00
Julian Seward
5c59b39513 Fix out of date comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6696
2007-04-07 14:46:13 +00:00
Nicholas Nethercote
742ae56613 Remove duplicate code -- make XArray use VG_(ssort).
Had to change XArray's comparison function to return an Int rather than a
Word so it's consistent with the rest of the world.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6680
2007-03-28 01:27:05 +00:00
Nicholas Nethercote
ab3351f6a9 Fix bug 142197: don't free --toolname:foo options after they've been munged,
because tools should be able to assume that they are never freed, just like
other options.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6668
2007-03-26 23:38:42 +00:00
Nicholas Nethercote
39c78c7e8b Fix 142488: don't read ./.valgrindrc if CWD==HOME.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6665
2007-03-26 22:05:30 +00:00
Nicholas Nethercote
38fd939a14 Clarify the "out of memory" message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6656
2007-03-22 03:36:55 +00:00
Julian Seward
63d002a2cd Unbreak the build on ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6654
2007-03-21 02:27:38 +00:00
Julian Seward
14b9b8b8d2 Make ptrace-based launchers able to handle --help, --version etc.
Problem is that --help etc are handled by the tool exe.  But a
ptrace-based launch scheme can't run "no program" if the user just
types "valgrind --help" because the launcher depends on starting the
client first and only then attaching valgrind to it using ptrace.  So
instead provide a dummy do-nothing program to run when no program is
specified.  m_main notices this and acts as if there really had been
no program specified.

This has no effect at all on Linux/ELF program launching.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6653
2007-03-19 18:38:55 +00:00
Julian Seward
a64b0bfb0c Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6652
2007-03-19 15:29:23 +00:00
Julian Seward
1d31d0b60c Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6651
2007-03-19 14:34:08 +00:00
Julian Seward
664364751b Document and tidy up one of the more arcane corners of signal
handling: why PRE(sys_sigreturn) has to construct a fake syscall
return value which, when written back to the guest state, leaves it
unchanged.  It's only taken me about 3 years to realise why :-)
Fixes to ppc platforms to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6650
2007-03-19 13:38:11 +00:00
Julian Seward
77c7c9adc2 Handle sys_ioprio_set on amd64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6641
2007-03-11 19:28:02 +00:00
Julian Seward
54ccc6726a Generate valid XML (conforming to docs/internals/xml-output.txt) even
when VG_(name_of_launcher) is NULL.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6635
2007-03-08 19:56:14 +00:00
Tom Hughes
0075b20e84 Add support for linux key management system calls.
Based on patch from Ezra Peisach <epeisach@bu.edu>.
Fixes bug #139300.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6632
2007-03-07 11:12:13 +00:00
Tom Hughes
4c402c0681 Add support for some I2C ioctls.
Based on patch from Jean Delvare <khali@linux-fr.org>.
Fixes bug #142186.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6631
2007-03-07 10:07:13 +00:00
Tom Hughes
cbb98bc70d Handle some additional ptrace reason codes. Based on a patch
from Magnus Vesterlund <magnus_vesterlund@hotmail.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6630
2007-03-07 09:48:32 +00:00
Julian Seward
1907f8c209 Handle DW_CFA_def_cfa_expression; also DW_OP_mul.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6627
2007-02-28 13:03:27 +00:00
Julian Seward
142e2aedb7 Fill in a few more DWARF3 'expression' related cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6626
2007-02-28 01:46:30 +00:00
Julian Seward
7efbc7213b Track recent XArray changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6625
2007-02-27 22:36:14 +00:00
Julian Seward
046ec22beb Barf more elegantly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6623
2007-02-27 18:38:33 +00:00
Julian Seward
270b21426d Add .eh_frame gunk for VG_(amd64_linux_REDIR_FOR_vgettimeofday) and
VG_(amd64_linux_REDIR_FOR_vgettimeofday) so they can participate in
stack unwinding.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6622
2007-02-27 18:37:21 +00:00
Julian Seward
0cbff69f1c Make the leb readers 64-bit clean. That should guard against another
couple of decades of Moore's law.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6621
2007-02-27 17:43:43 +00:00
Julian Seward
9377cf0ea5 Add limited support for DWARF3 'expressions' in stack-unwind (CFI)
info (DW_CFA_def_cfa_expression, DW_CFA_expression,
DW_CFA_val_expression).  Mechanism to support all of these is in place
although only DW_CFA_val_expression is currently connected up.

This is really nasty.  The basic idea is to partially evaluate each
expression at the debuginfo-reading time by running it on a stack
machine in which each stack element is an expression tree.  If the
expression can be 'run' successfully, the tree (dag, really) remaining
at the top of the stack is massaged and put into the DiCfSI record for
that address range.  At unwind time the tree is evaluated if needed.
Such cases are in fact extremely rare and so the vast majority of
unwindings use the same mechanism as before.

As a result of all this:

* some obscure cases in glibc-2.5's libpthread.so unwind when they
  didn't before

* --debug-dump=frames produces identical output to that of readelf
  for libc-2.5.so and associated libpthread.so

* All the action centers around the new type CfiExpr, which is a
  union expression-tree type in the same style as IRExpr et al

* Many dark corners of the CFI reader have been looked at and
  (re-)validated



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6620
2007-02-27 16:52:23 +00:00
Julian Seward
0a28307fca VG_(addToXA): return index in the array where the item was added.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6619
2007-02-27 16:40:53 +00:00
Julian Seward
9a4164c5f3 Comment-only change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6617
2007-02-25 17:13:19 +00:00
Julian Seward
b7302d9258 Get rid of the type XArrayStrings in m_clientstate and use new generic
equivalents in module m_xarray instead.  A suprisingly pervasive
change.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6616
2007-02-25 15:08:24 +00:00
Julian Seward
e34b7496c6 Make all the m_xarray functions tool-visible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6615
2007-02-25 15:04:40 +00:00
Julian Seward
804c7868a1 Expandable arrays of arbitrary element type T are a simple, useful
abstraction implemented independently in several places in the code
base (bad!).  This commit moves into public view a generic
implementation of it which has been lurking in readxcoff.c for some
time.  Currently nothing uses it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6614
2007-02-25 11:51:13 +00:00
Julian Seward
b095682a89 CFI reader: make reading of 'encoded addresses' be much more in
line with the DWARF3 spec and also with binutils/readelf.c:

- Update some comments

- Get rid of kludge_then_addDiCfSI; apparently no longer needed

- Pass the SegInfo's text_bias around in the AddressDecodingInfo,
  so that ...

- read_encoded_Addr can set 'base' to the text_bias when handling
  DW_EH_PE_absptr.  This is the central change of this commit and
  appears (to me) to be what DWARF3 requires.  (The spec is less
  than clear ..)

- don't use read_encoded_Addr to read the FDE arange field since
  read_encoded_Addr's adding-on of a 'base' value is meaningless
  here - the arange is not an address, but a value saying how many
  bytes the FDE covers.  Instead just read a little-endian value of
  the right size.  This is in accordance with DWARF3 and with 
  readelf.c.  Add new function read_le_encoded_literal to make 
  this possible.

I believe this is all correct, and it's certainly much better than it
was.  But given that the DWARF3 spec isn't as formal as it should be,
it's hard to be sure.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6611
2007-02-24 23:29:31 +00:00
Julian Seward
80835689c0 Make the frame unwinder able to handle 64-bit DWARF (untested :-(
mostly by a lot of comparison of this code vs that of
binutils-2.17/binutils/dwarf.c vs the relevant specs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6610
2007-02-23 10:10:02 +00:00
Julian Seward
06d8004b23 Make ppc32/64-aix5 work again following recent VG_(tt_fast) rearrangement.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6606
2007-02-20 19:23:19 +00:00
Julian Seward
f8d99e1ee3 Improve --debug-dump=frames output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6600
2007-02-16 20:11:27 +00:00
Julian Seward
c555fa5434 Correctly handle DW_CFA_def_cfa_sf (existing code fails to scale
offset by data_a_f).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6599
2007-02-16 19:20:28 +00:00
Julian Seward
6b895f8c7d Non-functional (debug printing only) change:
Implement GNU binutils 'readelf' style output for --debug-dump=lines
(fully) and --debug-dump=frames (partially).

Initial testing with --debug-dump=lines shows our DWARF2 line number
reader behaves identically to readelf for all examples I tried so far.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6597
2007-02-16 14:17:10 +00:00
Julian Seward
be97b31c6c Make VG_(printf) et al conform to ANSI w.r.t. capitalisation of
hex numbers: %x produces lowercase hex, and %X produces uppercase.
Unfortunately this probably changes the output in dozens of places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6596
2007-02-16 14:10:24 +00:00
Julian Seward
15f33c3c91 --wait-for-gdb=yes: gcc 4.1.2 now appears to delete do-nothing loops, so
make the loop variable volatile so it can't do that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6595
2007-02-16 13:57:07 +00:00
Julian Seward
0dfa208588 Essentially non-functional tidyings and improvements to debuginfo
reading.  Two sets of changes:

* New flags for debugging the readers.  
  --debug-dump=syms
  --debug-dump=line
  --debug-dump=frames

  These (currently accepted but nonfunctional) are intended to
  create output in the style of (that is, identical to)
    /usr/bin/readelf --syms
    /usr/bin/readelf --debug-dump=line
    /usr/bin/readelf --debug-dump=frames
  respectively.  The plan is that flaws in these readers can then
  be easily found by diff-ing the output against that from readelf.

  Also, a new flag --trace-symtab-patt=<object filename pattern>
  which is used to limit all debuginfo-related debug info to the
  set of shared object names matching the given pattern.  This
  facilitates extracting the debuginfo details of one specific
  shared object, which is usually what is required, rather than
  having to wade through megabytes of junk from every object in
  the process.

* Propagate the avma/svma/image address-naming scheme
  (as described at the top of debuginfo.c) through large parts of
  readelf.c and readdwarf.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6588
2007-02-12 17:47:14 +00:00
Julian Seward
04fc4caed2 Get rid of the unused --model-pthreads flag.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6584
2007-02-12 08:39:54 +00:00
Julian Seward
517d5c52e8 Fix ppc64-linux dispatcher following r6582.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6583
2007-02-11 09:09:20 +00:00
Julian Seward
79f854bc29 Redo the dispatcher's fast-cache mechanism (VG_(tt_fast) et al) to be
more cache friendly.  This changes the mechanism from being a table of
pointers to (guest address, translated code pairs) to being a table of
pairs (guest address, pointer to translated code).  The effect ranges
from zero up to about 20% performance improvement on memcheck, the
biggest effects being seen for programs which jump around a large
number of blocks of code and whose data set does not fit in L2.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6582
2007-02-11 05:08:06 +00:00
Julian Seward
73a17ab6f3 Oops; make declarations match definitions. So much for C's type system.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6580
2007-02-09 17:45:09 +00:00