]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/gdbserver_tests/filter_gdb
update
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / gdbserver_tests / filter_gdb
1 #! /bin/sh
2
3 # filter the output of gdb.
4
5 dir=`dirname $0`
6
7 $dir/filter_stderr                                                  |
8
9 # Anonymise addresses
10 $dir/../tests/filter_addresses                                      |
11
12 # memcheck stuff
13 $dir/filter_memcheck_monitor                                        |
14
15
16 # Anonymise or remove :
17 #       delete the initial lines between the launch of vgdb and the
18 #         output of the echo command telling it is launched.
19 #         This removes a whole lot of uninteresting lines varying
20 #         with OS/glibc/gdb dep
21 #       initial tty control character sent by gdb 7.0
22 #       remove missing debuginfos
23 #       vgdb message
24 #       pid numbers
25 #       Thread numbers
26 #       delete thread switches
27 #       info threads output (e.g. which thread is running and syscall)
28 #       delete Reading symbols file lines
29 #       delete Loaded symbols file lines
30 #       delete language switch messages.
31 #       remove gdb prompts.
32 #       remove gdb continuation prompts.
33 #       remove gdb done prompts.
34 #       a 'general' system calls stack trace part
35 #       a more specialised system call select stack trace part
36 #             (on 32 bits, we have an int_80, on 64 bits, directly select)
37 #       and yet another (gdb 7.0 way) to get a system call
38 #       and yet another (gdb 7.0 arm way) to get a system call
39 #       and cleanup some lines for a system call (on ubuntu 10 64 bits)
40 #           (pay attention : there are tab characters there in)
41 #           + yet another way to get a select system call
42 #       which registers can't be modified
43 #       special transform for arm/ppc watchpoints which have an additional address
44 #              at the beginning
45 #       special transform for backtrace of arm or ppc division by zero which gives
46 #             a location in the nptl lib rather than our sources (same as
47 #              standard gdb gdbserver) gdb 7.0
48 #       same special transform but for gdb 7.2
49 #       delete lines telling that some memory can't be accessed: this is
50 #         a.o. produced by gdb 7.2 on arm (same with standard gdbserver)
51 #       delete empty lines (the last line (only made of prompts) sometimes
52 #           finishes with a new line, sometimes not ???).
53 sed -e '/Remote debugging using/,/vgdb launched process attached/d'                                   \
54     -e 's/^\e\[?1034hReading symbols/Reading symbols/'                                                \
55     -e '/^Missing separate debuginfo/d'                                                               \
56     -e '/^Try: zypper install -C/d'                                                                   \
57     -e 's/\(relaying data between gdb and process \)[0-9][0-9]*/\1..../'                              \
58     -e 's/pid [0-9][0-9]*/pid ..../g'                                                                 \
59     -e 's/Thread [0-9][0-9]*/Thread ..../g'                                                           \
60     -e '/\[Switching to Thread ....\]/d'                                                              \
61     -e 's/^\([ \* ] [0-9] Thread .... (tid [0-9] VgTs_WaitSys)  0x........ in\).*$/\1 syscall .../'   \
62     -e 's/#[0-9]\(  0x........ in sleeper_or_burner\)/#.\1/'                                          \
63     -e '/^Reading symbols from .*\.\.\.done\./d'                                                      \
64     -e '/^Loaded symbols for .*$/d'                                                                   \
65     -e '/^Current language.*/d'                                                                       \
66     -e '/^The current source language is.*/d'                                                         \
67     -e 's/(gdb) //g'                                                                                  \
68     -e 's/^>[> ]*//'                                                                                  \
69     -e '/^done\.$/d'                                                                                  \
70     -e 's/in _dl_sysinfo_int80 () from \/lib\/ld-linux.so.*/in syscall .../'                          \
71     -e 's/in _dl_sysinfo_int80 ()/in syscall .../'                                                    \
72     -e '/^   from \/lib\/ld-linux.so.*$/d'                                                            \
73     -e 's/\(0x........\) in ?? () from \/lib.*$/\1 in syscall .../'                                   \
74     -e 's/\(0x........\) in ?? ()$/\1 in syscall .../'                                                \
75     -e 's/in \(.__\)\{0,1\}select () from \/.*$/in syscall .../'                                      \
76     -e '/^   from \/lib\/libc.so.*$/d'                                                                \
77     -e '/^   from \/lib64\/libc.so.*$/d'                                                              \
78     -e '/^   from \/lib64\/tls\/libc.so.*$/d'                                                         \
79     -e 's/in select ()$/in syscall .../'                                                              \
80     -e 's/in \.__select ()$/in syscall .../'                                                          \
81     -e 's/in select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../'                \
82     -e '/^[     ]*at \.\.\/sysdeps\/unix\/syscall-template\.S/d'                                      \
83     -e '/^[     ]*in \.\.\/sysdeps\/unix\/syscall-template\.S/d'                                      \
84     -e '/^[1-9][0-9]*[  ]*\.\.\/sysdeps\/unix\/syscall-template\.S/d'                                 \
85     -e '/^[1-9][0-9]*[  ]in *\.\.\/sysdeps\/unix\/syscall-template\.S/d'                              \
86     -e 's/\(Could not write register \)".*"/\1 "xxx"/'                                                \
87     -e 's/\(ERROR changing register \).*$/\1 xxx regno y/'                                            \
88     -e 's/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/'           \
89     -e 's/0x........ in \(main () at clean_after_fork.c:32\)/\1/'                                     \
90     -e 's/^0x........ in \*__GI_raise (sig=8).*/0x........ in test4 () at faultstatus.c:120\n120                volatile int v = 44\/zero();/' \
91     -e '/    at ..\/nptl\/sysdeps\/unix\/sysv\/linux\/raise.c:[0-9]*/d'                               \
92     -e '/       in ..\/nptl\/sysdeps\/unix\/sysv\/linux\/raise.c/d'                                   \
93     -e 's/^0x........ in \.\{0,1\}raise () from \/lib[0-9]\{0,2\}\/libc\.so\../0x........ in test4 () at faultstatus.c:120\n120         volatile int v = 44\/zero();'/ \
94     -e '/Cannot access memory at address 0x......../d'                                                \
95     -e '/^$/d' |
96
97 # join together two lines that gdb 7.1 splits in two (???)
98 # (in a separate sed, as the below influences the behaviour of the other expressions)
99 sed    -e :a -e '$!N;s/\n    at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D'
100