38 Commits

Author SHA1 Message Date
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Julian Seward
68c9403938 Initial code for remote debuginfo server. Handles all ELF/Dwarf{2,3,4}
on Linux.  No Dwarf1, no Stabs, and MacOSX probably won't build.


git-svn-id: svn://svn.valgrind.org/valgrind/branches/DISRV@13423
2013-06-07 16:15:48 +00:00
Philippe Waroquiers
ac56e88053 fix 320211 Stack buffer overflow in ./coregrind/m_main.c with huge TMPDIR
* Addition of a function to compute size of buffer needed for VG_(mkstemp)
* Use it to dimension buffers for all VG_(mkstemp) calls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13409
2013-05-26 21:09:20 +00:00
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Florian Krohm
5337376bf2 More Char/HChar fixes and constification.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088
2012-10-27 18:39:11 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Josef Weidendorfer
d08c246e3f Fix callgrind part of bug 280757.
For this, we make VG_(tmpdir) available to tools.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12163
2011-10-17 18:12:48 +00:00
Florian Krohm
47c681afb8 Remove hardwired /tmp directory in vgdb. Honour VG_TMPDIR
and TMPDIR which was introduced when fixing bugzilla #267020.
Factor out VG_(tmpdir). New function VG_(vgdb_path_prefix).
Partially fixes bugzilla #280757. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12063
2011-09-29 03:03:45 +00:00
Julian Seward
ad7de5b336 Delete the AIX5 port. The last release this worked for is 3.4.1,
and then only on AIX 5.2 and 5.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11842
2011-06-28 07:25:29 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Bart Van Assche
82e0033fdd Switched back from dynamic detection of whether the proc filesystem
is mounted to compile-time logic in order to minimize the differences
in behavior with Valgrind version 3.5.0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10868
2009-08-25 20:15:41 +00:00
Bart Van Assche
772166c146 Renamed the function VG_(have_proc_filesystem)() into
VG_(is_procfs_mounted)(). The old name was derived from the name
of the preprocessor macro HAVE_PROC while the new name is a more
accurate description of what this function does.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10867
2009-08-25 17:34:58 +00:00
Bart Van Assche
6b9dcdcd97 The configure-time test whether the proc filesystem is mounted (introduced
in r10156) broke cross-compilation. This patch converts the configure-time
test into a runtime test. Should fix bug #204843.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10860
2009-08-23 09:53:27 +00:00
Nicholas Nethercote
83abfcbfa0 DARWIN sync: change the 3rd arg of VG_(fcntl).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10101
2009-05-22 07:08:12 +00:00
Nicholas Nethercote
22dfc72abd DARWIN sync: export VG_(socket).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10098
2009-05-22 02:00:27 +00:00
Nicholas Nethercote
0f41b8b20b DARWIN sync: spacing and layout.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10083
2009-05-21 23:52:52 +00:00
Nicholas Nethercote
99b76e50c7 DARWIN sync: add some 'const' attributes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10022
2009-05-20 04:22:42 +00:00
Nicholas Nethercote
131ab00744 Merged non-Darwin-specific parts of r9397,r9423,r9490, 9461, 9462 from the
DARWIN branch.  A big ugly DARWIN/trunk sync commit, mostly to do with
changing the representation of SysRes and vki_sigset_t.  Functionality of
the trunk shouldn't be changed by it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9876
2009-05-18 02:12:08 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
5ad1dd61f9 Introduce a new type, PtrdiffT. Replace lots of uses of OffT (all those
that are memory offsets) with PtrdiffT;  OffT should only be used for file
sizes and offsets.

Change Off64T from a ULong to a Long, as it should be.  Replace some uses
of ULong in the address space manager with Off64T to match.

Also add a comment explaining the meanings of the basic types like Addr,
OffT, SizeT, etc.

Also fix the prototype for VG_(pread) -- the last arg is an OffT, not an
Int.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8959
2009-01-15 21:29:24 +00:00
Julian Seward
e5150447d7 Presently, Valgrind (non-client) code that wants to use the stat
family of syscalls is impossible to write in a way that's portable and
correct.  On some targets (eg x86-linux) you need to do sys_stat64 and
receive the results in a 'struct vki_stat64'.  But on other targets
(eg amd64-linux) neither sys_stat64 nor 'struct vki_stat64' exist.

