* 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.
Julian Seward [Tue, 7 Jun 2011 21:42:07 +0000 (21:42 +0000)]
find_nsegment_idx: double size of the lookup cache in an attempt
to mitigate the probable increase in miss rates resulting from
r11798 (which causes increased numbers of such queries).
Julian Seward [Tue, 7 Jun 2011 21:39:28 +0000 (21:39 +0000)]
Add a fourth --smc-check= variant, --smc-check=all-non-file. This
adds self-modifying-code checks to all guest code taken from mappings
which are not file backed, but omits checks in code from file backed
mappings. This has the effect of giving complete smc-coverage of JIT
generated code -- since that is invariably generated into anonymous
mapped areas -- without burdening non-JIT generated code with such
checks. Running Firefox 6, --smc-check=all-non-file reduces by a
factor of between 3 and 10 the number of translations requiring a self
check, compared to --smc-check=all. These changes depend on the vex
interface changes in r2158.
Bart Van Assche [Sun, 5 Jun 2011 08:51:47 +0000 (08:51 +0000)]
Make Valgrind build on Linux kernel 3.0 and beyond. Closes #274926. An official
statement that the Linux kernel 3.0 API and ABI is compatible with Linux kernel
2.6 can be found here: http://lkml.org/lkml/2011/5/29/204.
Julian Seward [Fri, 3 Jun 2011 23:27:39 +0000 (23:27 +0000)]
Followup fix to r11794 (generalise processing of PT_LOAD entries):
change some incorrect "rx->bias" (which due to lameness of C's type
system was valid) to "inrx->bias".
Julian Seward [Tue, 31 May 2011 07:17:54 +0000 (07:17 +0000)]
On arm-linux, give gcc "-mcpu=cortex-a8" so as to persuade it to
accept the armv6t2 (I think) insns (movt, movw) in
dispatch-arm-linux.S. Some older gccs apparently think they are
compiling for armv6 by default and reject them (gcc 4.4.1 on Ubuntu
9.10, for one.)
Julian Seward [Tue, 31 May 2011 07:09:06 +0000 (07:09 +0000)]
More gdbserver test fixes, from #214909 c 101:
fix mcsig(no)pass on arm Ubuntu10, arm thumb internal doc, improve
simulate_control_c
* new file docs/internals/arm_thumb_notes_gdbserver.txt
documentation about the subtilities of the thumb bit handling in gdbsrv.
* made the SIGFPE backtrace filtering less dependent on gdb/os/libc/...
* improved simulate_control_c : runs faster/less dependent on timeout value
Julian Seward [Sun, 29 May 2011 09:34:30 +0000 (09:34 +0000)]
Give the amd64-linux and x86-linux dispatchers two entry points, not one,
so as to avoid a GSP-changed check in the common case. See vex r2155.
(amd64-darwin and x86-darwin are now temporarily unbuildable.)
Julian Seward [Sat, 28 May 2011 17:07:53 +0000 (17:07 +0000)]
dispatch-x86-linux.S:
use test-based detection of GSP pointer changes.
Saves one load per SB.
dispatch-amd64-linux.S:
ditto
dispatch-amd64-linux.S:
use movabsq to get &VG_(tt_fast) into a register,
instead of an rsp-relative load from a constant pool.
Saves a second load per SB.
Julian Seward [Sat, 28 May 2011 11:05:44 +0000 (11:05 +0000)]
Remove another memory reference from the arm dispatcher loop, by using
the fact that all {VG,VEX}_TRC_VALUES have their lowest bit set. All
other targets can benefit from this trick too.
Julian Seward [Sat, 28 May 2011 10:16:58 +0000 (10:16 +0000)]
Get rid of a bunch of loads in the arm dispatcher inner loops, and
make some attempt to schedule for Cortex-A8. Improves overall IPC
for none running perf/bz2.c "-O" from 0.879 to 0.925.
Julian Seward [Tue, 17 May 2011 21:35:41 +0000 (21:35 +0000)]
gdbserver: (#214909 c 91)
add cleanup: line to none/tests/require-text-symbol-2.vgtest
In case Valgrind terminates abnormally, then no cleanup is done.
In this case, the abnormal termination is in the test which checks
--require-text-symbol=:*libc.so*:doesntexist
This patch adds a cleanup: line to the test.
Julian Seward [Tue, 17 May 2011 18:14:53 +0000 (18:14 +0000)]
gdbserver: (#214909 c 82)
ensure proper cleanup of gdbsrv FIFOs/shmem files with untraced fork/exec
* syswrap-{generic|darwin|aix5}.c : in PRE(sys_execve) : terminate gdbserver
* pub_core_gdbserver.h and m_gdbserver.c : add VG_(gdbserver_prerun_action),
factorising the actions to do by gdbserver at "startup" (i.e. a traced
fork or a traced exec).
* scheduler.c : implement startup action using VG_(gdbserver_prerun_action)
Julian Seward [Tue, 17 May 2011 17:15:07 +0000 (17:15 +0000)]
gdbserver: misc fixes (#214909 c 77)
Fix some tests on ppc-debian6,s390x + handled Nick Nethercote, Josef
Weidendorfer comments
* improved testing & related doc
- added option --vex-iropt-precise-memory-exns=yes to mcsig(no)pass.vgtest
+ updated manual-core.xml
- cleanup some comments in *.vgtest
- modified filter_gdb and filter_memcheck_monitor to
handle specific ppc/debian6.0 mcsig(no)pass output
handle specific s390x 'missing debug info'
- added more information in README_DEVELOPPERS on how to
investigate failing gdbserver tests.
* handled Nick Nethercote comment:
Replaced kludgy ms.snapshot detailed
by ms.detailed_snaphot
Updated documentation and test.
* handled Josef Weindendorfer comments:
- do not report an error if ptrace_scope file can't be read.
Instead, a debug trace is done if -d (debug) option given
- added an option -l to give the list of active Valgrind
gdbserver. Useful a.o. to support callgrind_control.
Updated documentation
- added ref. to vgdb help in the vgdb --help message
Julian Seward [Tue, 17 May 2011 16:35:11 +0000 (16:35 +0000)]
gdbserver: Fixes for ARM-Thumb (#214909 c 76)
fix arm thumb by transforming an address to its thumb form when needed
* added a function thumb_pc transforming a pc to its thumb form if needed
(using an heuristic to guess if this is a thumb address)
* when program counter is modified by gdb, use thumb_pc
* use thumb_pc in monitor command vg.translate
(I was able to check that this improves inferior call on a small
thumb compiled executable + mcinfcallRU test) but I could not compile
all tests with thumb).