FreeBSD regtest: remove unneeded expected file
[valgrind.git] / gdbserver_tests / filter_gdb.in
blob094ea933ec5144691baa1503c1d24e8d01d827be
1 #! /bin/sh
2 # @configure_input@
4 # filter the output of gdb.
6 SED=@SED@
8 PATTERNFILE=$(mktemp filter_gdb.tmp.XXXXXXXXXX)
9 cat > $PATTERNFILE <<EOF
10 # delete the initial lines between the launch of vgdb and the
11 # output of the echo command telling it is launched.
12 # This removes a whole lot of uninteresting lines varying
13 # with OS/glibc/gdb dep
14 /Remote debugging using/,/vgdb launched process attached/d
16 # general way to delete uninteresting and varying lines.
17 /filter_gdb BEGIN drop/,/filter_gdb END drop/d
19 # delete messages produced by valgrind python code loading.
20 /Loaded.*valgrind-monitor.py$/d
21 /Type "help valgrind" for more info\.$/d
22 # and remove loading error messages when python scripts haven't
23 # been installed yet (running against vg-in-place)
24 /warning: Missing auto-load script.*/d
25 /of file .*vgpreload.*so.*/d
26 /Use.*info auto-load python-scripts.*/d
28 # delete messages produced when GDB auto-load denies loading python code.
29 # Note that the first pattern is also present in filter_vgdb.in
30 # as this line is output on stderr.
31 /warning: File .*valgrind-monitor.py.*declined.*/d
32 /To enable execution of this file add/,/info "(gdb)Auto-loading safe path"/d
34 # initial tty control character sent by gdb 7.0
35 s/^\e\[?1034hReading symbols/Reading symbols/
37 # remove message about missing debuginfos
38 /^Missing separate debuginfo/d
40 # remove messages about not being able to download debuginfos
41 /^Download failed: /d
43 # suppress lines telling file _exit.c does not exist
44 /\/_exit.c: No such file or directory/d
46 # On FreeBSD if the base and/or lib32 dbg components
47 # are installed but not system source then these
48 # errors get produced by GDB
49 /\(rtld_start.S\|kill.S\|_exit.S\|_select.S\): No such file or directory/d
51 # FreeBSD syscall wrapper macros
52 /PSEUDO(select)/d
53 /RSYSCALL(kill)/d
55 # Remove some Suse package manager messages
56 /^Try: zypper install -C/d
58 # Remove python rpm module load warning
59 /^Unable to load /d
60 /^the RPM suggestions /d
61 /^installing missing debuginfo /d
62 /^please install /d
64 # Remove vgdb message
65 /relaying data between gdb and process/d
67 # Anonymise pid numbers
68 s/pid [0-9][0-9]*/pid ..../g
70 # Align the 'delete' prompt to the GDB 15 prompt
71 s/Delete all breakpoints?/Delete all breakpoints, watchpoints, tracepoints, and catchpoints?/
73 # Align the 'remote failure reply' string to the GDB 15 behaviour.
74 s/remote failure reply 'E\./remote failure reply '/
76 # filter 'remote target killed' messages (produced by gdb >= 8.2)
77 /(Remote target) killed/d
79 # Anonymise Thread numbers
80 s/Thread [0-9][0-9]*/Thread ..../g
82 # delete thread switches
83 /\[Switching to Thread ....\]/d
85 # delete thread exiting
86 /\[Thread .... exited\]/d
88 # ??? Probably we had a 'Switching ' message in front of
89 # a frame line ?
90 s/\(\[Switching to thread [1234] (Thread ....)\]\)#0/\1\n#0/
92 # Anonymise info threads output (e.g. which thread is running and syscall)
93 s/^\([ \* ] [0-9] Thread .... (tid [0-9] VgTs_WaitSys) 0x........ in\).*$/\1 syscall .../
95 # Newer gdb say Thread .... hit Breakpoint, we expect just Breakpoint.
96 s/^Thread .... hit Breakpoint /Breakpoint /
98 # We expect "Program received" instead of "Thread .... received"
99 s/^Thread .... received /Program received /
101 s/#[0-9]\( 0x........ in sleeper_or_burner\)/#.\1/
103 # Some gdb versions don't show the source line:number after switching
104 # threads in #0 0x........ in do_burn ().
105 s/\(#0 0x........ in do_burn ()\) at sleepers.c:41/\1/
108 # delete Reading symbols file lines
109 # Note: The 'done.' in "Reading symbols from <exe>...done."
110 # is optional (bugzilla 406357).
111 /^Reading symbols from .*\.\.\.\(done\.\)\?/d
113 # delete Loaded symbols file lines
114 /^Loaded symbols for .*$/d
116 # delete language switch messages.
117 /^Current language.*/d
118 /^The current source language is.*/d
120 # 'exited with code' and 'exited normally' are printed slightly
121 # differently between gdb versions, normalize to "Program exited...".
122 s/^.*\( exited with code [0-9]\+\).$/Program\1\./g
123 s/^.*\( exited normally\).$/Program\1\./g
125 # remove gdb prompts.
126 s/(gdb) //g
128 # remove gdb continuation prompts.
129 s/^>[> ]*//
131 # remove gdb done prompts.
132 /^done\.$/d
134 # anonymise a 'general' system calls stack trace part
135 s/in _dl_sysinfo_int80 () from \/lib\/ld-linux.so.*/in syscall .../
137 # anonymise kill syscall.
138 s/in kill ().*$/in syscall .../
140 # anonymise syscall on ppc64 (bugzilla #284305)
141 s/in .*kill ().*$/in syscall .../
143 s/in _dl_sysinfo_int80 ()/in syscall .../
144 /^ from \/lib\/ld-linux.so.*$/d
145 s/\(0x........\) in ?? () from \/lib.*$/\1 in syscall .../
146 s/\(0x........\) in ?? ()$/\1 in syscall .../
147 s/in __select64 (.*/in syscall .../
149 # 4 expressions to cover glibc 2.27 way to do a select, such as
150 # * 1 Thread 5548 (tid 1 VgTs_WaitSys) 0x0000000004f6203f in __GI___select (
151 # nfds=0, readfds=0x0, writefds=0x0, exceptfds=0x0, timeout=0x30a0e0 <t>)
152 # at ../sysdeps/unix/sysv/linux/select.c:41
153 # If select.c sources are present, we can also get a line containing:
154 # return SYSCALL_CANCEL....
155 s/in __select .*/in syscall .../
156 s/in __select$/in syscall .../
157 s/in _select ()/in syscall .../
158 /nfds=/d
159 /exceptfds=/d
160 /timeout=/d
161 /sysv\/linux\/select\.c/d
162 /sysv\/linux\/generic\/select.c/d
163 /return SYSCALL_CANCEL /d
164 /r = SYSCALL_CANCEL /d
165 /result = SYSCALL_CANCEL /d
167 # a more specialised system call select stack trace part
168 # (on 32 bits, we have an int_80, on 64 bits, directly select)
169 s/in \(.__\)\{0,1\}select () from \/.*$/in syscall .../
171 /^ from \/lib.*\/libc.so.*$/d
172 /^ from \/lib64.*\/libc.so.*$/d
173 /^ from \/lib64.*\/.*\/libc.so.*$/d
174 /^ from \/lib64.*\/.*\/libc-.*.so/d
175 s/ from \/lib\/libc\.so.*//
177 # and yet another (gdb 7.0 way) to get a system call
178 s/in select ()$/in syscall .../
180 # and yet another (gdb 7.0 arm way) to get a system call
181 s/in \.__select ()$/in syscall .../
183 # + yet another way to get a select system call
184 s/in select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../
186 # FreeBSD system call
187 s/_select () at _select.S:.*$/0x........ in syscall .../
189 # FreeBSD system call again
190 /in _select.S/d
192 # FreeBSD system call
193 s/kill () at kill.S:.*$/0x........ in syscall .../
195 # filter out names which starts with a "."
196 # such names are used for "function descriptors" on ppc64
197 # bugzilla 406561
198 s/in \.__select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../
200 # cleanup some lines for a system call (on ubuntu 10 64 bits)
201 # (pay attention : there are tab characters there in)
202 /^[ ]*at \.\.\/sysdeps\/unix\/syscall-template\.S/d
203 /^[ ]*in \.\.\/sysdeps\/unix\/syscall-template\.S/d
205 /^\(warning: \)\?[1-9][0-9]*[ ]*\.\.\/sysdeps\/unix\/syscall-template\.S/d
206 /^[1-9][0-9]*[ ]in *\.\.\/sysdeps\/unix\/syscall-template\.S/d
207 /^[1-9][0-9]*[ ]T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)/d
209 # and yet another (Solaris way) to get a poll system call
210 # (on 32 bits, we have /lib/libc.so.*, on 64 bits, /lib/64/libc.so.*)
211 s/in __pollsys () from \/.*$/in syscall .../
212 /^ from \/lib\/64\/libc.so.*$/d
214 # which registers can't be modified
215 s/\(Could not write register \)".*"/\1 "xxx"/
216 s/\(ERROR changing register \).*$/\1 xxx regno y/
218 # special transform for arm/ppc watchpoints which have an additional address
219 # at the beginning
220 s/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/
222 s/0x........ in \(main () at clean_after_fork.c:34\)/\1/
224 # SIGFPE backtrace is varying so much that we just remove all lines
225 # after the signal trapping using an expr in this sed, followed by another sed.
226 s/\(^.*signal SIGFPE.*$\)/\1\nafter trap SIGFPE/
228 # gdb might also try to show the "entry value" p=p@entry=0x...
229 s/p=p@entry=0x/p=0x/
231 # for hgtls the breakpoint p=... address might show var location.
232 s/\(^Breakpoint 1, tls_ptr (p=0x........\) <tests[0-9+]*>\() at tls.c:55\)/\1\2/
234 /Id Target Id *Frame/d
235 s/^\([ \*] [1234] \) *Thread /\1Thread /
237 # Ordering of ' Thread .... (tid .' might differ between gdb version,
238 # so remove all such lines except the "current" one (starts with '*').
239 s/^ [0-9] Thread .... (tid [0-9] .*$//
241 # transform info thread of 7.3 into the layout of 7.2 and before.
242 s/VgTs_WaitSys) 0x/VgTs_WaitSys) 0x/
244 # delete lines telling that some memory can't be accessed: this is
245 # a.o. produced by gdb 7.2 on arm (same with standard gdbserver)
246 /Cannot access memory at address 0x......../d
248 # Filter 'New thread' lines
249 # gdb 7.9 reports new threads at different moment than the previous versions.
250 # Filter these new threads lines so as to not be dependent on this
251 # gdb aspect.
252 /\[New Thread/d
254 # 406355
255 # adjust filtering for the new gdb output
256 # mcsigpass and mcsignopass tests fails due to the slightly different
257 # gdb output. Filter the tests output to make it the same for different
258 # gdb version. Change mcsigpass and mcsignopass .exp to fit filtered
259 # .out.
260 s/^0x........ in \(\w\+ (\)/\1/
262 # delete empty lines (the last line (only made of prompts) sometimes
263 # finishes with a new line, sometimes not ???).
264 /^$/d
266 # delete any missing debuginfo messages
267 /^Missing debuginfo.*/d
271 dir=`dirname $0`
273 $dir/filter_stderr |
275 # Anonymise addresses
276 $dir/../tests/filter_addresses |
278 # memcheck stuff
279 $dir/filter_memcheck_monitor "$@" |
281 # memcheck filter might leave some "..." lines, we are not interested
282 $SED -e '/^\ \ \ \ \.\.\.$/d' |
284 # Anonymise or remove, using the big list of PATTERN prepared above
285 $SED -f $PATTERNFILE |
287 # remove all the lines telling where the SIGFPE was trapped.
288 $SED -e '/after trap SIGFPE/,/after continue SIGFPE/d' |
290 # join together two lines that gdb 7.1 splits in two (???)
291 # (in a separate sed, as the below influences the behaviour of the other expressions)
292 $SED -e :a -e '$!N;s/\n at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D'
294 rm $PATTERNFILE