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

77 lines
2.1 KiB
Plaintext

# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcleak
echo vgdb launched process attached\n
monitor vg.set vgdb-error 999999
#
#
# insert break:
break breakme
#
# continue till each break and execute via gdb the leak search as done in the C code.
continue
#
#
# fprintf(stderr, "expecting details 10 bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check any reachable full
continue
# VALGRIND_DO_LEAK_CHECK;
#
# fprintf(stderr, "expecting to have NO details\n"); fflush(stderr);
up
monitor mc.leak_check increased reachable full
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# b10--; // lose b10
# b21 = malloc (21);
# fprintf(stderr, "expecting details +10 bytes lost, +21 bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check increased reachable full
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# for (i = 0; i < 2; i ++)
# b32_33[i] = malloc (32+i);
# fprintf(stderr, "expecting details +65 bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check increased reachable full
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# fprintf(stderr, "expecting to have NO details\n"); fflush(stderr); breakme();
up
monitor mc.leak_check increased reachable full
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# b10++;
# fprintf(stderr, "expecting details +10 bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check increased reachable full
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# b10--;
# fprintf(stderr, "expecting details -10 bytes reachable, +10 bytes lost\n"); fflush(stderr); breakme();
up
monitor mc.leak_check changed reachable full
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
# b10++;
# fprintf(stderr, "expecting details -10 bytes lost, +10 bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check changed reachable full
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
# b32_33[0]--;
# fprintf(stderr, "expecting details 32 (+32) bytes lost, 33 (-32) bytes reachable\n"); fflush(stderr); breakme();
up
monitor mc.leak_check changed reachable full
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
quit