Enable chasing of unconditional jumps/calls for s390x.
Tune function chase_into_ok to not chase into EX/EXRL
insn.
Observed speedups on performance tests were:
none -6% ... -12%
memcheck -3% ... -8%
Make the location for temporary files configurable at runtime.
To that effect observe the environment variable TMPDIR. If defined,
its value takes precedence over VG_TMPDIR.
Because the directory name is no longer a compile time constant,
VG_(err_config_error) was changed to take a variable argument list.
Fixes #267020.
Fix up preload code so that on Android it doesn't try to call anything
else -- that seems to give a runtime link failure. In particular,
avoid calling _exit, getpagesize or __libc_freeres.
Build system fixes so as to temporarily disable the GDBserver on
Android. Making that work will require a bit of extra effort due to
minor glibc-vs-bionic differences.
Allow selection of an alternative location for temporary files at
configure time, via the --with-tmpdir flag. The configure.in part of
this was mistakenly committed already in r11872 as first hunk of the
configure.in change. Bug 266035 comment 11. (Kenny Root,
kroot@google.com)
The pthread.h on Android has no definition for pthread_rwlock_t, which
makes the associated intercepts in Helgrind and DRD un-compilable.
Add a configure test for it, and use them to guard the aforementioned
intercepts.
Pass platform-variant tags (-DVGPV_blah_blah_blah) to regtest
compiles. Also, fix some $(NAME) stuff which looks like it should
have been @NAME@ all along.
Introduce the concept of platform variants. These allow further
qualification of the normal (arch, os) pairings used to factorise the
code base via the VGP_ defines. With this change, a new define
VGPV_<arch>_<os>_<variant> is also passed to each compile. The
initial motivation is to allow clean factorisation of Android-specific
code, which is a minor variant of arm-linux, without having to
introduce a complete new platform. In all other cases the supplied
tag is simply "vanilla".
Also add configure.in stuff to recognise Android at configure time.
Handle sigaction, sigsuspend, sigprocmask on arm-linux; comment-only
changes for x86-linux and ppc32-linux. Derived from patch in bug
266035 comment 10 (Jeff Brown, jeffbrown@google.com).
Remove identical copies of convert_sigset_to_rt, PRE(sys_sigaction)
and POST(sys_sigaction) in syswrap-x86-linux.c and
syswrap-ppc32-linux.c, and replace them with a single version in
syswrap-linux.c instead. Derived from patch in bug 266035 comment 10
(Jeff Brown, jeffbrown@google.com).
Same functionality, apart from "-l" to show "long information".
This only printed the current working directory of the callgrind run,
which currently is not available any longer, but not really needed.
The port to vgdb has an important benefit:
callgrind can now be controlled by callgrind_control also when
the client program is blocked/sleeping in a system call. This was
not possible before as a command file was polled only while the
client was running.
Ubuntu by default restricts PTRACE (used by vgdb) to parent processes,
making Ubuntu show similar behavior as before: vgdb is not allowed
to attach by PTRACE when the client is blocked/sleeping, so
callgrind_control works similar to before this change on Ubuntu.
A final patch, which gets rid of command file polling, will be
submitted after Valgrind 3.7, as KCachegrind currently writes
command files directly, and needs to be changed to rely on
callgrind_control instead.
Allow optional specification of cpu models on the command line
and test whether the host machine matches one of those. This is
needed to fix Bug #271776.
Pipe CFLAGS through to the compile run for genoffsets.c, which is a
bit special. CFLAGS is already piped through to everywhere else.
This is needed for working with semi-broken cross-compile setups that
need CFLAGS set to special values in order to work.
Tom Hughes [Wed, 6 Jul 2011 14:08:24 +0000 (14:08 +0000)]
Don't allocate the XArray for the text version of the suppression
until after we've checked if the tool will allow the error to be
suppressed, or we will leak it if we do the early return.
* make_local_links
- disable gdb tests if gdb version < 7
- disable pic tests if gdb version < 7.1
* nlfork_chain test
- reduce chain from 20 to 15 to avoid ENOMEM
on small ARM systems
* main_pic.c
- put break at line 11 rather than main entry, as ARM gdb
does not properly show main args till it has started executing.
* passsigalrm.c
- do not setsa.sa_restorer (obsolete on linux, unknown on darwin)
* mcvabits.vgtest
- make prereq consistent with other tests
* filter_gdb
- upgraded filter to new linenr in clean_after_fork.c
Julian Seward [Tue, 28 Jun 2011 08:20:39 +0000 (08:20 +0000)]
valgrind and tool mon. cmds prefixes changes + doc fixes + new vgdb option
--cmd-time-out
* changed prefixes of Valgrind core monitor commands from vg. to v.
* removed prefixes of Tool monitor commands
* memcheck leak_check 'leakpossible' arg renamed to 'possibleleak'
* memcheck make_memory 'ifaddressabledefined' arg renamed to
'Definedifaddressable'
(with uppercase D to avoid confusion with 'defined' arg).
* vgdb options
- Some doc updates : more logical option order documentation,
specify 'standalone' for options aimed at standalone usage.
- added option --cmd-time-out for standalone vgdb
(comment of Josef Weindendorfer, needed to interface with a callgrind GUI)
* updated tests according to the above.
* updated documentation according to the above.
* some additional minor doc fixes/clarifications
Julian Seward [Sun, 26 Jun 2011 09:26:48 +0000 (09:26 +0000)]
Add support for PIC executables (e.g. firefox on Ubuntu 11) by adding
the "auxv" protocol packet to gdbsrv. (Philippe Waroquiers,
philippe.waroquiers@skynet.be). Bug 214909 comment 108.
Julian Seward [Sun, 26 Jun 2011 09:13:27 +0000 (09:13 +0000)]
GDB server:
* fix error in usability msg
* make a test more deterministic
(Philippe Waroquiers, philippe.waroquiers@skynet.be). Bug 214909
comment 107.
Julian Seward [Fri, 24 Jun 2011 10:09:41 +0000 (10:09 +0000)]
Merge the contents of the HGDEV2 branch into trunk:
* performance and scalability improvements
* show locks held by both threads in a race
* show all 4 locks involved in a lock order violation
* better delimited error messages
Julian Seward [Sat, 18 Jun 2011 08:28:04 +0000 (08:28 +0000)]
Minor GDBserver source tidying. Also a small usability fix: if
--vgdb-error=N is specified, print a bit of text telling the user the
magic commands to give GDB in order to attach to the process.
Julian Seward [Wed, 15 Jun 2011 21:30:55 +0000 (21:30 +0000)]
Fix safe_fd exhaustion in fork chain caused by non closing of shared_mem_fd
Patch that fixes the problem reported by Christian Borntraeger.
The problem was created by keeping the shared memory mapped file opened
without reason till the process does an exec.
In case of a chain of forked processes (without exec), the range of safe_fd
reserved for Valgrind own usage becomes exhausted.
* coregrind/m_gdbserver/remote-utils.c :
do not VG_(safe_fd) shared_mem_fd (as it is now closed directly)
close shared_mem_fd once file is mmap-ed and written.
* gdbserver_tests/nlfork_chain.stderr.exp,nlfork_chain.vgtest,
fork_chain.c,nlfork_chain.stdout.exp:
new files
* gdbserver_tests/Makefile.am:
modified for new nlfork_chain test
(patch from #214909 c 103,
Philippe Waroquiers, philippe.waroquiers@skynet.be)
For a Sandybridge desktop, previously this resulted in
...
--14842-- warning: Unknown Intel cache config value (0x76), ignoring
...
with Cachegrind/Callgrind
Tom Hughes [Wed, 8 Jun 2011 09:10:40 +0000 (09:10 +0000)]
It seems that the perf_counter_open system call was renamed to
perf_event_open some time after we added it, so correct the name
wherever it appears to match the current kernel source.
Also fixup the PRE handler to do the check correctly, using the
size field of the structure to work out how much data there is.
Julian Seward [Tue, 7 Jun 2011 22:54:32 +0000 (22:54 +0000)]
Add a simple but (to me, at least) useful thing, if (0)'d by default,
to print a line of text approximately every 20 million SBs. This is
useful for monitoring the progress of long running programs.
Julian Seward [Tue, 7 Jun 2011 22:44:09 +0000 (22:44 +0000)]
Fix the computation of debuginfo bias values, in the case where the
debuginfo object has been not been prelinked but the main object has.
Fixes a segfault observed running any C++ application (eg,
drd/tests/annotate_smart_pointer) on Fedora 14 (32-bit), when the
debuginfo RPM for libstdc++ is installed.