drd/tests/std_thread2: Disable this test temporarily such that the suppression patter...
[valgrind.git] / gdbserver_tests / filter_gdb
blob0e1fd75a581dc3af9bcb403d084a466f53903c8e
1 #! /bin/sh
3 # filter the output of gdb.
5 dir=`dirname $0`
7 $dir/filter_stderr |
9 # Anonymise addresses
10 $dir/../tests/filter_addresses |
12 # memcheck stuff
13 $dir/filter_memcheck_monitor "$@" |
15 # memcheck filter might leave some "..." lines, we are not interested
16 sed -e '/^\ \ \ \ \.\.\.$/d' |
18 # Anonymise or remove :
19 # delete the initial lines between the launch of vgdb and the
20 # output of the echo command telling it is launched.
21 # This removes a whole lot of uninteresting lines varying
22 # with OS/glibc/gdb dep
23 # then have a general way to delete uninteresting and vayring
24 # lines.
25 # suppress lines telling file _exit.c does not exist
26 # initial tty control character sent by gdb 7.0
27 # remove missing debuginfos
28 # vgdb message
29 # pid numbers
30 # Thread numbers
31 # delete thread switches
32 # info threads output (e.g. which thread is running and syscall)
33 # delete Reading symbols file lines
34 # delete Loaded symbols file lines
35 # delete language switch messages.
36 # remove gdb prompts.
37 # remove gdb continuation prompts.
38 # remove gdb done prompts.
39 # a 'general' system calls stack trace part
40 # a more specialised system call select stack trace part
41 # (on 32 bits, we have an int_80, on 64 bits, directly select)
42 # and yet another (gdb 7.0 way) to get a system call
43 # and yet another (gdb 7.0 arm way) to get a system call
44 # and cleanup some lines for a system call (on ubuntu 10 64 bits)
45 # (pay attention : there are tab characters there in)
46 # + yet another way to get a select system call
47 # which registers can't be modified
48 # special transform for arm/ppc watchpoints which have an additional address
49 # at the beginning
50 # SIGFPE backtrace is varying so much that we just remove all lines
51 # after the signal trapping using an expr in this sed, followed by another sed.
52 # transform info thread of 7.3 into the layout of 7.2 and before.
53 # delete lines telling that some memory can't be accessed: this is
54 # a.o. produced by gdb 7.2 on arm (same with standard gdbserver)
55 # delete empty lines (the last line (only made of prompts) sometimes
56 # finishes with a new line, sometimes not ???).
57 # 'exited with code' and 'exited normally' are printed slightly
58 # differently between gdb versions, normalize to "Program exited...".
59 sed -e '/Remote debugging using/,/vgdb launched process attached/d' \
60 -e '/filter_gdb BEGIN drop/,/filter_gdb END drop/d' \
61 -e 's/^\e\[?1034hReading symbols/Reading symbols/' \
62 -e '/^Missing separate debuginfo/d' \
63 -e '/\/_exit.c: No such file or directory/d' \
64 -e '/^Try: zypper install -C/d' \
65 -e 's/\(relaying data between gdb and process \)[0-9][0-9]*/\1..../' \
66 -e 's/pid [0-9][0-9]*/pid ..../g' \
67 -e 's/Thread [0-9][0-9]*/Thread ..../g' \
68 -e '/\[Switching to Thread ....\]/d' \
69 -e 's/\(\[Switching to thread [1234] (Thread ....)\]\)#0/\1\n#0/' \
70 -e 's/^\([ \* ] [0-9] Thread .... (tid [0-9] VgTs_WaitSys) 0x........ in\).*$/\1 syscall .../' \
71 -e 's/#[0-9]\( 0x........ in sleeper_or_burner\)/#.\1/' \
72 -e '/^Reading symbols from .*\.\.\.done\./d' \
73 -e '/^Loaded symbols for .*$/d' \
74 -e '/^Current language.*/d' \
75 -e '/^The current source language is.*/d' \
76 -e 's/^.*\( exited with code [0-9]\+\).$/Program\1\./g' \
77 -e 's/^.*\( exited normally\).$/Program\1\./g' \
78 -e 's/(gdb) //g' \
79 -e 's/^>[> ]*//' \
80 -e '/^done\.$/d' \
81 -e 's/in _dl_sysinfo_int80 () from \/lib\/ld-linux.so.*/in syscall .../' \
82 -e 's/in kill ().*$/in syscall .../' \
83 -e 's/in .*kill ().*$/in syscall .../' \
84 -e 's/in _dl_sysinfo_int80 ()/in syscall .../' \
85 -e '/^ from \/lib\/ld-linux.so.*$/d' \
86 -e 's/\(0x........\) in ?? () from \/lib.*$/\1 in syscall .../' \
87 -e 's/\(0x........\) in ?? ()$/\1 in syscall .../' \
88 -e 's/in \(.__\)\{0,1\}select () from \/.*$/in syscall .../' \
89 -e '/^ from \/lib\/libc.so.*$/d' \
90 -e '/^ from \/lib64\/libc.so.*$/d' \
91 -e '/^ from \/lib64\/.*\/libc.so.*$/d' \
92 -e 's/in select ()$/in syscall .../' \
93 -e 's/in \.__select ()$/in syscall .../' \
94 -e 's/in select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../' \
95 -e '/^[ ]*at \.\.\/sysdeps\/unix\/syscall-template\.S/d' \
96 -e '/^[ ]*in \.\.\/sysdeps\/unix\/syscall-template\.S/d' \
97 -e '/^[1-9][0-9]*[ ]*\.\.\/sysdeps\/unix\/syscall-template\.S/d' \
98 -e '/^[1-9][0-9]*[ ]in *\.\.\/sysdeps\/unix\/syscall-template\.S/d' \
99 -e '/^[1-9][0-9]*[ ]T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)/d' \
100 -e 's/\(Could not write register \)".*"/\1 "xxx"/' \
101 -e 's/\(ERROR changing register \).*$/\1 xxx regno y/' \
102 -e 's/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/' \
103 -e 's/0x........ in \(main () at clean_after_fork.c:34\)/\1/' \
104 -e 's/\(^.*signal SIGFPE.*$\)/\1\nafter trap SIGFPE/' \
105 -e '/Id Target Id Frame/d' \
106 -e 's/^\([ \*] [1234] \) *Thread /\1Thread /' \
107 -e 's/VgTs_WaitSys) 0x/VgTs_WaitSys) 0x/' \
108 -e '/Cannot access memory at address 0x......../d' \
109 -e '/^$/d' |
111 # remove all the lines telling where the SIGFPE was trapped.
112 sed -e '/after trap SIGFPE/,/after continue SIGFPE/d' |
114 # join together two lines that gdb 7.1 splits in two (???)
115 # (in a separate sed, as the below influences the behaviour of the other expressions)
116 sed -e :a -e '$!N;s/\n at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D'