This commit adds a new type, 'struct vg_stat', which contains 64 bit
fields in all the right places, and makes VG_(stat) and VG_(fstat) use
it.  This means callers to the two functions no longer need to worry
about the is-it-64-bit-clean-or-not question, since these routines
reformat the received data into a'struct vg_stat'.  Kind of like what
glibc must have been doing for decades.

This (indirectly) fixes a bug on x86-linux, in which m_debuginfo would
sometimes fail to read debug info, due to VG_(di_notify_mmap) using
VG_(stat) (hence sys_stat) on the file, which failed, and when in fact
it should have used sys_stat64.  Bug reported and tracked down by
Marc-Oliver Straub.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8522
2008-08-19 07:03:04 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Julian Seward
db29debc13 Make handling of setuid executables marginally more sensible, as
suggested in #119404.

Prior to this commit, if the current traced process attempted to
execve a setuid executable, an error was always returned.  The revised
behaviour is:

If the current (traced) process attempts to execve a setuid
executable:

* If --trace-children=yes is not in effect, the execve is allowed.

* If --trace-children=yes is in effect, the execve is disallowed
  (as at present), but an error message is printed (unless in XML mode),
  so at least the execve does not fail silently any more.

As per discussion on #119404 we could probably do a lot better, but
these changes are at least simple, useful and uncontroversial.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7175
2007-11-17 21:11:57 +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
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
49a9f8d4f9 Merge r6130:
- AIX implementations of various stuff, nothing surprising.

- For all platforms: make VG_(read) and VG_(write) return (negative)
  actual error values rather than producing -1 for all failures.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6267
2006-10-17 01:38:13 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Tom Hughes
2605f9b94e Provide a full set of ntohl/htonl/ntohs/htons routines in the
valgrind C library.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5162
2005-11-17 12:01:56 +00:00
Nicholas Nethercote
82c3ab0af9 Overhaul the way programs are loaded at startup and exec() works. Now the
checking of programs done in these two places are combined, which avoids
duplicate code and greatly reduces the number of cases in which exec()
fails causing Valgrind to bomb out.

Also, we can now load some programs we could not previously, such as scripts
lacking a "#!" line at the start.  Also, the startup failure messages for
bad programs match the shell's messages very closely.

And I added a whole bunch of regtests to test all this.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4918
2005-10-14 03:11:30 +00:00
Julian Seward
8bf81005ae Small cleanups, mostly of m_main:
- Move VG_(fd_{soft,hard}_limit) into m_clientstate
- m_main: clean up auxv handling.  Get rid of scan_auxv().
- m_main: move scan_colsep() to somewhere more sensible.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4799
2005-09-28 00:53:09 +00:00
Julian Seward
cc8ccbbfb4 This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive).  That branch is now dead.
Please do not commit anything else to it.

For the most part the merge was not troublesome.  The main areas of
uncertainty are:

- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
  and include it in a couple of places.  Building etc seems to still
  work, but I haven't tried building the documentation.

- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
  stuff was moved from -generic to -linux after the branch was created.
  I think that is satisfactorily glued back together now.

- Regtests: although this appears to work, no .out files appear, which
  is strange, and makes it hard to diagnose regtest failures.  In
  particular memcheck/tests/x86/scalar.stderr.exp remains in a 
  conflicted state.

- amd64 is broken (slightly), and ppc32 will be unbuildable.  I'll
  attend to the former shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789
2005-09-27 19:20:21 +00:00
Nicholas Nethercote
d35537f51f Removed some repetition in the way VG_(record_fd_open)() is called.
As part of this, VG_(resolve_filename)() no longer calls VG_(malloc)()
and so m_libcfile no longer depends on m_mallocfree.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4001
2005-06-23 02:26:47 +00:00
Nicholas Nethercote
ccbd29544d Moved VG_(resolve_filename{,_nodup}) from m_syswrap into m_libcfile,
so that m_aspacemgr doesn't depend on m_syswrap any more.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3960
2005-06-19 21:10:42 +00:00
Nicholas Nethercote
2c4e465cf7 Move VG_CLO_DEFAULT_LOGPORT to a better spot.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3932
2005-06-18 04:13:54 +00:00
Nicholas Nethercote
c50197ce86 Move VG_(fcntl) into m_libcfile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3895
2005-06-12 02:49:35 +00:00
Nicholas Nethercote
2990d3e626 Moved VG_(fd_{hard,soft}_limit) into a better spot.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3871
2005-06-10 22:39:04 +00:00
Nicholas Nethercote
face101a47 Modularised file and socket libc stuff in m_libcfile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3844
2005-06-04 20:03:55 +00:00