25 Commits

Author SHA1 Message Date
Florian Krohm
ad7a355b4a Improve filtering of backtrace noise in the memcheck bucket
and update exp files accordingly. This works well for x86
and all testcases pass on my machine.
New file filter_memcheck to do the work. 
There is a bit of a ripple here as filter_memcheck requires
command line arguments to be passed in. So all users of 
filter_memcheck (direct or indirect) were updated as well.
filter_stderr was simplified as was filter_libc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12091
2011-10-03 23:39:54 +00:00
Florian Krohm
b125cb6ef8 Complain if invoked from the wrong directory or if mandatory
argument is missing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11974
2011-08-13 15:35:21 +00:00
Julian Seward
d1e0bf1d9e GDB server: fix tests following recent commits.
Fixes #276987.  (Philippe Waroquiers, philippe.waroquiers@skynet.be)

* 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



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11853
2011-07-04 22:00:41 +00:00
Julian Seward
97c113e7e0 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

(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 111.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11844
2011-06-28 08:20:39 +00:00
Julian Seward
9aa59b5cfa Another make dist fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11843
2011-06-28 07:38:17 +00:00
Julian Seward
b4e2ade329 Fix 'make dist' following recent gdbserver commits.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11841
2011-06-27 23:31:07 +00:00
Julian Seward
5c1e65aa42 Memcheck:
* add delta leak checking functionality
* some editing of related manual sections
(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 105.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11838
2011-06-26 12:41:33 +00:00
Julian Seward
64940ed44a GDB server:
* Fix bug in logic related to signal-passing
* use SIGSTOP instead of SIGTRAP (avoid race condition)
(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 109.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11837
2011-06-26 09:36:38 +00:00
Julian Seward
7be9d63ed0 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11836
2011-06-26 09:26:48 +00:00
Julian Seward
5689679404 GDB server:
* fix error in usability msg
* make a test more deterministic
(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 107.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11835
2011-06-26 09:13:27 +00:00
Julian Seward
46d08c579d 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11822
2011-06-18 08:28:04 +00:00
Julian Seward
196c5d876c 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)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11818
2011-06-15 21:30:55 +00:00
Julian Seward
62e0d0b316 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


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11791
2011-05-31 07:09:06 +00:00
Julian Seward
dd51367883 Further fixes for GDB server on Thumb code:
* Disabled several tests on ARM when gdb version < 7.1
  gdb 7.0 has problems with next/step/... in ARM thumb code.

* Documented in manual-core.xml that ARM thumb code implies
  a gdb version >= 7.1

* m_gdbserver.h/.c : take into account the thumb bit at several places

* use new IRStmt_IMark::delta field to distinguish ARM vs Thumb
  instructions as committed in vex r2153

Patch from bug 214909 comment 99 (valgrind part).
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11779
2011-05-27 13:23:44 +00:00
Julian Seward
739bc05601 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

(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11770
2011-05-17 17:15:07 +00:00
Bart Van Assche
1a2eb84398 gdbserver_tests/make_local_links: made invocation of "head" POSIX-compliant since on some distros only the POSIX-compliant invocation is accepted.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11759
2011-05-15 17:07:47 +00:00
Bart Van Assche
e9947dd263 Removed "prereq: test -e gdb" again from those tests that do not invoke the script gdbserver_tests/gdb.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11756
2011-05-15 16:45:42 +00:00
Bart Van Assche
bdf797c009 gdbserver tests: only create the gdbserver_tests/gdb soft link if ./configure found gdb.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11753
2011-05-15 06:18:24 +00:00
Bart Van Assche
75f462e649 Skip gdbserver tests if ./configure did not find gdb.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11752
2011-05-15 06:07:57 +00:00
Bart Van Assche
29b06865ca gdbserver_tests/t.c: Fixed two occurrences of the same typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11751
2011-05-15 05:44:59 +00:00
Julian Seward
619a546991 * fixed two bugs reported by the IBM BEAM checker:
fd leak in vgdb.c
     break missing in valgrind-low-s390x.c

* use option --vgdb=full for the tests mcsigpass.vgtest and mcsignopass.vgtest
  This might improve these tests on ppc32/debian 6.0

* added a paragraph in gdbserver_tests/README_DEVELOPPERS to indicate
  how to report problems about failing gdbserver tests.

(bug 214909 comment 71, Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11748
2011-05-11 22:54:57 +00:00
Julian Seward
b37b05d214 Improvements for testing and compilation breakage for the GDB server
on various platforms:

* In all gdbserver_tests using gdb:
  Made a more general way to remove the initial start message.

* tests using threads burning cpu modified to have only 1 thread.
  This makes them independent of the scheduler fairness.

* filter_gdb and filter_vgdb enhanced to anonymise
    some debian 6.0/ppc specific things
    some s390x/gdb 7.0, gdb 7.1  specific things

* vgdb.c: added an #include <linux/ptrace.h> to fix compilation
  on s390x fedora and suse. (Christian Boerntrager)

* fixed a bug in valgrind-low.c debug log :
  when a register size is 0, its image cannot be output (and register
  should not be transferred).

* added a parameter --keep-unfiltered to vg_regtest.in
  This will make it easier to update filter_gdb:
  in case gdbserver_tests are failing due to "artificial"
  differences to be filtered, re-run the tests using:
     perl tests/vg_regtest --keep-unfiltered gdbserver_tests
  Then a tar file with all the *.out in gdbserver_tests
  will allow me to better/faster update the filter_gdb.

* made a better detection of a working PTRACE_GETREGS at compile time
  and/or at run-time.

This is the patch on bug 214909 comment 69.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11740
2011-05-10 11:01:07 +00:00
Bart Van Assche
0674835647 Follow-up for r11729: make the gdbserver regression tests pass again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11730
2011-05-08 10:10:04 +00:00
Bart Van Assche
3bea9dc7de Fixed one bug in gdbserver_tests/t.c and several compiler warnings triggered by the gdbserver test programs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11729
2011-05-08 09:29:06 +00:00
Julian Seward
2ee9e90486 Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727
2011-05-06 21:02:55 +00:00